Skip to content

Commit be5828d

Browse files
committed
fix: update globs to work on windows with WSL
1 parent 0326ae7 commit be5828d

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

server/src/server.ts

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,23 +1528,43 @@ async function onMessage(msg: p.Message) {
15281528
// Only watch the root compiler log for each workspace folder.
15291529
// In monorepos, `**/lib/bs/.compiler.log` matches every package and dependency,
15301530
// causing a burst of events per save.
1531-
globPattern: path.join(projectRootPath, c.compilerLogPartialPath),
1531+
globPattern: {
1532+
baseUri: utils.pathToURI(projectRootPath),
1533+
pattern: c.compilerDirPartialPath,
1534+
},
15321535
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
15331536
},
15341537
{
1535-
globPattern: path.join(
1536-
projectRootPath,
1537-
"**",
1538-
c.buildNinjaPartialPath,
1539-
),
1538+
// Watch source files
1539+
globPattern: {
1540+
baseUri: utils.pathToURI(projectRootPath),
1541+
pattern: "**/*.{res,resi}",
1542+
},
15401543
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
15411544
},
15421545
{
1543-
globPattern: `${path.join(projectRootPath, "**", c.compilerDirPartialPath)}/**/*.{cmt,cmi}`,
1544-
kind: p.WatchKind.Change | p.WatchKind.Delete,
1546+
// Watch build output
1547+
globPattern: {
1548+
baseUri: utils.pathToURI(projectRootPath),
1549+
pattern: path.join(
1550+
"**",
1551+
c.compilerDirPartialPath,
1552+
"**/*.{cmt,cmi}",
1553+
),
1554+
},
1555+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1556+
},
1557+
{
1558+
// Watch lock file
1559+
globPattern: {
1560+
baseUri: utils.pathToURI(projectRootPath),
1561+
pattern: "lib/rescript.lock",
1562+
},
1563+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
15451564
},
15461565
],
15471566
);
1567+
15481568
const registrationParams: p.RegistrationParams = {
15491569
registrations: [
15501570
{

server/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,4 +1080,4 @@ export let rangeContainsRange = (
10801080
return false;
10811081
}
10821082
return true;
1083-
};
1083+
};

0 commit comments

Comments
 (0)