Skip to content

Commit 80ab111

Browse files
authored
If the project is orphan dont queue up TI reqquest (#56355)
1 parent efecc85 commit 80ab111

12 files changed

+85
-1624
lines changed

src/server/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
13531353

13541354
// update builder only if language service is enabled
13551355
// otherwise tell it to drop its internal state
1356-
if (this.languageServiceEnabled && this.projectService.serverMode === LanguageServiceMode.Semantic) {
1356+
if (this.languageServiceEnabled && this.projectService.serverMode === LanguageServiceMode.Semantic && !this.isOrphan()) {
13571357
// 1. no changes in structure, no changes in unresolved imports - do nothing
13581358
// 2. no changes in structure, unresolved imports were changed - collect unresolved imports for all files
13591359
// (can reuse cached imports for files that were not changed)

tests/baselines/reference/tsserver/configFileSearch/tsconfig-for-the-file-does-not-exist.js

Lines changed: 9 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -261,146 +261,6 @@ Info seq [hh:mm:ss:mss] Files (0)
261261
262262
263263
Info seq [hh:mm:ss:mss] -----------------------------------------------
264-
TI:: Creating typing installer
265-
266-
PolledWatches::
267-
/a/b/projects/node_modules/@types:
268-
{"pollingInterval":500}
269-
/a/b/projects/project/node_modules/@types:
270-
{"pollingInterval":500}
271-
/a/b/projects/project/src/node_modules/@types:
272-
{"pollingInterval":500}
273-
274-
PolledWatches *deleted*::
275-
/a/b/projects/project/jsconfig.json:
276-
{"pollingInterval":2000}
277-
/a/b/projects/project/src/jsconfig.json:
278-
{"pollingInterval":2000}
279-
/a/b/projects/project/src/tsconfig.json:
280-
{"pollingInterval":2000}
281-
282-
FsWatches::
283-
/a/b/projects/project/tsconfig.json:
284-
{}
285-
/a/lib/lib.d.ts:
286-
{}
287-
288-
FsWatchesRecursive::
289-
/a/b/projects/project: *new*
290-
{}
291-
292-
TI:: [hh:mm:ss:mss] Global cache location '/a/data', safe file path '/safeList.json', types map path /typesMap.json
293-
TI:: [hh:mm:ss:mss] Processing cache location '/a/data'
294-
TI:: [hh:mm:ss:mss] Trying to find '/a/data/package.json'...
295-
TI:: [hh:mm:ss:mss] Finished processing cache location '/a/data'
296-
TI:: [hh:mm:ss:mss] Npm config file: /a/data/package.json
297-
TI:: [hh:mm:ss:mss] Npm config file: '/a/data/package.json' is missing, creating new one...
298-
TI:: [hh:mm:ss:mss] Updating types-registry npm package...
299-
TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest
300-
TI:: [hh:mm:ss:mss] Updated types-registry npm package
301-
TI:: typing installer creation complete
302-
//// [/a/data/package.json]
303-
{ "private": true }
304-
305-
//// [/a/data/node_modules/types-registry/index.json]
306-
{
307-
"entries": {}
308-
}
309-
310-
311-
TI:: [hh:mm:ss:mss] Got install request
312-
{
313-
"projectName": "/dev/null/inferredProject1*",
314-
"fileNames": [],
315-
"compilerOptions": {
316-
"target": 1,
317-
"jsx": 1,
318-
"allowNonTsExtensions": true,
319-
"allowJs": true,
320-
"noEmitForJsFiles": true
321-
},
322-
"typeAcquisition": {
323-
"enable": true,
324-
"include": [],
325-
"exclude": []
326-
},
327-
"unresolvedImports": [],
328-
"projectRootPath": "/a/b/projects/project/src",
329-
"cachePath": "/a/data",
330-
"kind": "discover"
331-
}
332-
TI:: [hh:mm:ss:mss] Request specifies cache path '/a/data', loading cached information...
333-
TI:: [hh:mm:ss:mss] Processing cache location '/a/data'
334-
TI:: [hh:mm:ss:mss] Cache location was already processed...
335-
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
336-
TI:: [hh:mm:ss:mss] Explicitly included types: []
337-
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
338-
TI:: [hh:mm:ss:mss] Finished typings discovery:
339-
{
340-
"cachedTypingPaths": [],
341-
"newTypingNames": [],
342-
"filesToWatch": [
343-
"/a/b/projects/project/src/bower_components",
344-
"/a/b/projects/project/src/node_modules"
345-
]
346-
}
347-
TI:: [hh:mm:ss:mss] Sending response:
348-
{
349-
"kind": "action::watchTypingLocations",
350-
"projectName": "/dev/null/inferredProject1*",
351-
"files": [
352-
"/a/b/projects/project/src/bower_components",
353-
"/a/b/projects/project/src/node_modules"
354-
]
355-
}
356-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/bower_components 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
357-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/bower_components 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
358-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
359-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
360-
TI:: [hh:mm:ss:mss] Sending response:
361-
{
362-
"projectName": "/dev/null/inferredProject1*",
363-
"typeAcquisition": {
364-
"enable": true,
365-
"include": [],
366-
"exclude": []
367-
},
368-
"compilerOptions": {
369-
"target": 1,
370-
"jsx": 1,
371-
"allowNonTsExtensions": true,
372-
"allowJs": true,
373-
"noEmitForJsFiles": true
374-
},
375-
"typings": [],
376-
"unresolvedImports": [],
377-
"kind": "action::set"
378-
}
379-
Info seq [hh:mm:ss:mss] event:
380-
{
381-
"seq": 0,
382-
"type": "event",
383-
"event": "setTypings",
384-
"body": {
385-
"projectName": "/dev/null/inferredProject1*",
386-
"typeAcquisition": {
387-
"enable": true,
388-
"include": [],
389-
"exclude": []
390-
},
391-
"compilerOptions": {
392-
"target": 1,
393-
"jsx": 1,
394-
"allowNonTsExtensions": true,
395-
"allowJs": true,
396-
"noEmitForJsFiles": true
397-
},
398-
"typings": [],
399-
"unresolvedImports": [],
400-
"kind": "action::set"
401-
}
402-
}
403-
TI:: [hh:mm:ss:mss] No new typings were requested as a result of typings discovery
404264
Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles:
405265
Info seq [hh:mm:ss:mss] Project '/a/b/projects/project/tsconfig.json' (Configured)
406266
Info seq [hh:mm:ss:mss] Files (2)
@@ -432,21 +292,25 @@ PolledWatches::
432292
{"pollingInterval":500}
433293
/a/b/projects/project/node_modules/@types:
434294
{"pollingInterval":500}
435-
/a/b/projects/project/src/bower_components: *new*
436-
{"pollingInterval":500}
437-
/a/b/projects/project/src/node_modules: *new*
438-
{"pollingInterval":500}
439295
/a/b/projects/project/src/node_modules/@types:
440296
{"pollingInterval":500}
441297
298+
PolledWatches *deleted*::
299+
/a/b/projects/project/jsconfig.json:
300+
{"pollingInterval":2000}
301+
/a/b/projects/project/src/jsconfig.json:
302+
{"pollingInterval":2000}
303+
/a/b/projects/project/src/tsconfig.json:
304+
{"pollingInterval":2000}
305+
442306
FsWatches::
443307
/a/b/projects/project/tsconfig.json:
444308
{}
445309
/a/lib/lib.d.ts:
446310
{}
447311
448312
FsWatchesRecursive::
449-
/a/b/projects/project:
313+
/a/b/projects/project: *new*
450314
{}
451315
452316
Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /a/b/projects/project/tsconfig.json 2:: WatchInfo: /a/b/projects/project/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
@@ -466,8 +330,6 @@ Info seq [hh:mm:ss:mss] -----------------------------------------------
466330
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /a/b/projects/project 1 undefined Config: /a/b/projects/project/tsconfig.json WatchType: Wild card directory
467331
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/projects/project 1 undefined Config: /a/b/projects/project/tsconfig.json WatchType: Wild card directory
468332
Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /a/b/projects/project/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
469-
TI:: [hh:mm:ss:mss] Closing file watchers for project '/a/b/projects/project/tsconfig.json'
470-
TI:: [hh:mm:ss:mss] No watchers are registered for project '/a/b/projects/project/tsconfig.json'
471333
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /a/b/projects/project/node_modules/@types 1 undefined Project: /a/b/projects/project/tsconfig.json WatchType: Type roots
472334
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /a/b/projects/project/node_modules/@types 1 undefined Project: /a/b/projects/project/tsconfig.json WatchType: Type roots
473335
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /a/b/projects/node_modules/@types 1 undefined Project: /a/b/projects/project/tsconfig.json WatchType: Type roots
@@ -485,10 +347,6 @@ PolledWatches::
485347
{"pollingInterval":500}
486348
/a/b/projects/project/node_modules/@types:
487349
{"pollingInterval":500}
488-
/a/b/projects/project/src/bower_components:
489-
{"pollingInterval":500}
490-
/a/b/projects/project/src/node_modules:
491-
{"pollingInterval":500}
492350
/a/b/projects/project/src/node_modules/@types:
493351
{"pollingInterval":500}
494352

@@ -564,12 +422,8 @@ PolledWatches::
564422
{"pollingInterval":2000}
565423
/a/b/projects/project/node_modules/@types:
566424
{"pollingInterval":500}
567-
/a/b/projects/project/src/bower_components:
568-
{"pollingInterval":500}
569425
/a/b/projects/project/src/jsconfig.json: *new*
570426
{"pollingInterval":2000}
571-
/a/b/projects/project/src/node_modules:
572-
{"pollingInterval":500}
573427
/a/b/projects/project/src/node_modules/@types:
574428
{"pollingInterval":500}
575429
/a/b/projects/project/src/tsconfig.json: *new*

tests/baselines/reference/tsserver/configFileSearch/tsconfig-for-the-file-exists.js

Lines changed: 9 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -418,146 +418,6 @@ Info seq [hh:mm:ss:mss] Files (0)
418418

419419

420420
Info seq [hh:mm:ss:mss] -----------------------------------------------
421-
TI:: Creating typing installer
422-
423-
PolledWatches::
424-
/a/b/projects/node_modules/@types:
425-
{"pollingInterval":500}
426-
/a/b/projects/project/node_modules/@types:
427-
{"pollingInterval":500}
428-
/a/b/projects/project/src/node_modules/@types:
429-
{"pollingInterval":500}
430-
431-
PolledWatches *deleted*::
432-
/a/b/projects/project/jsconfig.json:
433-
{"pollingInterval":2000}
434-
/a/b/projects/project/src/jsconfig.json:
435-
{"pollingInterval":2000}
436-
/a/b/projects/project/src/tsconfig.json:
437-
{"pollingInterval":2000}
438-
439-
FsWatches::
440-
/a/b/projects/project/tsconfig.json:
441-
{}
442-
/a/lib/lib.d.ts:
443-
{}
444-
445-
FsWatchesRecursive::
446-
/a/b/projects/project: *new*
447-
{}
448-
449-
TI:: [hh:mm:ss:mss] Global cache location '/a/data', safe file path '/safeList.json', types map path /typesMap.json
450-
TI:: [hh:mm:ss:mss] Processing cache location '/a/data'
451-
TI:: [hh:mm:ss:mss] Trying to find '/a/data/package.json'...
452-
TI:: [hh:mm:ss:mss] Finished processing cache location '/a/data'
453-
TI:: [hh:mm:ss:mss] Npm config file: /a/data/package.json
454-
TI:: [hh:mm:ss:mss] Npm config file: '/a/data/package.json' is missing, creating new one...
455-
TI:: [hh:mm:ss:mss] Updating types-registry npm package...
456-
TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest
457-
TI:: [hh:mm:ss:mss] Updated types-registry npm package
458-
TI:: typing installer creation complete
459-
//// [/a/data/package.json]
460-
{ "private": true }
461-
462-
//// [/a/data/node_modules/types-registry/index.json]
463-
{
464-
"entries": {}
465-
}
466-
467-
468-
TI:: [hh:mm:ss:mss] Got install request
469-
{
470-
"projectName": "/dev/null/inferredProject1*",
471-
"fileNames": [],
472-
"compilerOptions": {
473-
"target": 1,
474-
"jsx": 1,
475-
"allowNonTsExtensions": true,
476-
"allowJs": true,
477-
"noEmitForJsFiles": true
478-
},
479-
"typeAcquisition": {
480-
"enable": true,
481-
"include": [],
482-
"exclude": []
483-
},
484-
"unresolvedImports": [],
485-
"projectRootPath": "/a/b/projects/project/src",
486-
"cachePath": "/a/data",
487-
"kind": "discover"
488-
}
489-
TI:: [hh:mm:ss:mss] Request specifies cache path '/a/data', loading cached information...
490-
TI:: [hh:mm:ss:mss] Processing cache location '/a/data'
491-
TI:: [hh:mm:ss:mss] Cache location was already processed...
492-
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
493-
TI:: [hh:mm:ss:mss] Explicitly included types: []
494-
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
495-
TI:: [hh:mm:ss:mss] Finished typings discovery:
496-
{
497-
"cachedTypingPaths": [],
498-
"newTypingNames": [],
499-
"filesToWatch": [
500-
"/a/b/projects/project/src/bower_components",
501-
"/a/b/projects/project/src/node_modules"
502-
]
503-
}
504-
TI:: [hh:mm:ss:mss] Sending response:
505-
{
506-
"kind": "action::watchTypingLocations",
507-
"projectName": "/dev/null/inferredProject1*",
508-
"files": [
509-
"/a/b/projects/project/src/bower_components",
510-
"/a/b/projects/project/src/node_modules"
511-
]
512-
}
513-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/bower_components 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
514-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/bower_components 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
515-
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
516-
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /a/b/projects/project/src/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
517-
TI:: [hh:mm:ss:mss] Sending response:
518-
{
519-
"projectName": "/dev/null/inferredProject1*",
520-
"typeAcquisition": {
521-
"enable": true,
522-
"include": [],
523-
"exclude": []
524-
},
525-
"compilerOptions": {
526-
"target": 1,
527-
"jsx": 1,
528-
"allowNonTsExtensions": true,
529-
"allowJs": true,
530-
"noEmitForJsFiles": true
531-
},
532-
"typings": [],
533-
"unresolvedImports": [],
534-
"kind": "action::set"
535-
}
536-
Info seq [hh:mm:ss:mss] event:
537-
{
538-
"seq": 0,
539-
"type": "event",
540-
"event": "setTypings",
541-
"body": {
542-
"projectName": "/dev/null/inferredProject1*",
543-
"typeAcquisition": {
544-
"enable": true,
545-
"include": [],
546-
"exclude": []
547-
},
548-
"compilerOptions": {
549-
"target": 1,
550-
"jsx": 1,
551-
"allowNonTsExtensions": true,
552-
"allowJs": true,
553-
"noEmitForJsFiles": true
554-
},
555-
"typings": [],
556-
"unresolvedImports": [],
557-
"kind": "action::set"
558-
}
559-
}
560-
TI:: [hh:mm:ss:mss] No new typings were requested as a result of typings discovery
561421
Info seq [hh:mm:ss:mss] After ensureProjectForOpenFiles:
562422
Info seq [hh:mm:ss:mss] Project '/a/b/projects/project/tsconfig.json' (Configured)
563423
Info seq [hh:mm:ss:mss] Files (2)
@@ -589,19 +449,23 @@ PolledWatches::
589449
{"pollingInterval":500}
590450
/a/b/projects/project/node_modules/@types:
591451
{"pollingInterval":500}
592-
/a/b/projects/project/src/bower_components: *new*
593-
{"pollingInterval":500}
594-
/a/b/projects/project/src/node_modules: *new*
595-
{"pollingInterval":500}
596452
/a/b/projects/project/src/node_modules/@types:
597453
{"pollingInterval":500}
598454

455+
PolledWatches *deleted*::
456+
/a/b/projects/project/jsconfig.json:
457+
{"pollingInterval":2000}
458+
/a/b/projects/project/src/jsconfig.json:
459+
{"pollingInterval":2000}
460+
/a/b/projects/project/src/tsconfig.json:
461+
{"pollingInterval":2000}
462+
599463
FsWatches::
600464
/a/b/projects/project/tsconfig.json:
601465
{}
602466
/a/lib/lib.d.ts:
603467
{}
604468

605469
FsWatchesRecursive::
606-
/a/b/projects/project:
470+
/a/b/projects/project: *new*
607471
{}

0 commit comments

Comments
 (0)