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