File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
packages/language-server/src Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export interface LanguageServiceContainer {
4343 * Careful, don't call often, or it will hurt performance.
4444 * Only works for TS versions that have ScriptKind.Deferred
4545 */
46- fileBelongsToProject ( filePath : string ) : boolean ;
46+ fileBelongsToProject ( filePath : string , isNew : boolean ) : boolean ;
4747
4848 dispose ( ) : void ;
4949}
@@ -368,9 +368,9 @@ async function createLanguageService(
368368 return snapshotManager . has ( filePath ) ;
369369 }
370370
371- function fileBelongsToProject ( filePath : string ) : boolean {
371+ function fileBelongsToProject ( filePath : string , isNew : boolean ) : boolean {
372372 filePath = normalizePath ( filePath ) ;
373- return hasFile ( filePath ) || getParsedConfig ( ) . fileNames . includes ( filePath ) ;
373+ return hasFile ( filePath ) || ( isNew && getParsedConfig ( ) . fileNames . includes ( filePath ) ) ;
374374 }
375375
376376 function updateTsOrJsFile ( fileName : string , changes ?: TextDocumentContentChangeEvent [ ] ) : void {
Original file line number Diff line number Diff line change @@ -109,9 +109,9 @@ export class SvelteCheck {
109109 async upsertDocument ( doc : { text : string ; uri : string } , isNew : boolean ) : Promise < void > {
110110 const filePath = urlToPath ( doc . uri ) || '' ;
111111
112- if ( isNew && this . options . tsconfig ) {
112+ if ( this . options . tsconfig ) {
113113 const lsContainer = await this . getLSContainer ( this . options . tsconfig ) ;
114- if ( ! lsContainer . fileBelongsToProject ( filePath ) ) {
114+ if ( ! lsContainer . fileBelongsToProject ( filePath , isNew ) ) {
115115 return ;
116116 }
117117 }
You can’t perform that action at this time.
0 commit comments