@@ -121,33 +121,33 @@ let openedFile = (fileUri: string, fileContent: string) => {
121121
122122 stupidFileContentCache . set ( filePath , fileContent ) ;
123123
124- let projectRootPath = utils . findProjectRootOfFile ( filePath ) ;
125- if ( projectRootPath != null ) {
126- if ( ! projectsFiles . has ( projectRootPath ) ) {
127- projectsFiles . set ( projectRootPath , {
124+ let buildRootPath = utils . findBuildRootOfFile ( filePath ) ;
125+ if ( buildRootPath != null ) {
126+ if ( ! projectsFiles . has ( buildRootPath ) ) {
127+ projectsFiles . set ( buildRootPath , {
128128 openFiles : new Set ( ) ,
129129 filesWithDiagnostics : new Set ( ) ,
130130 bsbWatcherByEditor : null ,
131131 } ) ;
132132 compilerLogsWatcher . add (
133- path . join ( projectRootPath , c . compilerLogPartialPath )
133+ path . join ( buildRootPath , c . compilerLogPartialPath )
134134 ) ;
135135 }
136- let root = projectsFiles . get ( projectRootPath ) ! ;
136+ let root = projectsFiles . get ( buildRootPath ) ! ;
137137 root . openFiles . add ( filePath ) ;
138138 let firstOpenFileOfProject = root . openFiles . size === 1 ;
139139 // check if .bsb.lock is still there. If not, start a bsb -w ourselves
140140 // because otherwise the diagnostics info we'll display might be stale
141- let bsbLockPath = path . join ( projectRootPath , c . bsbLock ) ;
141+ let bsbLockPath = path . join ( buildRootPath , c . bsbLock ) ;
142142 if ( firstOpenFileOfProject && ! fs . existsSync ( bsbLockPath ) ) {
143- let bsbPath = path . join ( projectRootPath , c . bsbPartialPath ) ;
143+ let bsbPath = path . join ( buildRootPath , c . bsbPartialPath ) ;
144144 // TODO: sometime stale .bsb.lock dangling. bsb -w knows .bsb.lock is
145145 // stale. Use that logic
146146 // TODO: close watcher when lang-server shuts down
147147 if ( fs . existsSync ( bsbPath ) ) {
148148 let payload : clientSentBuildAction = {
149149 title : c . startBuildAction ,
150- projectRootPath : projectRootPath ,
150+ projectRootPath : buildRootPath ,
151151 } ;
152152 let params = {
153153 type : p . MessageType . Info ,
@@ -178,17 +178,17 @@ let closedFile = (fileUri: string) => {
178178
179179 stupidFileContentCache . delete ( filePath ) ;
180180
181- let projectRootPath = utils . findProjectRootOfFile ( filePath ) ;
182- if ( projectRootPath != null ) {
183- let root = projectsFiles . get ( projectRootPath ) ;
181+ let buildRootPath = utils . findBuildRootOfFile ( filePath ) ;
182+ if ( buildRootPath != null ) {
183+ let root = projectsFiles . get ( buildRootPath ) ;
184184 if ( root != null ) {
185185 root . openFiles . delete ( filePath ) ;
186186 // clear diagnostics too if no open files open in said project
187187 if ( root . openFiles . size === 0 ) {
188188 compilerLogsWatcher . unwatch (
189- path . join ( projectRootPath , c . compilerLogPartialPath )
189+ path . join ( buildRootPath , c . compilerLogPartialPath )
190190 ) ;
191- deleteProjectDiagnostics ( projectRootPath ) ;
191+ deleteProjectDiagnostics ( buildRootPath ) ;
192192 if ( root . bsbWatcherByEditor !== null ) {
193193 root . bsbWatcherByEditor . kill ( ) ;
194194 root . bsbWatcherByEditor = null ;
0 commit comments