@@ -126,33 +126,33 @@ let openedFile = (fileUri: string, fileContent: string) => {
126126
127127 stupidFileContentCache . set ( filePath , fileContent ) ;
128128
129- let projectRootPath = utils . findProjectRootOfFile ( filePath ) ;
130- if ( projectRootPath != null ) {
131- if ( ! projectsFiles . has ( projectRootPath ) ) {
132- projectsFiles . set ( projectRootPath , {
129+ let buildRootPath = utils . findBuildRootOfFile ( filePath ) ;
130+ if ( buildRootPath != null ) {
131+ if ( ! projectsFiles . has ( buildRootPath ) ) {
132+ projectsFiles . set ( buildRootPath , {
133133 openFiles : new Set ( ) ,
134134 filesWithDiagnostics : new Set ( ) ,
135135 bsbWatcherByEditor : null ,
136136 } ) ;
137137 compilerLogsWatcher . add (
138- path . join ( projectRootPath , c . compilerLogPartialPath )
138+ path . join ( buildRootPath , c . compilerLogPartialPath )
139139 ) ;
140140 }
141- let root = projectsFiles . get ( projectRootPath ) ! ;
141+ let root = projectsFiles . get ( buildRootPath ) ! ;
142142 root . openFiles . add ( filePath ) ;
143143 let firstOpenFileOfProject = root . openFiles . size === 1 ;
144144 // check if .bsb.lock is still there. If not, start a bsb -w ourselves
145145 // because otherwise the diagnostics info we'll display might be stale
146- let bsbLockPath = path . join ( projectRootPath , c . bsbLock ) ;
146+ let bsbLockPath = path . join ( buildRootPath , c . bsbLock ) ;
147147 if ( firstOpenFileOfProject && ! fs . existsSync ( bsbLockPath ) ) {
148- let bsbPath = path . join ( projectRootPath , c . bsbPartialPath ) ;
148+ let bsbPath = path . join ( buildRootPath , c . bsbPartialPath ) ;
149149 // TODO: sometime stale .bsb.lock dangling. bsb -w knows .bsb.lock is
150150 // stale. Use that logic
151151 // TODO: close watcher when lang-server shuts down
152152 if ( fs . existsSync ( bsbPath ) ) {
153153 let payload : clientSentBuildAction = {
154154 title : c . startBuildAction ,
155- projectRootPath : projectRootPath ,
155+ projectRootPath : buildRootPath ,
156156 } ;
157157 let params = {
158158 type : p . MessageType . Info ,
@@ -183,17 +183,17 @@ let closedFile = (fileUri: string) => {
183183
184184 stupidFileContentCache . delete ( filePath ) ;
185185
186- let projectRootPath = utils . findProjectRootOfFile ( filePath ) ;
187- if ( projectRootPath != null ) {
188- let root = projectsFiles . get ( projectRootPath ) ;
186+ let buildRootPath = utils . findBuildRootOfFile ( filePath ) ;
187+ if ( buildRootPath != null ) {
188+ let root = projectsFiles . get ( buildRootPath ) ;
189189 if ( root != null ) {
190190 root . openFiles . delete ( filePath ) ;
191191 // clear diagnostics too if no open files open in said project
192192 if ( root . openFiles . size === 0 ) {
193193 compilerLogsWatcher . unwatch (
194- path . join ( projectRootPath , c . compilerLogPartialPath )
194+ path . join ( buildRootPath , c . compilerLogPartialPath )
195195 ) ;
196- deleteProjectDiagnostics ( projectRootPath ) ;
196+ deleteProjectDiagnostics ( buildRootPath ) ;
197197 if ( root . bsbWatcherByEditor !== null ) {
198198 root . bsbWatcherByEditor . kill ( ) ;
199199 root . bsbWatcherByEditor = null ;
0 commit comments