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