File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -390,9 +390,24 @@ function triggerIncrementalCompilationOfFile(
390390 if ( debug ( ) ) console . log ( "Did not find open project for " + filePath ) ;
391391 return ;
392392 }
393- const workspaceRootPath = projectRootPath
394- ? utils . findProjectRootOfFile ( projectRootPath , true )
395- : null ;
393+
394+ const projectRewatchLockfile = path . resolve (
395+ projectRootPath ,
396+ c . rewatchLockPartialPath
397+ ) ;
398+
399+ let foundRewatchLockfileInProjectRoot = false ;
400+ try {
401+ fs . statSync ( projectRewatchLockfile ) ;
402+ foundRewatchLockfileInProjectRoot = true ;
403+ } catch { }
404+
405+ // if we find a rewatch.lock in the project root, it's a compilation of a local package
406+ // in the workspace.
407+ const workspaceRootPath =
408+ projectRootPath && ! foundRewatchLockfileInProjectRoot
409+ ? utils . findProjectRootOfFile ( projectRootPath , true )
410+ : null ;
396411
397412 const bscBinaryLocation = project . bscBinaryLocation ;
398413 if ( bscBinaryLocation == null ) {
You can’t perform that action at this time.
0 commit comments