@@ -126,33 +126,33 @@ let openedFile = (fileUri: string, fileContent: string) => {
126
126
127
127
stupidFileContentCache . set ( filePath , fileContent ) ;
128
128
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 , {
133
133
openFiles : new Set ( ) ,
134
134
filesWithDiagnostics : new Set ( ) ,
135
135
bsbWatcherByEditor : null ,
136
136
} ) ;
137
137
compilerLogsWatcher . add (
138
- path . join ( projectRootPath , c . compilerLogPartialPath )
138
+ path . join ( buildRootPath , c . compilerLogPartialPath )
139
139
) ;
140
140
}
141
- let root = projectsFiles . get ( projectRootPath ) ! ;
141
+ let root = projectsFiles . get ( buildRootPath ) ! ;
142
142
root . openFiles . add ( filePath ) ;
143
143
let firstOpenFileOfProject = root . openFiles . size === 1 ;
144
144
// check if .bsb.lock is still there. If not, start a bsb -w ourselves
145
145
// 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 ) ;
147
147
if ( firstOpenFileOfProject && ! fs . existsSync ( bsbLockPath ) ) {
148
- let bsbPath = path . join ( projectRootPath , c . bsbPartialPath ) ;
148
+ let bsbPath = path . join ( buildRootPath , c . bsbPartialPath ) ;
149
149
// TODO: sometime stale .bsb.lock dangling. bsb -w knows .bsb.lock is
150
150
// stale. Use that logic
151
151
// TODO: close watcher when lang-server shuts down
152
152
if ( fs . existsSync ( bsbPath ) ) {
153
153
let payload : clientSentBuildAction = {
154
154
title : c . startBuildAction ,
155
- projectRootPath : projectRootPath ,
155
+ projectRootPath : buildRootPath ,
156
156
} ;
157
157
let params = {
158
158
type : p . MessageType . Info ,
@@ -183,17 +183,17 @@ let closedFile = (fileUri: string) => {
183
183
184
184
stupidFileContentCache . delete ( filePath ) ;
185
185
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 ) ;
189
189
if ( root != null ) {
190
190
root . openFiles . delete ( filePath ) ;
191
191
// clear diagnostics too if no open files open in said project
192
192
if ( root . openFiles . size === 0 ) {
193
193
compilerLogsWatcher . unwatch (
194
- path . join ( projectRootPath , c . compilerLogPartialPath )
194
+ path . join ( buildRootPath , c . compilerLogPartialPath )
195
195
) ;
196
- deleteProjectDiagnostics ( projectRootPath ) ;
196
+ deleteProjectDiagnostics ( buildRootPath ) ;
197
197
if ( root . bsbWatcherByEditor !== null ) {
198
198
root . bsbWatcherByEditor . kill ( ) ;
199
199
root . bsbWatcherByEditor = null ;
0 commit comments