File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -653,17 +653,17 @@ async function compileContents(
653653
654654 const fileUri = utils . pathToURI ( entry . file . sourceFilePath ) ;
655655
656+ // Get compiler diagnostics from main build (if any) and combine with incremental diagnostics
657+ const compilerDiagnosticsForFile =
658+ getCurrentCompilerDiagnosticsForFile ( fileUri ) ;
659+ const allDiagnostics = [ ...res , ...compilerDiagnosticsForFile ] ;
660+
656661 // Update filesWithDiagnostics to track this file
657662 // entry.project.rootPath is guaranteed to match a key in projectsFiles
658663 // (see triggerIncrementalCompilationOfFile where the entry is created)
659664 const projectFile = projectsFiles . get ( entry . project . rootPath ) ;
660665
661666 if ( projectFile != null ) {
662- // Get compiler diagnostics from main build (if any)
663- const compilerDiagnosticsForFile =
664- getCurrentCompilerDiagnosticsForFile ( fileUri ) ;
665- const allDiagnostics = [ ...res , ...compilerDiagnosticsForFile ] ;
666-
667667 if ( allDiagnostics . length > 0 ) {
668668 projectFile . filesWithDiagnostics . add ( fileUri ) ;
669669 } else {
@@ -677,7 +677,7 @@ async function compileContents(
677677 method : "textDocument/publishDiagnostics" ,
678678 params : {
679679 uri : fileUri ,
680- diagnostics : res ,
680+ diagnostics : allDiagnostics ,
681681 } ,
682682 } ;
683683 send ( notification ) ;
Original file line number Diff line number Diff line change @@ -60,9 +60,6 @@ export const findFilePathFromProjectRoot = (
6060 }
6161
6262 const parentDir = normalizePath ( parentDirStr ) ;
63- if ( parentDir == null ) {
64- return null ;
65- }
6663
6764 return findFilePathFromProjectRoot ( parentDir , filePartialPath ) ;
6865} ;
@@ -153,9 +150,6 @@ export const getFilenameFromRootBsconfig = (
153150) : NormalizedPath | null => {
154151 // Start searching from the parent directory of projDir to find the workspace root
155152 const parentDir = normalizePath ( path . dirname ( projDir ) ) ;
156- if ( parentDir == null ) {
157- return null ;
158- }
159153
160154 let rootConfigPath = findFilePathFromProjectRoot (
161155 parentDir ,
You can’t perform that action at this time.
0 commit comments