Delay the calculation of common source root if it would be needed when calculation dts files (#59070)

This commit is contained in:
Sheetal Nandi 2024-06-28 14:29:11 -07:00 коммит произвёл GitHub
Родитель 22bbe867fd
Коммит 6c68fdd4b5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
8 изменённых файлов: 703 добавлений и 31 удалений

Просмотреть файл

@ -4418,7 +4418,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
options.outDir || // there is --outDir specified
options.rootDir || // there is --rootDir specified
options.sourceRoot || // there is --sourceRoot specified
options.mapRoot // there is --mapRoot specified
options.mapRoot || // there is --mapRoot specified
(getEmitDeclarations(options) && options.declarationDir) // there is --declarationDir specified
) {
// Precalculate and cache the common source directory
const dir = getCommonSourceDirectory();

Просмотреть файл

@ -6315,15 +6315,15 @@ export function getOwnEmitOutputFilePath(fileName: string, host: EmitHost, exten
/** @internal */
export function getDeclarationEmitOutputFilePath(fileName: string, host: EmitHost) {
return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), f => host.getCanonicalFileName(f));
return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host);
}
/** @internal */
export function getDeclarationEmitOutputFilePathWorker(fileName: string, options: CompilerOptions, currentDirectory: string, commonSourceDirectory: string, getCanonicalFileName: GetCanonicalFileName): string {
export function getDeclarationEmitOutputFilePathWorker(fileName: string, options: CompilerOptions, host: Pick<EmitHost, "getCommonSourceDirectory" | "getCurrentDirectory" | "getCanonicalFileName">): string {
const outputDir = options.declarationDir || options.outDir; // Prefer declaration folder if specified
const path = outputDir
? getSourceFilePathInNewDirWorker(fileName, outputDir, currentDirectory, commonSourceDirectory, getCanonicalFileName)
? getSourceFilePathInNewDirWorker(fileName, outputDir, host.getCurrentDirectory(), host.getCommonSourceDirectory(), f => host.getCanonicalFileName(f))
: fileName;
const declarationExtension = getDeclarationEmitExtensionForPath(path);
return removeFileExtension(path) + declarationExtension;

Просмотреть файл

@ -1699,7 +1699,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
!sourceFile ||
sourceFile.resolvedPath !== source ||
!this.isValidGeneratedFileWatcher(
getDeclarationEmitOutputFilePathWorker(sourceFile.fileName, this.compilerOptions, this.currentDirectory, this.program!.getCommonSourceDirectory(), this.getCanonicalFileName),
getDeclarationEmitOutputFilePathWorker(sourceFile.fileName, this.compilerOptions, this.program!),
watcher,
)
) {

Просмотреть файл

@ -117,7 +117,7 @@ export function getSourceMapper(host: SourceMapperHost): SourceMapper {
const declarationPath = outPath ?
removeFileExtension(outPath) + Extension.Dts :
getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName);
getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), program);
if (declarationPath === undefined) return undefined;
const newLoc = getDocumentPositionMapper(declarationPath, info.fileName).getGeneratedPosition(info);

Просмотреть файл

@ -1,5 +1,6 @@
import * as ts from "../../_namespaces/ts.js";
import { jsonToReadableText } from "../helpers.js";
import { libContent } from "../helpers/contents.js";
import {
baselineTsserverLogs,
closeFilesForSession,
@ -833,3 +834,29 @@ describe("unittests:: tsserver:: projectErrors:: with file rename on wsl2::", ()
baselineTsserverLogs("projectErrors", "file rename on wsl2", session);
});
});
describe("unittests:: tsserver:: projectErrors:: dts errors when files dont belong to common root", () => {
[undefined, "decls"].forEach(declarationDir => {
it(`dts errors when files dont belong to common root${declarationDir ? " with declarationDir" : ""}`, () => {
const host = createServerHost({
"/home/src/projects/project/src/file.ts": `import { a } from "../a";`,
"/home/src/projects/project/a.ts": `export const a = 10;`,
"/home/src/projects/project/src/tsconfig.json": jsonToReadableText({
compilerOptions: {
composite: true,
noEmit: true,
declarationDir,
},
}),
[libFile.path]: libContent,
});
const session = new TestSession(host);
openFilesForSession(["/home/src/projects/project/src/file.ts"], session);
verifyGetErrRequest({
session,
files: ["/home/src/projects/project/src/file.ts"],
});
baselineTsserverLogs("projectErrors", `dts errors when files dont belong to common root${declarationDir ? " with declarationDir" : ""}`, session);
});
});
});

Просмотреть файл

@ -0,0 +1,342 @@
currentDirectory:: / useCaseSensitiveFileNames: false
Info seq [hh:mm:ss:mss] Provided types map file "/typesMap.json" doesn't exist
Before request
//// [/home/src/projects/project/src/file.ts]
import { a } from "../a";
//// [/home/src/projects/project/a.ts]
export const a = 10;
//// [/home/src/projects/project/src/tsconfig.json]
{
"compilerOptions": {
"composite": true,
"noEmit": true,
"declarationDir": "decls"
}
}
//// [/a/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
declare const console: { log(msg: any): void; };
Info seq [hh:mm:ss:mss] request:
{
"command": "open",
"arguments": {
"file": "/home/src/projects/project/src/file.ts"
},
"seq": 1,
"type": "request"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/projects/project/src/file.ts ProjectRootPath: undefined:: Result: /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] Creating configuration project /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/project/src/tsconfig.json 2000 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/projects/project/src/tsconfig.json",
"reason": "Creating possible configured project for /home/src/projects/project/src/file.ts to open"
}
}
Info seq [hh:mm:ss:mss] Config: /home/src/projects/project/src/tsconfig.json : {
"rootNames": [
"/home/src/projects/project/src/file.ts"
],
"options": {
"composite": true,
"noEmit": true,
"declarationDir": "/home/src/projects/project/src/decls",
"configFilePath": "/home/src/projects/project/src/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src 1 undefined Config: /home/src/projects/project/src/tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src 1 undefined Config: /home/src/projects/project/src/tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/project/a.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/src/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/src/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
/a/lib/lib.d.ts Text-1 "/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
/home/src/projects/project/a.ts Text-1 "export const a = 10;"
/home/src/projects/project/src/file.ts SVC-1-0 "import { a } from \"../a\";"
../../../../../a/lib/lib.d.ts
Default library for target 'es5'
../a.ts
Imported via "../a" from file 'file.ts'
file.ts
Matched by default include pattern '**/*'
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/home/src/projects/project/src/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "telemetry",
"body": {
"telemetryEventName": "projectInfo",
"payload": {
"projectId": "33e5039724fdc4e442f7c0bd4742657476d029f410f9e48ec2da0feff3f20575",
"fileStats": {
"js": 0,
"jsSize": 0,
"jsx": 0,
"jsxSize": 0,
"ts": 2,
"tsSize": 45,
"tsx": 0,
"tsxSize": 0,
"dts": 1,
"dtsSize": 413,
"deferred": 0,
"deferredSize": 0
},
"compilerOptions": {
"composite": true,
"noEmit": true,
"declarationDir": ""
},
"typeAcquisition": {
"enable": false,
"include": false,
"exclude": false
},
"extends": false,
"files": false,
"include": false,
"exclude": false,
"compileOnSave": false,
"configFileName": "tsconfig.json",
"projectType": "configured",
"languageServiceEnabled": true,
"version": "FakeVersion"
}
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/projects/project/src/file.ts",
"configFile": "/home/src/projects/project/src/tsconfig.json",
"diagnostics": []
}
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/projects/project/src/tsconfig.json ProjectRootPath: undefined:: Result: undefined
Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/src/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /home/src/projects/project/src/file.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 1,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
}
}
After request
PolledWatches::
/home/src/projects/node_modules/@types: *new*
{"pollingInterval":500}
/home/src/projects/project/node_modules/@types: *new*
{"pollingInterval":500}
/home/src/projects/project/src/node_modules/@types: *new*
{"pollingInterval":500}
FsWatches::
/a/lib/lib.d.ts: *new*
{}
/home/src/projects/project/a.ts: *new*
{}
/home/src/projects/project/src/tsconfig.json: *new*
{}
FsWatchesRecursive::
/home/src/projects/project/src: *new*
{}
Projects::
/home/src/projects/project/src/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
ScriptInfos::
/a/lib/lib.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/projects/project/src/tsconfig.json
/home/src/projects/project/a.ts *new*
version: Text-1
containingProjects: 1
/home/src/projects/project/src/tsconfig.json
/home/src/projects/project/src/file.ts (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/projects/project/src/tsconfig.json *default*
Before request
Info seq [hh:mm:ss:mss] request:
{
"command": "geterr",
"arguments": {
"delay": 0,
"files": [
"/home/src/projects/project/src/file.ts"
]
},
"seq": 2,
"type": "request"
}
After request
Timeout callback:: count: 1
1: checkOne *new*
Before running Timeout callback:: count: 1
1: checkOne
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "syntaxDiag",
"body": {
"file": "/home/src/projects/project/src/file.ts",
"diagnostics": [],
"duration": *
}
}
After running Timeout callback:: count: 0
Immedidate callback:: count: 1
1: semanticCheck *new*
Before running Immedidate callback:: count: 1
1: semanticCheck
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "semanticDiag",
"body": {
"file": "/home/src/projects/project/src/file.ts",
"diagnostics": [
{
"start": {
"line": 1,
"offset": 19
},
"end": {
"line": 1,
"offset": 25
},
"text": "File '/home/src/projects/project/a.ts' is not under 'rootDir' '/home/src/projects/project/src'. 'rootDir' is expected to contain all source files.",
"code": 6059,
"category": "error"
},
{
"start": {
"line": 1,
"offset": 19
},
"end": {
"line": 1,
"offset": 25
},
"text": "File '/home/src/projects/project/a.ts' is not listed within the file list of project '/home/src/projects/project/src/tsconfig.json'. Projects must list all files or use an 'include' pattern.",
"code": 6307,
"category": "error"
}
],
"duration": *
}
}
After running Immedidate callback:: count: 1
Immedidate callback:: count: 1
2: suggestionCheck *new*
Before running Immedidate callback:: count: 1
2: suggestionCheck
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "suggestionDiag",
"body": {
"file": "/home/src/projects/project/src/file.ts",
"diagnostics": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 26
},
"text": "'a' is declared but its value is never read.",
"code": 6133,
"category": "suggestion",
"reportsUnnecessary": true
}
],
"duration": *
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "requestCompleted",
"body": {
"request_seq": 2
}
}
After running Immedidate callback:: count: 0

Просмотреть файл

@ -0,0 +1,326 @@
currentDirectory:: / useCaseSensitiveFileNames: false
Info seq [hh:mm:ss:mss] Provided types map file "/typesMap.json" doesn't exist
Before request
//// [/home/src/projects/project/src/file.ts]
import { a } from "../a";
//// [/home/src/projects/project/a.ts]
export const a = 10;
//// [/home/src/projects/project/src/tsconfig.json]
{
"compilerOptions": {
"composite": true,
"noEmit": true
}
}
//// [/a/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
declare const console: { log(msg: any): void; };
Info seq [hh:mm:ss:mss] request:
{
"command": "open",
"arguments": {
"file": "/home/src/projects/project/src/file.ts"
},
"seq": 1,
"type": "request"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/projects/project/src/file.ts ProjectRootPath: undefined:: Result: /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] Creating configuration project /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/project/src/tsconfig.json 2000 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/projects/project/src/tsconfig.json",
"reason": "Creating possible configured project for /home/src/projects/project/src/file.ts to open"
}
}
Info seq [hh:mm:ss:mss] Config: /home/src/projects/project/src/tsconfig.json : {
"rootNames": [
"/home/src/projects/project/src/file.ts"
],
"options": {
"composite": true,
"noEmit": true,
"configFilePath": "/home/src/projects/project/src/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src 1 undefined Config: /home/src/projects/project/src/tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src 1 undefined Config: /home/src/projects/project/src/tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/project/a.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/src/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules/@types 1 undefined Project: /home/src/projects/project/src/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/src/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/src/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
/a/lib/lib.d.ts Text-1 "/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
/home/src/projects/project/a.ts Text-1 "export const a = 10;"
/home/src/projects/project/src/file.ts SVC-1-0 "import { a } from \"../a\";"
../../../../../a/lib/lib.d.ts
Default library for target 'es5'
../a.ts
Imported via "../a" from file 'file.ts'
file.ts
Matched by default include pattern '**/*'
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/home/src/projects/project/src/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "telemetry",
"body": {
"telemetryEventName": "projectInfo",
"payload": {
"projectId": "33e5039724fdc4e442f7c0bd4742657476d029f410f9e48ec2da0feff3f20575",
"fileStats": {
"js": 0,
"jsSize": 0,
"jsx": 0,
"jsxSize": 0,
"ts": 2,
"tsSize": 45,
"tsx": 0,
"tsxSize": 0,
"dts": 1,
"dtsSize": 413,
"deferred": 0,
"deferredSize": 0
},
"compilerOptions": {
"composite": true,
"noEmit": true
},
"typeAcquisition": {
"enable": false,
"include": false,
"exclude": false
},
"extends": false,
"files": false,
"include": false,
"exclude": false,
"compileOnSave": false,
"configFileName": "tsconfig.json",
"projectType": "configured",
"languageServiceEnabled": true,
"version": "FakeVersion"
}
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/projects/project/src/file.ts",
"configFile": "/home/src/projects/project/src/tsconfig.json",
"diagnostics": []
}
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/projects/project/src/tsconfig.json ProjectRootPath: undefined:: Result: undefined
Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/src/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /home/src/projects/project/src/file.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/projects/project/src/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 1,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
}
}
After request
PolledWatches::
/home/src/projects/node_modules/@types: *new*
{"pollingInterval":500}
/home/src/projects/project/node_modules/@types: *new*
{"pollingInterval":500}
/home/src/projects/project/src/node_modules/@types: *new*
{"pollingInterval":500}
FsWatches::
/a/lib/lib.d.ts: *new*
{}
/home/src/projects/project/a.ts: *new*
{}
/home/src/projects/project/src/tsconfig.json: *new*
{}
FsWatchesRecursive::
/home/src/projects/project/src: *new*
{}
Projects::
/home/src/projects/project/src/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
ScriptInfos::
/a/lib/lib.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/projects/project/src/tsconfig.json
/home/src/projects/project/a.ts *new*
version: Text-1
containingProjects: 1
/home/src/projects/project/src/tsconfig.json
/home/src/projects/project/src/file.ts (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/projects/project/src/tsconfig.json *default*
Before request
Info seq [hh:mm:ss:mss] request:
{
"command": "geterr",
"arguments": {
"delay": 0,
"files": [
"/home/src/projects/project/src/file.ts"
]
},
"seq": 2,
"type": "request"
}
After request
Timeout callback:: count: 1
1: checkOne *new*
Before running Timeout callback:: count: 1
1: checkOne
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "syntaxDiag",
"body": {
"file": "/home/src/projects/project/src/file.ts",
"diagnostics": [],
"duration": *
}
}
After running Timeout callback:: count: 0
Immedidate callback:: count: 1
1: semanticCheck *new*
Before running Immedidate callback:: count: 1
1: semanticCheck
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "semanticDiag",
"body": {
"file": "/home/src/projects/project/src/file.ts",
"diagnostics": [
{
"start": {
"line": 1,
"offset": 19
},
"end": {
"line": 1,
"offset": 25
},
"text": "File '/home/src/projects/project/a.ts' is not listed within the file list of project '/home/src/projects/project/src/tsconfig.json'. Projects must list all files or use an 'include' pattern.",
"code": 6307,
"category": "error"
}
],
"duration": *
}
}
After running Immedidate callback:: count: 1
Immedidate callback:: count: 1
2: suggestionCheck *new*
Before running Immedidate callback:: count: 1
2: suggestionCheck
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "suggestionDiag",
"body": {
"file": "/home/src/projects/project/src/file.ts",
"diagnostics": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 26
},
"text": "'a' is declared but its value is never read.",
"code": 6133,
"category": "suggestion",
"reportsUnnecessary": true
}
],
"duration": *
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "requestCompleted",
"body": {
"request_seq": 2
}
}
After running Immedidate callback:: count: 0

Просмотреть файл

@ -717,31 +717,7 @@ Info seq [hh:mm:ss:mss] event:
"body": {
"triggerFile": "/users/username/projects/project/A/tsconfig.json",
"configFile": "/users/username/projects/project/A/tsconfig.json",
"diagnostics": [
{
"text": "File '/users/username/projects/project/B/b2.ts' is not under 'rootDir' '/users/username/projects/project/A'. 'rootDir' is expected to contain all source files.\n The file is in the program because:\n Matched by include pattern '../B/b2.ts' in '/users/username/projects/project/A/tsconfig.json'",
"code": 6059,
"category": "error",
"relatedInformation": [
{
"span": {
"start": {
"line": 8,
"offset": 7
},
"end": {
"line": 8,
"offset": 19
},
"file": "/users/username/projects/project/A/tsconfig.json"
},
"message": "File is matched by include pattern specified here.",
"category": "message",
"code": 1408
}
]
}
]
"diagnostics": []
}
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /users/username/projects/project/B/tsconfig.json