🤖 Pick PR #59195 (Added affectsSourceFile to importHe...) into release-5.5 (#59231)

Co-authored-by: Armando Aguirre <armando.aguirre@microsoft.com>
This commit is contained in:
TypeScript Bot 2024-07-16 13:45:08 -07:00 committed by GitHub
parent 315f9f9a14
commit 3a7983a024
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 972 additions and 6 deletions

View File

@ -800,6 +800,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
type: "boolean",
affectsEmit: true,
affectsBuildInfo: true,
affectsSourceFile: true,
category: Diagnostics.Emit,
description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
defaultValueDescription: false,
@ -1270,6 +1271,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
affectsEmit: true,
affectsBuildInfo: true,
affectsModuleResolution: true,
affectsSourceFile: true,
category: Diagnostics.Language_and_Environment,
description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
defaultValueDescription: "react",

View File

@ -198,6 +198,7 @@ export * from "./unittests/tsserver/pasteEdits.js";
export * from "./unittests/tsserver/plugins.js";
export * from "./unittests/tsserver/pluginsAsync.js";
export * from "./unittests/tsserver/projectErrors.js";
export * from "./unittests/tsserver/projectImportHelpers.js";
export * from "./unittests/tsserver/projectReferenceCompileOnSave.js";
export * from "./unittests/tsserver/projectReferenceErrors.js";
export * from "./unittests/tsserver/projectReferences.js";

View File

@ -0,0 +1,71 @@
import * as ts from "../../_namespaces/ts.js";
import { jsonToReadableText } from "../helpers.js";
import {
baselineTsserverLogs,
openFilesForSession,
TestSession,
} from "../helpers/tsserver.js";
import { createServerHost } from "../helpers/virtualFileSystemWithWatch.js";
describe("unittests:: tsserver:: projectImportHelpers::", () => {
it("import helpers sucessfully", () => {
const type1 = {
path: "/a/type.ts",
content: `
export type Foo {
bar: number;
};`,
};
const file1 = {
path: "/a/file1.ts",
content: `
import { Foo } from "./type";
const a: Foo = { bar : 1 };
a.bar;`,
};
const file2 = {
path: "/a/file2.ts",
content: `
import { Foo } from "./type";
const a: Foo = { bar : 2 };
a.bar;`,
};
const config1 = {
path: "/a/tsconfig.json",
content: jsonToReadableText({
extends: "../tsconfig.json",
compilerOptions: {
importHelpers: true,
},
}),
};
const file3 = {
path: "/file3.js",
content: "console.log('noop');",
};
const config2 = {
path: "/tsconfig.json",
content: jsonToReadableText({
include: ["**/*"],
}),
};
const host = createServerHost([config2, config1, type1, file1, file2, file3]);
const session = new TestSession(host);
openFilesForSession([file3, file1], session);
session.executeCommandSeq<ts.server.protocol.ReferencesRequest>({
command: ts.server.protocol.CommandTypes.References,
arguments: {
file: file1.path,
line: 4,
offset: 3,
},
});
baselineTsserverLogs("importHelpers", "import helpers successfully", session);
});
});

View File

@ -193,7 +193,7 @@ ScriptInfos::
/user/username/projects/myproject/tsconfig.json
DocumentRegistry::
Key:: undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined
Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined
/user/username/projects/myproject/index.ts: TS 1
/user/username/projects/myproject/module1.d.ts: TS 1
/a/lib/lib.d.ts: TS 1
@ -254,7 +254,7 @@ Info seq [hh:mm:ss:mss] Files (2)
Info seq [hh:mm:ss:mss] -----------------------------------------------
DocumentRegistry::
Key:: undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined
Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined
/user/username/projects/myproject/index.ts: TS 1
/a/lib/lib.d.ts: TS 1
Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /user/username/projects/myproject/module1.d.ts 1:: WatchInfo: /user/username/projects/myproject/module1.d.ts 500 undefined WatchType: Closed Script info
@ -344,7 +344,7 @@ Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] -----------------------------------------------
DocumentRegistry::
Key:: undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined
Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined
/user/username/projects/myproject/index.ts: TS 1
/a/lib/lib.d.ts: TS 1
/user/username/projects/myproject/module1.d.ts: TS 1

View File

@ -193,7 +193,7 @@ ScriptInfos::
/user/username/projects/myproject/tsconfig.json
DocumentRegistry::
Key:: undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined
Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined
/user/username/projects/myproject/index.ts: TS 1
/user/username/projects/myproject/module1.d.ts: TS 1
/a/lib/lib.d.ts: TS 1
@ -254,7 +254,7 @@ Info seq [hh:mm:ss:mss] Files (2)
Info seq [hh:mm:ss:mss] -----------------------------------------------
DocumentRegistry::
Key:: undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined
Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined
/user/username/projects/myproject/index.ts: TS 1
/a/lib/lib.d.ts: TS 1
Before request
@ -336,7 +336,7 @@ Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] -----------------------------------------------
DocumentRegistry::
Key:: undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined
Key:: undefined|undefined|undefined|undefined|false|undefined|undefined|undefined|undefined|undefined|undefined|undefined
/user/username/projects/myproject/index.ts: TS 1
/a/lib/lib.d.ts: TS 1
/user/username/projects/myproject/module1.d.ts: TS 1

View File

@ -0,0 +1,892 @@
currentDirectory:: / useCaseSensitiveFileNames: false
Info seq [hh:mm:ss:mss] Provided types map file "/typesMap.json" doesn't exist
Before request
//// [/tsconfig.json]
{
"include": [
"**/*"
]
}
//// [/a/tsconfig.json]
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true
}
}
//// [/a/type.ts]
export type Foo {
bar: number;
};
//// [/a/file1.ts]
import { Foo } from "./type";
const a: Foo = { bar : 1 };
a.bar;
//// [/a/file2.ts]
import { Foo } from "./type";
const a: Foo = { bar : 2 };
a.bar;
//// [/file3.js]
console.log('noop');
Info seq [hh:mm:ss:mss] request:
{
"command": "open",
"arguments": {
"file": "/file3.js"
},
"seq": 1,
"type": "request"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /file3.js ProjectRootPath: undefined:: Result: /tsconfig.json
Info seq [hh:mm:ss:mss] Creating configuration project /tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /tsconfig.json 2000 undefined Project: /tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/tsconfig.json",
"reason": "Creating possible configured project for /file3.js to open"
}
}
Info seq [hh:mm:ss:mss] Config: /tsconfig.json : {
"rootNames": [
"/a/file1.ts",
"/a/file2.ts",
"/a/type.ts"
],
"options": {
"configFilePath": "/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/file1.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/file2.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/type.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /tsconfig.json WatchType: Missing file
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
/a/type.ts Text-1 "\nexport type Foo {\n bar: number;\n};"
/a/file1.ts Text-1 "\nimport { Foo } from \"./type\";\nconst a: Foo = { bar : 1 };\na.bar;"
/a/file2.ts Text-1 "\nimport { Foo } from \"./type\";\nconst a: Foo = { bar : 2 };\na.bar;"
a/type.ts
Imported via "./type" from file 'a/file1.ts'
Imported via "./type" from file 'a/file2.ts'
Matched by include pattern '**/*' in 'tsconfig.json'
a/file1.ts
Matched by include pattern '**/*' in 'tsconfig.json'
a/file2.ts
Matched by include pattern '**/*' in 'tsconfig.json'
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "telemetry",
"body": {
"telemetryEventName": "projectInfo",
"payload": {
"projectId": "aace87d7c1572ff43c6978074161b586788b4518c7a9d06c79c03e613b6ce5a3",
"fileStats": {
"js": 0,
"jsSize": 0,
"jsx": 0,
"jsxSize": 0,
"ts": 3,
"tsSize": 168,
"tsx": 0,
"tsxSize": 0,
"dts": 0,
"dtsSize": 0,
"deferred": 0,
"deferredSize": 0
},
"compilerOptions": {},
"typeAcquisition": {
"enable": false,
"include": false,
"exclude": false
},
"extends": false,
"files": false,
"include": true,
"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": "/file3.js",
"configFile": "/tsconfig.json",
"diagnostics": [
{
"text": "File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'",
"code": 6053,
"category": "error"
},
{
"text": "Cannot find global type 'Array'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Boolean'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Function'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'IArguments'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Number'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Object'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'RegExp'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'String'.",
"code": 2318,
"category": "error"
}
]
}
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /dev/null/inferredProject1* WatchType: Missing file
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred)
Info seq [hh:mm:ss:mss] Files (1)
/file3.js SVC-1-0 "console.log('noop');"
file3.js
Root file specified for compilation
Info seq [hh:mm:ss:mss] -----------------------------------------------
TI:: Creating typing installer
PolledWatches::
/a/lib/lib.d.ts: *new*
{"pollingInterval":500}
FsWatches::
/a/file1.ts: *new*
{}
/a/file2.ts: *new*
{}
/a/type.ts: *new*
{}
/tsconfig.json: *new*
{}
FsWatchesRecursive::
/: *new*
{}
Projects::
/dev/null/inferredProject1* (Inferred) *new*
projectStateVersion: 1
projectProgramVersion: 0
/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
noOpenRef: true
ScriptInfos::
/a/file1.ts *new*
version: Text-1
containingProjects: 1
/tsconfig.json
/a/file2.ts *new*
version: Text-1
containingProjects: 1
/tsconfig.json
/a/type.ts *new*
version: Text-1
containingProjects: 1
/tsconfig.json
/file3.js (Open) *new*
version: SVC-1-0
containingProjects: 1
/dev/null/inferredProject1* *default*
TI:: [hh:mm:ss:mss] Global cache location '/a/data', safe file path '/safeList.json', types map path /typesMap.json
TI:: [hh:mm:ss:mss] Processing cache location '/a/data'
TI:: [hh:mm:ss:mss] Trying to find '/a/data/package.json'...
TI:: [hh:mm:ss:mss] Finished processing cache location '/a/data'
TI:: [hh:mm:ss:mss] Npm config file: /a/data/package.json
TI:: [hh:mm:ss:mss] Npm config file: '/a/data/package.json' is missing, creating new one...
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Scheduled: /tsconfig.json
Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles*
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Config: /tsconfig.json Detected new package.json: /a/data/package.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/data/package.json 250 undefined WatchType: package.json file
Info seq [hh:mm:ss:mss] Project: /tsconfig.json Detected file add/remove of non supported extension: a/data/package.json
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/package.json :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
TI:: [hh:mm:ss:mss] Updating types-registry npm package...
TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Scheduled: /tsconfig.json, Cancelled earlier one
Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Scheduled: /tsconfig.json, Cancelled earlier one
Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Project: /tsconfig.json Detected file add/remove of non supported extension: a/data/node_modules/types-registry/index.json
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with a/data/node_modules/types-registry/index.json :: WatchInfo: 1 undefined Config: /tsconfig.json WatchType: Wild card directory
TI:: [hh:mm:ss:mss] Updated types-registry npm package
TI:: typing installer creation complete
//// [/a/data/package.json]
{ "private": true }
//// [/a/data/node_modules/types-registry/index.json]
{
"entries": {}
}
PolledWatches::
/a/lib/lib.d.ts:
{"pollingInterval":500}
FsWatches::
/a/data/package.json: *new*
{}
/a/file1.ts:
{}
/a/file2.ts:
{}
/a/type.ts:
{}
/tsconfig.json:
{}
FsWatchesRecursive::
/:
{}
Timeout callback:: count: 2
5: /tsconfig.json *new*
6: *ensureProjectForOpenFiles* *new*
Projects::
/dev/null/inferredProject1* (Inferred)
projectStateVersion: 1
projectProgramVersion: 0
/tsconfig.json (Configured) *changed*
projectStateVersion: 2 *changed*
projectProgramVersion: 1
dirty: true *changed*
noOpenRef: false *changed*
TI:: [hh:mm:ss:mss] Got install request
{
"projectName": "/dev/null/inferredProject1*",
"fileNames": [
"/file3.js"
],
"compilerOptions": {
"target": 1,
"jsx": 1,
"allowNonTsExtensions": true,
"allowJs": true,
"noEmitForJsFiles": true,
"maxNodeModuleJsDepth": 2
},
"typeAcquisition": {
"enable": true,
"include": [],
"exclude": []
},
"unresolvedImports": [],
"projectRootPath": "/",
"kind": "discover"
}
TI:: [hh:mm:ss:mss] Failed to load safelist from types map file '/typesMap.json'
TI:: [hh:mm:ss:mss] Explicitly included types: []
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: []
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
"newTypingNames": [],
"filesToWatch": [
"/bower_components",
"/node_modules"
]
}
TI:: [hh:mm:ss:mss] Sending response:
{
"kind": "action::watchTypingLocations",
"projectName": "/dev/null/inferredProject1*",
"files": [
"/bower_components",
"/node_modules"
]
}
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /bower_components 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Directory location for typing installer
TI:: [hh:mm:ss:mss] Sending response:
{
"projectName": "/dev/null/inferredProject1*",
"typeAcquisition": {
"enable": true,
"include": [],
"exclude": []
},
"compilerOptions": {
"target": 1,
"jsx": 1,
"allowNonTsExtensions": true,
"allowJs": true,
"noEmitForJsFiles": true,
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "setTypings",
"body": {
"projectName": "/dev/null/inferredProject1*",
"typeAcquisition": {
"enable": true,
"include": [],
"exclude": []
},
"compilerOptions": {
"target": 1,
"jsx": 1,
"allowNonTsExtensions": true,
"allowJs": true,
"noEmitForJsFiles": true,
"maxNodeModuleJsDepth": 2
},
"typings": [],
"unresolvedImports": [],
"kind": "action::set"
}
}
TI:: [hh:mm:ss:mss] No new typings were requested as a result of typings discovery
Info seq [hh:mm:ss:mss] Project '/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred)
Info seq [hh:mm:ss:mss] Files (1)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /file3.js ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1*
Info seq [hh:mm:ss:mss] response:
{
"responseRequired": false
}
After request
PolledWatches::
/a/lib/lib.d.ts:
{"pollingInterval":500}
/bower_components: *new*
{"pollingInterval":500}
/node_modules: *new*
{"pollingInterval":500}
FsWatches::
/a/data/package.json:
{}
/a/file1.ts:
{}
/a/file2.ts:
{}
/a/type.ts:
{}
/tsconfig.json:
{}
FsWatchesRecursive::
/:
{}
Projects::
/dev/null/inferredProject1* (Inferred) *changed*
projectStateVersion: 1
projectProgramVersion: 1 *changed*
/tsconfig.json (Configured)
projectStateVersion: 2
projectProgramVersion: 1
dirty: true
Before request
Info seq [hh:mm:ss:mss] request:
{
"command": "open",
"arguments": {
"file": "/a/file1.ts"
},
"seq": 2,
"type": "request"
}
Info seq [hh:mm:ss:mss] FileWatcher:: Close:: WatchInfo: /a/file1.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /a/file1.ts ProjectRootPath: undefined:: Result: /a/tsconfig.json
Info seq [hh:mm:ss:mss] Creating configuration project /a/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/tsconfig.json 2000 undefined Project: /a/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/a/tsconfig.json",
"reason": "Creating possible configured project for /a/file1.ts to open"
}
}
Info seq [hh:mm:ss:mss] Config: /a/tsconfig.json : {
"rootNames": [
"/a/file1.ts",
"/a/file2.ts",
"/a/type.ts"
],
"options": {
"importHelpers": true,
"configFilePath": "/a/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /tsconfig.json 2000 undefined Config: /a/tsconfig.json WatchType: Extended config file
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: 1 undefined Config: /a/tsconfig.json WatchType: Wild card directory
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /a/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined Project: /a/tsconfig.json WatchType: Missing file
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /a/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/a/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
/a/type.ts Text-1 "\nexport type Foo {\n bar: number;\n};"
/a/file1.ts Text-1 "\nimport { Foo } from \"./type\";\nconst a: Foo = { bar : 1 };\na.bar;"
/a/file2.ts Text-1 "\nimport { Foo } from \"./type\";\nconst a: Foo = { bar : 2 };\na.bar;"
type.ts
Imported via "./type" from file 'file1.ts'
Imported via "./type" from file 'file2.ts'
Matched by include pattern '../**/*' in 'tsconfig.json'
file1.ts
Matched by include pattern '../**/*' in 'tsconfig.json'
file2.ts
Matched by include pattern '../**/*' in 'tsconfig.json'
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/a/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "telemetry",
"body": {
"telemetryEventName": "projectInfo",
"payload": {
"projectId": "bcbb3eb9a7f46ab3b8f574ad3733f3e5a7ce50557c14c0c6192f1203aedcacca",
"fileStats": {
"js": 0,
"jsSize": 0,
"jsx": 0,
"jsxSize": 0,
"ts": 3,
"tsSize": 168,
"tsx": 0,
"tsxSize": 0,
"dts": 0,
"dtsSize": 0,
"deferred": 0,
"deferredSize": 0
},
"compilerOptions": {
"importHelpers": true
},
"typeAcquisition": {
"enable": false,
"include": false,
"exclude": false
},
"extends": true,
"files": false,
"include": true,
"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": "/a/file1.ts",
"configFile": "/a/tsconfig.json",
"diagnostics": [
{
"text": "File '/a/lib/lib.d.ts' not found.\n The file is in the program because:\n Default library for target 'es5'",
"code": 6053,
"category": "error"
},
{
"text": "Cannot find global type 'Array'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Boolean'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Function'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'IArguments'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Number'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'Object'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'RegExp'.",
"code": 2318,
"category": "error"
},
{
"text": "Cannot find global type 'String'.",
"code": 2318,
"category": "error"
}
]
}
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /tsconfig.json
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Same program as before
Info seq [hh:mm:ss:mss] Project '/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Project '/a/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred)
Info seq [hh:mm:ss:mss] Files (1)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /file3.js ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1*
Info seq [hh:mm:ss:mss] FileName: /a/file1.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /tsconfig.json,/a/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"responseRequired": false
}
After request
PolledWatches::
/a/lib/lib.d.ts:
{"pollingInterval":500}
/bower_components:
{"pollingInterval":500}
/node_modules:
{"pollingInterval":500}
FsWatches::
/a/data/package.json:
{}
/a/file2.ts:
{}
/a/tsconfig.json: *new*
{}
/a/type.ts:
{}
/tsconfig.json:
{}
FsWatches *deleted*::
/a/file1.ts:
{}
FsWatchesRecursive::
/:
{}
Projects::
/a/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
/dev/null/inferredProject1* (Inferred)
projectStateVersion: 1
projectProgramVersion: 1
/tsconfig.json (Configured) *changed*
projectStateVersion: 2
projectProgramVersion: 1
dirty: false *changed*
ScriptInfos::
/a/file1.ts (Open) *changed*
open: true *changed*
version: Text-1
containingProjects: 2 *changed*
/tsconfig.json
/a/tsconfig.json *default* *new*
/a/file2.ts *changed*
version: Text-1
containingProjects: 2 *changed*
/tsconfig.json
/a/tsconfig.json *new*
/a/type.ts *changed*
version: Text-1
containingProjects: 2 *changed*
/tsconfig.json
/a/tsconfig.json *new*
/file3.js (Open)
version: SVC-1-0
containingProjects: 1
/dev/null/inferredProject1* *default*
Before request
Info seq [hh:mm:ss:mss] request:
{
"command": "references",
"arguments": {
"file": "/a/file1.ts",
"line": 4,
"offset": 3
},
"seq": 3,
"type": "request"
}
Info seq [hh:mm:ss:mss] Finding references to /a/file1.ts position 61 in project /a/tsconfig.json
Info seq [hh:mm:ss:mss] Finding references to /a/file1.ts position 61 in project /tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/type.d.ts 2000 undefined Project: /a/tsconfig.json WatchType: Missing generated file
Info seq [hh:mm:ss:mss] response:
{
"response": {
"refs": [
{
"file": "/a/type.ts",
"start": {
"line": 3,
"offset": 5
},
"end": {
"line": 3,
"offset": 8
},
"contextStart": {
"line": 3,
"offset": 5
},
"contextEnd": {
"line": 3,
"offset": 17
},
"lineText": " bar: number;",
"isWriteAccess": false
},
{
"file": "/a/file1.ts",
"start": {
"line": 3,
"offset": 18
},
"end": {
"line": 3,
"offset": 21
},
"contextStart": {
"line": 3,
"offset": 18
},
"contextEnd": {
"line": 3,
"offset": 25
},
"lineText": "const a: Foo = { bar : 1 };",
"isWriteAccess": true
},
{
"file": "/a/file1.ts",
"start": {
"line": 4,
"offset": 3
},
"end": {
"line": 4,
"offset": 6
},
"lineText": "a.bar;",
"isWriteAccess": false
},
{
"file": "/a/file2.ts",
"start": {
"line": 3,
"offset": 18
},
"end": {
"line": 3,
"offset": 21
},
"contextStart": {
"line": 3,
"offset": 18
},
"contextEnd": {
"line": 3,
"offset": 25
},
"lineText": "const a: Foo = { bar : 2 };",
"isWriteAccess": true
},
{
"file": "/a/file2.ts",
"start": {
"line": 4,
"offset": 3
},
"end": {
"line": 4,
"offset": 6
},
"lineText": "a.bar;",
"isWriteAccess": false
}
],
"symbolName": "bar",
"symbolStartOffset": 3,
"symbolDisplayString": "(property) bar: number"
},
"responseRequired": true
}
After request
PolledWatches::
/a/lib/lib.d.ts:
{"pollingInterval":500}
/a/type.d.ts: *new*
{"pollingInterval":2000}
/bower_components:
{"pollingInterval":500}
/node_modules:
{"pollingInterval":500}
FsWatches::
/a/data/package.json:
{}
/a/file2.ts:
{}
/a/tsconfig.json:
{}
/a/type.ts:
{}
/tsconfig.json:
{}
FsWatchesRecursive::
/:
{}
Projects::
/a/tsconfig.json (Configured) *changed*
projectStateVersion: 1
projectProgramVersion: 1
documentPositionMappers: 1 *changed*
/a/type.d.ts: identitySourceMapConsumer *new*
/dev/null/inferredProject1* (Inferred)
projectStateVersion: 1
projectProgramVersion: 1
/tsconfig.json (Configured)
projectStateVersion: 2
projectProgramVersion: 1