File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -376,8 +376,9 @@ function triggerIncrementalCompilationOfFile(
376
376
return ;
377
377
}
378
378
const workspaceRootPath = projectRootPath
379
- ? utils . findProjectRootOfFileInDir ( projectRootPath )
379
+ ? utils . findProjectRootOfFile ( projectRootPath , true )
380
380
: null ;
381
+ console . log ( "Workspace root path: " + workspaceRootPath ) ;
381
382
382
383
const bscBinaryLocation = project . bscBinaryLocation ;
383
384
if ( bscBinaryLocation == null ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export let createFileInTempDir = (extension = "") => {
25
25
return path . join ( os . tmpdir ( ) , tempFileName ) ;
26
26
} ;
27
27
28
- export let findProjectRootOfFileInDir = (
28
+ let findProjectRootOfFileInDir = (
29
29
source : p . DocumentUri
30
30
) : null | p . DocumentUri => {
31
31
let dir = path . dirname ( source ) ;
@@ -47,13 +47,14 @@ export let findProjectRootOfFileInDir = (
47
47
// TODO: races here?
48
48
// TODO: this doesn't handle file:/// scheme
49
49
export let findProjectRootOfFile = (
50
- source : p . DocumentUri
50
+ source : p . DocumentUri ,
51
+ skipParent ?: boolean
51
52
) : null | p . DocumentUri => {
52
53
// First look in project files
53
54
let foundRootFromProjectFiles : string | null = null ;
54
55
55
56
for ( const rootPath of projectsFiles . keys ( ) ) {
56
- if ( source . startsWith ( rootPath ) ) {
57
+ if ( source . startsWith ( rootPath ) && ( ! skipParent || source !== rootPath ) ) {
57
58
// Prefer the longest path (most nested)
58
59
if (
59
60
foundRootFromProjectFiles == null ||
You can’t perform that action at this time.
0 commit comments