@@ -1523,28 +1523,30 @@ async function onMessage(msg: p.Message) {
15231523 The client can watch files for us and send us events via the `workspace/didChangeWatchedFiles`
15241524 */
15251525 const watchers = Array . from ( workspaceFolders ) . flatMap (
1526- ( projectRootPath ) => [
1527- {
1528- // Only watch the root compiler log for each workspace folder.
1529- // In monorepos, `**/lib/bs/.compiler.log` matches every package and dependency,
1530- // causing a burst of events per save.
1531- globPattern : path . join ( projectRootPath , c . compilerLogPartialPath ) ,
1532- kind : p . WatchKind . Change | p . WatchKind . Create | p . WatchKind . Delete ,
1533- } ,
1534- {
1535- globPattern : path . join (
1536- projectRootPath ,
1537- "**" ,
1538- c . buildNinjaPartialPath ,
1539- ) ,
1540- kind : p . WatchKind . Change | p . WatchKind . Create | p . WatchKind . Delete ,
1541- } ,
1542- {
1543- globPattern : `${ path . join ( projectRootPath , "**" , c . compilerDirPartialPath ) } /**/*.{cmt,cmi}` ,
1544- kind : p . WatchKind . Change | p . WatchKind . Delete ,
1545- } ,
1546- ] ,
1526+ ( projectRootPath ) => {
1527+ return [
1528+ {
1529+ // Watch compiler log
1530+ globPattern : {
1531+ baseUri : utils . pathToURI ( projectRootPath ) ,
1532+ pattern : c . compilerLogPartialPath ,
1533+ } ,
1534+ kind :
1535+ p . WatchKind . Change | p . WatchKind . Create | p . WatchKind . Delete ,
1536+ } ,
1537+ {
1538+ // Watch build artifacts (absolute path converted to relative)
1539+ globPattern : {
1540+ baseUri : utils . pathToURI ( projectRootPath ) ,
1541+ pattern : path . join ( c . compilerDirPartialPath , "**/*.{cmi,cmt}" ) ,
1542+ } ,
1543+ kind :
1544+ p . WatchKind . Change | p . WatchKind . Create | p . WatchKind . Delete ,
1545+ } ,
1546+ ] ;
1547+ } ,
15471548 ) ;
1549+
15481550 const registrationParams : p . RegistrationParams = {
15491551 registrations : [
15501552 {
0 commit comments