fix autoimports crash: generate namespace and other module symbol imports (#60333)

This commit is contained in:
Isabel Duan 2024-10-31 17:03:12 -07:00 committed by GitHub
parent 32513a7745
commit 3e6171833e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 2361 additions and 22 deletions

View File

@ -80,12 +80,15 @@ import {
ImportSpecifier,
insertImports,
InternalSymbolName,
isDefaultImport,
isExternalModuleReference,
isFullSourceFile,
isIdentifier,
isImportable,
isImportClause,
isImportDeclaration,
isImportEqualsDeclaration,
isImportSpecifier,
isIntrinsicJsxName,
isJSDocImportTag,
isJsxClosingElement,
@ -228,6 +231,7 @@ export interface ImportAdder {
addImportFromDiagnostic: (diagnostic: DiagnosticWithLocation, context: CodeFixContextBase) => void;
addImportFromExportedSymbol: (exportedSymbol: Symbol, isValidTypeOnlyUseSite?: boolean, referenceImport?: ImportOrRequireAliasDeclaration) => void;
addImportForNonExistentExport: (exportName: string, exportingFileName: string, exportKind: ExportKind, exportedMeanings: SymbolFlags, isImportUsageValidAsTypeOnly: boolean) => void;
addImportForModuleSymbol: (symbolAlias: Symbol, isValidTypeOnlyUseSite: boolean, referenceImport: ImportOrRequireAliasDeclaration) => void;
addImportForUnresolvedIdentifier: (context: CodeFixContextBase, symbolToken: Identifier, useAutoImportProvider: boolean) => void;
addVerbatimImport: (declaration: AnyImportOrRequireStatement | ImportOrRequireAliasDeclaration) => void;
removeExistingImport: (declaration: ImportOrRequireAliasDeclaration) => void;
@ -257,7 +261,7 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog
type NewImportsKey = `${0 | 1}|${string}`;
/** Use `getNewImportEntry` for access */
const newImports = new Map<NewImportsKey, Mutable<ImportsCollection & { useRequire: boolean; }>>();
return { addImportFromDiagnostic, addImportFromExportedSymbol, writeFixes, hasFixes, addImportForUnresolvedIdentifier, addImportForNonExistentExport, removeExistingImport, addVerbatimImport };
return { addImportFromDiagnostic, addImportFromExportedSymbol, addImportForModuleSymbol, writeFixes, hasFixes, addImportForUnresolvedIdentifier, addImportForNonExistentExport, removeExistingImport, addVerbatimImport };
function addVerbatimImport(declaration: AnyImportOrRequireStatement | ImportOrRequireAliasDeclaration) {
verbatimImports.add(declaration);
@ -276,7 +280,7 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog
}
function addImportFromExportedSymbol(exportedSymbol: Symbol, isValidTypeOnlyUseSite?: boolean, referenceImport?: ImportOrRequireAliasDeclaration) {
const moduleSymbol = Debug.checkDefined(exportedSymbol.parent);
const moduleSymbol = Debug.checkDefined(exportedSymbol.parent, "Expected exported symbol to have module symbol as parent");
const symbolName = getNameForExportedSymbol(exportedSymbol, getEmitScriptTarget(compilerOptions));
const checker = program.getTypeChecker();
const symbol = checker.getMergedSymbol(skipAlias(exportedSymbol, checker));
@ -317,6 +321,74 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog
}
}
function addImportForModuleSymbol(symbolAlias: Symbol, isValidTypeOnlyUseSite: boolean, referenceImport: ImportOrRequireAliasDeclaration) {
// Adds import for module, import alias will be symbolAlias.name
const checker = program.getTypeChecker();
const moduleSymbol = checker.getAliasedSymbol(symbolAlias);
Debug.assert(moduleSymbol.flags & SymbolFlags.Module, "Expected symbol to be a module");
const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host);
const moduleSpecifierResult = moduleSpecifiers.getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, sourceFile, moduleSpecifierResolutionHost, preferences, /*options*/ undefined, /*forAutoImport*/ true);
const useRequire = shouldUseRequire(sourceFile, program);
// Copy the type-only status from the reference import
let addAsTypeOnly = getAddAsTypeOnly(
isValidTypeOnlyUseSite,
/*isForNewImportDeclaration*/ true,
/*symbol*/ undefined,
symbolAlias.flags,
program.getTypeChecker(),
compilerOptions,
);
addAsTypeOnly = addAsTypeOnly === AddAsTypeOnly.Allowed && isTypeOnlyImportDeclaration(referenceImport) ? AddAsTypeOnly.Required : AddAsTypeOnly.Allowed;
// Copy the kind of import
const importKind = isImportDeclaration(referenceImport) ?
isDefaultImport(referenceImport) ? ImportKind.Default : ImportKind.Namespace :
isImportSpecifier(referenceImport) ? ImportKind.Named :
isImportClause(referenceImport) && !!referenceImport.name ? ImportKind.Default : ImportKind.Namespace;
const exportInfo = [{
symbol: symbolAlias,
moduleSymbol,
moduleFileName: moduleSymbol.declarations?.[0]?.getSourceFile()?.fileName,
exportKind: ExportKind.Module,
targetFlags: symbolAlias.flags,
isFromPackageJson: false,
}];
const existingFix = getImportFixForSymbol(
sourceFile,
exportInfo,
program,
/*position*/ undefined,
!!isValidTypeOnlyUseSite,
useRequire,
host,
preferences,
);
let fix: FixAddNewImport | ImportFixWithModuleSpecifier;
if (existingFix && importKind !== ImportKind.Namespace) {
fix = {
...existingFix,
addAsTypeOnly,
importKind,
};
}
else {
fix = {
kind: ImportFixKind.AddNew,
moduleSpecifierKind: existingFix !== undefined ? existingFix.moduleSpecifierKind : moduleSpecifierResult.kind,
moduleSpecifier: existingFix !== undefined ? existingFix.moduleSpecifier : first(moduleSpecifierResult.moduleSpecifiers),
importKind,
addAsTypeOnly,
useRequire,
};
}
addImport({ fix, symbolName: symbolAlias.name, errorIdentifierText: undefined });
}
function addImportForNonExistentExport(exportName: string, exportingFileName: string, exportKind: ExportKind, exportedMeanings: SymbolFlags, isImportUsageValidAsTypeOnly: boolean) {
const exportingSourceFile = program.getSourceFile(exportingFileName);
const useRequire = shouldUseRequire(sourceFile, program);
@ -1452,6 +1524,8 @@ export function getImportKind(importingFile: SourceFile | FutureSourceFile, expo
return getExportEqualsImportKind(importingFile, program.getCompilerOptions(), !!forceImportKeyword);
case ExportKind.UMD:
return getUmdImportKind(importingFile, program, !!forceImportKeyword);
case ExportKind.Module:
return ImportKind.Namespace;
default:
return Debug.assertNever(exportKind);
}

View File

@ -74,6 +74,7 @@ export const enum ExportKind {
Default,
ExportEquals,
UMD,
Module,
}
/** @internal */

View File

@ -80,6 +80,10 @@ export function addTargetFileImports(
if (checker.isUnknownSymbol(targetSymbol)) {
importAdder.addVerbatimImport(Debug.checkDefined(declaration ?? findAncestor(symbol.declarations?.[0], isAnyImportOrRequireStatement)));
}
else if (targetSymbol.parent === undefined) {
Debug.assert(declaration !== undefined, "expected module symbol to have a declaration");
importAdder.addImportForModuleSymbol(symbol, isValidTypeOnlyUseSite, declaration);
}
else {
importAdder.addImportFromExportedSymbol(targetSymbol, isValidTypeOnlyUseSite, declaration);
}

View File

@ -22,11 +22,11 @@ console.log(abc);
console.log("abc");
//// [/home/src/workspaces/project/c.ts]
//// [/home/src/workspaces/project/folder/c.ts]
//// [/home/src/workspaces/project/tsconfig.json]
{ "files": ["c.ts", "a.ts", "b.ts"] }
{ "files": ["folder/c.ts", "a.ts", "b.ts"] }
Info seq [hh:mm:ss:mss] request:
@ -34,16 +34,16 @@ Info seq [hh:mm:ss:mss] request:
"seq": 0,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/c.ts"
"file": "/home/src/workspaces/project/folder/c.ts"
},
"command": "open"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : {
"rootNames": [
"/home/src/workspaces/project/c.ts",
"/home/src/workspaces/project/folder/c.ts",
"/home/src/workspaces/project/a.ts",
"/home/src/workspaces/project/b.ts"
],
@ -58,7 +58,7 @@ Info seq [hh:mm:ss:mss] event:
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json",
"reason": "Creating possible configured project for /home/src/workspaces/project/c.ts to open"
"reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open"
}
}
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info
@ -81,7 +81,7 @@ Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/c.ts SVC-1-0 ""
/home/src/workspaces/project/folder/c.ts SVC-1-0 ""
/home/src/workspaces/project/a.ts Text-1 "export const abc = 10;"
/home/src/workspaces/project/b.ts Text-1 "import { abc } from \"./a\";\n\nconsole.log(abc);\n\n\nconsole.log(\"abc\");"
@ -92,7 +92,7 @@ Info seq [hh:mm:ss:mss] Files (6)
Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts'
../../tslibs/TS/Lib/lib.decorators.legacy.d.ts
Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts'
c.ts
folder/c.ts
Part of 'files' list in tsconfig.json
a.ts
Part of 'files' list in tsconfig.json
@ -116,7 +116,7 @@ Info seq [hh:mm:ss:mss] event:
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/workspaces/project/c.ts",
"triggerFile": "/home/src/workspaces/project/folder/c.ts",
"configFile": "/home/src/workspaces/project/tsconfig.json",
"diagnostics": []
}
@ -126,7 +126,7 @@ Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/c.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
@ -191,7 +191,7 @@ ScriptInfos::
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/c.ts (Open) *new*
/home/src/workspaces/project/folder/c.ts (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*
@ -242,7 +242,7 @@ Info seq [hh:mm:ss:mss] request:
"seq": 2,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/c.ts",
"file": "/home/src/workspaces/project/folder/c.ts",
"pastedText": [
"console.log(abc);"
],
@ -283,7 +283,7 @@ Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/c.ts SVC-1-1 "console.log(abc);"
/home/src/workspaces/project/folder/c.ts SVC-1-1 "console.log(abc);"
/home/src/workspaces/project/a.ts Text-1 "export const abc = 10;"
/home/src/workspaces/project/b.ts Text-1 "import { abc } from \"./a\";\n\nconsole.log(abc);\n\n\nconsole.log(\"abc\");"
@ -303,7 +303,7 @@ Info seq [hh:mm:ss:mss] response:
"body": {
"edits": [
{
"fileName": "/home/src/workspaces/project/c.ts",
"fileName": "/home/src/workspaces/project/folder/c.ts",
"textChanges": [
{
"start": {
@ -314,7 +314,7 @@ Info seq [hh:mm:ss:mss] response:
"line": 1,
"offset": 1
},
"newText": "import { abc } from \"./a\";\n\n"
"newText": "import { abc } from \"../a\";\n\n"
},
{
"start": {
@ -362,7 +362,7 @@ ScriptInfos::
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/c.ts (Open) *changed*
/home/src/workspaces/project/folder/c.ts (Open) *changed*
version: SVC-1-2 *changed*
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*

View File

@ -0,0 +1,366 @@
Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false
Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib
Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript
Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist
//// [/home/src/tslibs/TS/Lib/lib.d.ts]
lib.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts]
lib.decorators.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts]
lib.decorators.legacy.d.ts-Text
//// [/home/src/workspaces/project/a.ts]
export default function foo(name: string): void {
console.log(name);
}
//// [/home/src/workspaces/project/b.ts]
import foo from "./a";
const b = foo("bar");
//// [/home/src/workspaces/project/folder/c.ts]
//// [/home/src/workspaces/project/tsconfig.json]
{ "files": ["folder/c.ts", "a.ts", "b.ts"] }
Info seq [hh:mm:ss:mss] request:
{
"seq": 0,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.ts"
},
"command": "open"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : {
"rootNames": [
"/home/src/workspaces/project/folder/c.ts",
"/home/src/workspaces/project/a.ts",
"/home/src/workspaces/project/b.ts"
],
"options": {
"configFilePath": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json",
"reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open"
}
}
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/b.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.ts SVC-1-0 ""
/home/src/workspaces/project/a.ts Text-1 "export default function foo(name: string): void {\n console.log(name);\n}"
/home/src/workspaces/project/b.ts Text-1 "import foo from \"./a\";\nconst b = foo(\"bar\");"
../../tslibs/TS/Lib/lib.d.ts
Default library for target 'es5'
../../tslibs/TS/Lib/lib.decorators.d.ts
Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts'
../../tslibs/TS/Lib/lib.decorators.legacy.d.ts
Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts'
folder/c.ts
Part of 'files' list in tsconfig.json
a.ts
Part of 'files' list in tsconfig.json
Imported via "./a" from file 'b.ts'
b.ts
Part of 'files' list in tsconfig.json
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/workspaces/project/folder/c.ts",
"configFile": "/home/src/workspaces/project/tsconfig.json",
"diagnostics": []
}
}
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 0,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
}
}
After Request
watchedFiles::
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/a.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/b.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/tsconfig.json: *new*
{"pollingInterval":2000}
watchedDirectoriesRecursive::
/home/src/workspaces/node_modules: *new*
{}
/home/src/workspaces/node_modules/@types: *new*
{}
/home/src/workspaces/project/node_modules: *new*
{}
/home/src/workspaces/project/node_modules/@types: *new*
{}
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/a.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/b.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.ts (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*
Info seq [hh:mm:ss:mss] request:
{
"seq": 1,
"type": "request",
"arguments": {
"formatOptions": {
"indentSize": 4,
"tabSize": 4,
"newLineCharacter": "\n",
"convertTabsToSpaces": true,
"indentStyle": 2,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true,
"indentSwitchCase": true
}
},
"command": "configure"
}
Info seq [hh:mm:ss:mss] Format host information updated
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "configure",
"request_seq": 1,
"success": true
}
Info seq [hh:mm:ss:mss] request:
{
"seq": 2,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.ts",
"pastedText": [
"const b = foo(\"bar\");"
],
"pasteLocations": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
}
}
],
"copiedFrom": {
"file": "/home/src/workspaces/project/b.ts",
"spans": [
{
"start": {
"line": 2,
"offset": 1
},
"end": {
"line": 2,
"offset": 22
}
}
]
}
},
"command": "getPasteEdits"
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.ts SVC-1-1 "const b = foo(\"bar\");"
/home/src/workspaces/project/a.ts Text-1 "export default function foo(name: string): void {\n console.log(name);\n}"
/home/src/workspaces/project/b.ts Text-1 "import foo from \"./a\";\nconst b = foo(\"bar\");"
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] getExportInfoMap: cache miss or empty; calculating new results
Info seq [hh:mm:ss:mss] getExportInfoMap: done in * ms
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "getPasteEdits",
"request_seq": 2,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
},
"body": {
"edits": [
{
"fileName": "/home/src/workspaces/project/folder/c.ts",
"textChanges": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "import foo from \"../a\";\n\n"
},
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "const b = foo(\"bar\");"
}
]
}
],
"fixId": "providePostPasteEdits"
}
}
After Request
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *changed*
projectStateVersion: 3 *changed*
projectProgramVersion: 1
dirty: true *changed*
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/a.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/b.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.ts (Open) *changed*
version: SVC-1-2 *changed*
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*

View File

@ -0,0 +1,344 @@
Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false
Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib
Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript
Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist
//// [/home/src/tslibs/TS/Lib/lib.d.ts]
lib.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts]
lib.decorators.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts]
lib.decorators.legacy.d.ts-Text
//// [/home/src/workspaces/project/a.ts]
const b = foo("bar");
export default function foo(name: string): void {
console.log(name);
}
//// [/home/src/workspaces/project/folder/c.ts]
//// [/home/src/workspaces/project/tsconfig.json]
{ "files": ["folder/c.ts", "a.ts"] }
Info seq [hh:mm:ss:mss] request:
{
"seq": 0,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.ts"
},
"command": "open"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : {
"rootNames": [
"/home/src/workspaces/project/folder/c.ts",
"/home/src/workspaces/project/a.ts"
],
"options": {
"configFilePath": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json",
"reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open"
}
}
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (5)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.ts SVC-1-0 ""
/home/src/workspaces/project/a.ts Text-1 "const b = foo(\"bar\");\n export default function foo(name: string): void {\n console.log(name);\n }"
../../tslibs/TS/Lib/lib.d.ts
Default library for target 'es5'
../../tslibs/TS/Lib/lib.decorators.d.ts
Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts'
../../tslibs/TS/Lib/lib.decorators.legacy.d.ts
Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts'
folder/c.ts
Part of 'files' list in tsconfig.json
a.ts
Part of 'files' list in tsconfig.json
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/workspaces/project/folder/c.ts",
"configFile": "/home/src/workspaces/project/tsconfig.json",
"diagnostics": []
}
}
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (5)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 0,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
}
}
After Request
watchedFiles::
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/a.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/tsconfig.json: *new*
{"pollingInterval":2000}
watchedDirectoriesRecursive::
/home/src/workspaces/node_modules: *new*
{}
/home/src/workspaces/node_modules/@types: *new*
{}
/home/src/workspaces/project/node_modules: *new*
{}
/home/src/workspaces/project/node_modules/@types: *new*
{}
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/a.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.ts (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*
Info seq [hh:mm:ss:mss] request:
{
"seq": 1,
"type": "request",
"arguments": {
"formatOptions": {
"indentSize": 4,
"tabSize": 4,
"newLineCharacter": "\n",
"convertTabsToSpaces": true,
"indentStyle": 2,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true,
"indentSwitchCase": true
}
},
"command": "configure"
}
Info seq [hh:mm:ss:mss] Format host information updated
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "configure",
"request_seq": 1,
"success": true
}
Info seq [hh:mm:ss:mss] request:
{
"seq": 2,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.ts",
"pastedText": [
"const b = foo(\"bar\");"
],
"pasteLocations": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
}
}
],
"copiedFrom": {
"file": "/home/src/workspaces/project/a.ts",
"spans": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 22
}
}
]
}
},
"command": "getPasteEdits"
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (5)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.ts SVC-1-1 "const b = foo(\"bar\");"
/home/src/workspaces/project/a.ts Text-1 "const b = foo(\"bar\");\n export default function foo(name: string): void {\n console.log(name);\n }"
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "getPasteEdits",
"request_seq": 2,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
},
"body": {
"edits": [
{
"fileName": "/home/src/workspaces/project/folder/c.ts",
"textChanges": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "import foo from \"../a\";\n\n"
},
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "const b = foo(\"bar\");"
}
]
}
],
"fixId": "providePostPasteEdits"
}
}
After Request
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *changed*
projectStateVersion: 3 *changed*
projectProgramVersion: 1
dirty: true *changed*
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/a.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.ts (Open) *changed*
version: SVC-1-2 *changed*
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*

View File

@ -0,0 +1,387 @@
Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false
Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib
Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript
Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist
//// [/home/src/tslibs/TS/Lib/lib.d.ts]
lib.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts]
lib.decorators.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts]
lib.decorators.legacy.d.ts-Text
//// [/home/src/workspaces/project/folder/a.ts]
const abc = 10;
const def = 20;
export interface testInterface {
abc: number;
def: number;
}
//// [/home/src/workspaces/project/folder/b.mts]
import test from "./a.js";
function foo(abc: test.testInterface, def: test.testInterface) {
console.log(abc);
console.log(def);
}
//// [/home/src/workspaces/project/folder/folder/c.ts]
//// [/home/src/workspaces/project/folder/tsconfig.json]
{ "compilerOptions": { "module": "nodenext" }, "files": ["folder/c.ts", "a.ts", "b.mts"] }
Info seq [hh:mm:ss:mss] request:
{
"seq": 0,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/folder/c.ts"
},
"command": "open"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/folder/tsconfig.json
Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/folder/tsconfig.json, currentDirectory: /home/src/workspaces/project/folder
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/folder/tsconfig.json : {
"rootNames": [
"/home/src/workspaces/project/folder/folder/c.ts",
"/home/src/workspaces/project/folder/a.ts",
"/home/src/workspaces/project/folder/b.mts"
],
"options": {
"module": 199,
"configFilePath": "/home/src/workspaces/project/folder/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/workspaces/project/folder/tsconfig.json",
"reason": "Creating possible configured project for /home/src/workspaces/project/folder/folder/c.ts to open"
}
}
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/a.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/b.mts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/folder/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/package.json 2000 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: File location affecting resolution
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts 500 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Missing file
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/folder/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/folder/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/folder/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
/home/src/workspaces/project/folder/folder/c.ts SVC-1-0 ""
/home/src/workspaces/project/folder/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}"
/home/src/workspaces/project/folder/b.mts Text-1 "import test from \"./a.js\";\n\nfunction foo(abc: test.testInterface, def: test.testInterface) {\n console.log(abc);\n console.log(def);\n}\n"
folder/c.ts
Part of 'files' list in tsconfig.json
File is CommonJS module because 'package.json' was not found
a.ts
Part of 'files' list in tsconfig.json
Imported via "./a.js" from file 'b.mts'
File is CommonJS module because 'package.json' was not found
b.mts
Part of 'files' list in tsconfig.json
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/home/src/workspaces/project/folder/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/workspaces/project/folder/folder/c.ts",
"configFile": "/home/src/workspaces/project/folder/tsconfig.json",
"diagnostics": [
{
"text": "File '/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts' not found.\n The file is in the program because:\n Default library for target 'esnext'",
"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] Project '/home/src/workspaces/project/folder/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/workspaces/project/folder/folder/c.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/folder/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 0,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
}
}
After Request
watchedFiles::
/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/package.json: *new*
{"pollingInterval":2000}
/home/src/workspaces/project/folder/a.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/folder/b.mts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/folder/folder/package.json: *new*
{"pollingInterval":2000}
/home/src/workspaces/project/folder/package.json: *new*
{"pollingInterval":2000}
/home/src/workspaces/project/folder/tsconfig.json: *new*
{"pollingInterval":2000}
/home/src/workspaces/project/package.json: *new*
{"pollingInterval":2000}
watchedDirectoriesRecursive::
/home/src/workspaces/node_modules/@types: *new*
{}
/home/src/workspaces/project/folder/node_modules/@types: *new*
{}
/home/src/workspaces/project/node_modules/@types: *new*
{}
Projects::
/home/src/workspaces/project/folder/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
autoImportProviderHost: false
ScriptInfos::
/home/src/workspaces/project/folder/a.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/folder/tsconfig.json
/home/src/workspaces/project/folder/b.mts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/folder/tsconfig.json
/home/src/workspaces/project/folder/folder/c.ts (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/workspaces/project/folder/tsconfig.json *default*
Info seq [hh:mm:ss:mss] request:
{
"seq": 1,
"type": "request",
"arguments": {
"formatOptions": {
"indentSize": 4,
"tabSize": 4,
"newLineCharacter": "\n",
"convertTabsToSpaces": true,
"indentStyle": 2,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true,
"indentSwitchCase": true
}
},
"command": "configure"
}
Info seq [hh:mm:ss:mss] Format host information updated
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "configure",
"request_seq": 1,
"success": true
}
Info seq [hh:mm:ss:mss] request:
{
"seq": 2,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/folder/c.ts",
"pastedText": [
"function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}"
],
"pasteLocations": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
}
}
],
"copiedFrom": {
"file": "/home/src/workspaces/project/folder/b.mts",
"spans": [
{
"start": {
"line": 3,
"offset": 1
},
"end": {
"line": 6,
"offset": 2
}
}
]
}
},
"command": "getPasteEdits"
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/folder/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/folder/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (3)
/home/src/workspaces/project/folder/folder/c.ts SVC-1-1 "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}"
/home/src/workspaces/project/folder/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}"
/home/src/workspaces/project/folder/b.mts Text-1 "import test from \"./a.js\";\n\nfunction foo(abc: test.testInterface, def: test.testInterface) {\n console.log(abc);\n console.log(def);\n}\n"
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "getPasteEdits",
"request_seq": 2,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
},
"body": {
"edits": [
{
"fileName": "/home/src/workspaces/project/folder/folder/c.ts",
"textChanges": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "import test from \"../a\";\n\n"
},
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}"
}
]
}
],
"fixId": "providePostPasteEdits"
}
}
After Request
Projects::
/home/src/workspaces/project/folder/tsconfig.json (Configured) *changed*
projectStateVersion: 3 *changed*
projectProgramVersion: 1
dirty: true *changed*
autoImportProviderHost: false
ScriptInfos::
/home/src/workspaces/project/folder/a.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/folder/tsconfig.json
/home/src/workspaces/project/folder/b.mts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/folder/tsconfig.json
/home/src/workspaces/project/folder/folder/c.ts (Open) *changed*
version: SVC-1-2 *changed*
containingProjects: 1
/home/src/workspaces/project/folder/tsconfig.json *default*

View File

@ -0,0 +1,372 @@
Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false
Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib
Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript
Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist
//// [/home/src/tslibs/TS/Lib/lib.d.ts]
lib.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts]
lib.decorators.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts]
lib.decorators.legacy.d.ts-Text
//// [/home/src/workspaces/project/a.ts]
const abc = 10;
const def = 20;
export interface testInterface {
abc: number;
def: number;
}
//// [/home/src/workspaces/project/b.ts]
import * as test from "./a";
function foo(abc: test.abc, def: test.def) {
console.log(abc);
console.log(def);
}
//// [/home/src/workspaces/project/folder/c.ts]
//// [/home/src/workspaces/project/tsconfig.json]
{ "files": ["folder/c.ts", "a.ts", "b.ts"] }
Info seq [hh:mm:ss:mss] request:
{
"seq": 0,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.ts"
},
"command": "open"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : {
"rootNames": [
"/home/src/workspaces/project/folder/c.ts",
"/home/src/workspaces/project/a.ts",
"/home/src/workspaces/project/b.ts"
],
"options": {
"configFilePath": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json",
"reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.ts to open"
}
}
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/a.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/b.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.ts SVC-1-0 ""
/home/src/workspaces/project/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}"
/home/src/workspaces/project/b.ts Text-1 "import * as test from \"./a\";\n\nfunction foo(abc: test.abc, def: test.def) {\n console.log(abc);\n console.log(def);\n}\n"
../../tslibs/TS/Lib/lib.d.ts
Default library for target 'es5'
../../tslibs/TS/Lib/lib.decorators.d.ts
Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts'
../../tslibs/TS/Lib/lib.decorators.legacy.d.ts
Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts'
folder/c.ts
Part of 'files' list in tsconfig.json
a.ts
Part of 'files' list in tsconfig.json
Imported via "./a" from file 'b.ts'
b.ts
Part of 'files' list in tsconfig.json
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/workspaces/project/folder/c.ts",
"configFile": "/home/src/workspaces/project/tsconfig.json",
"diagnostics": []
}
}
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.ts ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 0,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
}
}
After Request
watchedFiles::
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/a.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/b.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/tsconfig.json: *new*
{"pollingInterval":2000}
watchedDirectoriesRecursive::
/home/src/workspaces/node_modules: *new*
{}
/home/src/workspaces/node_modules/@types: *new*
{}
/home/src/workspaces/project/node_modules: *new*
{}
/home/src/workspaces/project/node_modules/@types: *new*
{}
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/a.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/b.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.ts (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*
Info seq [hh:mm:ss:mss] request:
{
"seq": 1,
"type": "request",
"arguments": {
"formatOptions": {
"indentSize": 4,
"tabSize": 4,
"newLineCharacter": "\n",
"convertTabsToSpaces": true,
"indentStyle": 2,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true,
"indentSwitchCase": true
}
},
"command": "configure"
}
Info seq [hh:mm:ss:mss] Format host information updated
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "configure",
"request_seq": 1,
"success": true
}
Info seq [hh:mm:ss:mss] request:
{
"seq": 2,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.ts",
"pastedText": [
"function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}"
],
"pasteLocations": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
}
}
],
"copiedFrom": {
"file": "/home/src/workspaces/project/b.ts",
"spans": [
{
"start": {
"line": 3,
"offset": 1
},
"end": {
"line": 6,
"offset": 2
}
}
]
}
},
"command": "getPasteEdits"
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.ts SVC-1-1 "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}"
/home/src/workspaces/project/a.ts Text-1 "const abc = 10;\nconst def = 20;\nexport interface testInterface {\n abc: number;\n def: number;\n}"
/home/src/workspaces/project/b.ts Text-1 "import * as test from \"./a\";\n\nfunction foo(abc: test.abc, def: test.def) {\n console.log(abc);\n console.log(def);\n}\n"
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "getPasteEdits",
"request_seq": 2,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
},
"body": {
"edits": [
{
"fileName": "/home/src/workspaces/project/folder/c.ts",
"textChanges": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "import * as test from \"../a\";\n\n"
},
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "function foo(abc: test.abc, def: test.def) {\nconsole.log(abc);\nconsole.log(def);\n}"
}
]
}
],
"fixId": "providePostPasteEdits"
}
}
After Request
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *changed*
projectStateVersion: 3 *changed*
projectProgramVersion: 1
dirty: true *changed*
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/a.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/b.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.ts (Open) *changed*
version: SVC-1-2 *changed*
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*

View File

@ -0,0 +1,377 @@
Info seq [hh:mm:ss:mss] currentDirectory:: /home/src/Vscode/Projects/bin useCaseSensitiveFileNames:: false
Info seq [hh:mm:ss:mss] libs Location:: /home/src/tslibs/TS/Lib
Info seq [hh:mm:ss:mss] globalTypingsCacheLocation:: /home/src/Library/Caches/typescript
Info seq [hh:mm:ss:mss] Provided types map file "/home/src/tslibs/TS/Lib/typesMap.json" doesn't exist
//// [/home/src/tslibs/TS/Lib/lib.d.ts]
lib.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.d.ts]
lib.decorators.d.ts-Text
//// [/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts]
lib.decorators.legacy.d.ts-Text
//// [/home/src/workspaces/project/b.jsx]
import React = require("./react");
class MyComponent extends React.Component {
render() {
return <div />;
}
}
//// [/home/src/workspaces/project/folder/c.jsx]
//// [/home/src/workspaces/project/react.d.ts]
export = React;
export as namespace React;
declare namespace React {
class Component {}
}
//// [/home/src/workspaces/project/tsconfig.json]
{ "files": ["folder/c.jsx", "react.d.ts", "b.jsx"] }
Info seq [hh:mm:ss:mss] request:
{
"seq": 0,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.jsx"
},
"command": "open"
}
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/c.jsx ProjectRootPath: undefined:: Result: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Creating ConfiguredProject: /home/src/workspaces/project/tsconfig.json, currentDirectory: /home/src/workspaces/project
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/tsconfig.json 2000 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Config file
Info seq [hh:mm:ss:mss] Config: /home/src/workspaces/project/tsconfig.json : {
"rootNames": [
"/home/src/workspaces/project/folder/c.jsx",
"/home/src/workspaces/project/react.d.ts",
"/home/src/workspaces/project/b.jsx"
],
"options": {
"configFilePath": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingStart",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json",
"reason": "Creating possible configured project for /home/src/workspaces/project/folder/c.jsx to open"
}
}
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/react.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/b.jsx 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts 500 undefined WatchType: Closed Script info
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/node_modules/@types 1 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Type roots
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.jsx SVC-1-0 ""
/home/src/workspaces/project/react.d.ts Text-1 "export = React;\nexport as namespace React;\ndeclare namespace React {\n class Component {}\n}"
/home/src/workspaces/project/b.jsx Text-1 "import React = require(\"./react\");\n\nclass MyComponent extends React.Component {\n render() {\n return <div />;\n }\n}"
../../tslibs/TS/Lib/lib.d.ts
Default library for target 'es5'
../../tslibs/TS/Lib/lib.decorators.d.ts
Library referenced via 'decorators' from file '../../tslibs/TS/Lib/lib.d.ts'
../../tslibs/TS/Lib/lib.decorators.legacy.d.ts
Library referenced via 'decorators.legacy' from file '../../tslibs/TS/Lib/lib.d.ts'
folder/c.jsx
Part of 'files' list in tsconfig.json
react.d.ts
Part of 'files' list in tsconfig.json
Imported via "./react" from file 'b.jsx'
b.jsx
Part of 'files' list in tsconfig.json
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "projectLoadingFinish",
"body": {
"projectName": "/home/src/workspaces/project/tsconfig.json"
}
}
Info seq [hh:mm:ss:mss] event:
{
"seq": 0,
"type": "event",
"event": "configFileDiag",
"body": {
"triggerFile": "/home/src/workspaces/project/folder/c.jsx",
"configFile": "/home/src/workspaces/project/tsconfig.json",
"diagnostics": []
}
}
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /home/src/workspaces/project/folder/c.jsx ProjectRootPath: undefined
Info seq [hh:mm:ss:mss] Projects: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "open",
"request_seq": 0,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
}
}
After Request
watchedFiles::
/home/src/tslibs/TS/Lib/lib.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.d.ts: *new*
{"pollingInterval":500}
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/b.jsx: *new*
{"pollingInterval":500}
/home/src/workspaces/project/react.d.ts: *new*
{"pollingInterval":500}
/home/src/workspaces/project/tsconfig.json: *new*
{"pollingInterval":2000}
watchedDirectories::
/home/src/workspaces/project: *new*
{}
watchedDirectoriesRecursive::
/home/src/workspaces/node_modules: *new*
{}
/home/src/workspaces/node_modules/@types: *new*
{}
/home/src/workspaces/project/node_modules: *new*
{}
/home/src/workspaces/project/node_modules/@types: *new*
{}
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *new*
projectStateVersion: 1
projectProgramVersion: 1
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/b.jsx *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.jsx (Open) *new*
version: SVC-1-0
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*
/home/src/workspaces/project/react.d.ts *new*
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] request:
{
"seq": 1,
"type": "request",
"arguments": {
"formatOptions": {
"indentSize": 4,
"tabSize": 4,
"newLineCharacter": "\n",
"convertTabsToSpaces": true,
"indentStyle": 2,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"semicolons": "ignore",
"trimTrailingWhitespace": true,
"indentSwitchCase": true
}
},
"command": "configure"
}
Info seq [hh:mm:ss:mss] Format host information updated
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "configure",
"request_seq": 1,
"success": true
}
Info seq [hh:mm:ss:mss] request:
{
"seq": 2,
"type": "request",
"arguments": {
"file": "/home/src/workspaces/project/folder/c.jsx",
"pastedText": [
"class MyComponent extends React.Component {\n render() {\n return <div />;\n }\n}"
],
"pasteLocations": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
}
}
],
"copiedFrom": {
"file": "/home/src/workspaces/project/b.jsx",
"spans": [
{
"start": {
"line": 3,
"offset": 1
},
"end": {
"line": 7,
"offset": 2
}
}
]
}
},
"command": "getPasteEdits"
}
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json
Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms
Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured)
Info seq [hh:mm:ss:mss] Files (6)
/home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text
/home/src/workspaces/project/folder/c.jsx SVC-1-1 "class MyComponent extends React.Component {\n render() {\n return <div />;\n }\n}"
/home/src/workspaces/project/react.d.ts Text-1 "export = React;\nexport as namespace React;\ndeclare namespace React {\n class Component {}\n}"
/home/src/workspaces/project/b.jsx Text-1 "import React = require(\"./react\");\n\nclass MyComponent extends React.Component {\n render() {\n return <div />;\n }\n}"
Info seq [hh:mm:ss:mss] -----------------------------------------------
Info seq [hh:mm:ss:mss] response:
{
"seq": 0,
"type": "response",
"command": "getPasteEdits",
"request_seq": 2,
"success": true,
"performanceData": {
"updateGraphDurationMs": *
},
"body": {
"edits": [
{
"fileName": "/home/src/workspaces/project/folder/c.jsx",
"textChanges": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "const React = require(\"../react\");\n\n"
},
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "class MyComponent extends React.Component {\n render() {\n return <div />;\n }\n}"
}
]
}
],
"fixId": "providePostPasteEdits"
}
}
After Request
Projects::
/home/src/workspaces/project/tsconfig.json (Configured) *changed*
projectStateVersion: 3 *changed*
projectProgramVersion: 1
dirty: true *changed*
autoImportProviderHost: false
ScriptInfos::
/home/src/tslibs/TS/Lib/lib.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/b.jsx
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json
/home/src/workspaces/project/folder/c.jsx (Open) *changed*
version: SVC-1-2 *changed*
containingProjects: 1
/home/src/workspaces/project/tsconfig.json *default*
/home/src/workspaces/project/react.d.ts
version: Text-1
containingProjects: 1
/home/src/workspaces/project/tsconfig.json

View File

@ -0,0 +1,33 @@
/// <reference path='fourslash.ts' />
// @Filename: /a.ts
//// export type ExecutionPoint = string;
////
// @Filename: /b.ts
//// import * as A from "./a";
////
//// [|async function fn1(point: A.ExecutionPoint) {}|]
////
//// async function fn2(point: A.ExecutionPoint) {}
////
// @Filename: /point.ts
////
verify.moveToFile({
newFileContents: {
"/b.ts":
`import * as A from "./a";
async function fn2(point: A.ExecutionPoint) {}
`,
"/point.ts":
`import * as A from "./a";
async function fn1(point: A.ExecutionPoint) { }
`,
},
interactiveRefactorArguments: { targetFile: "/point.ts" },
});

View File

@ -0,0 +1,35 @@
/// <reference path='fourslash.ts' />
// @Filename: /node_modules/use-react/index.d.ts
///// export { default as useLatest } from './useLatest';
// @Filename: /node_modules/use-react/index.d.ts
//// declare const useLatest: <T>(value: T) => {
//// readonly current: T;
//// };
//// export default useLatest;
////
// @Filename: /test.ts
//// import { useLatest } from 'react-use';
////
//// [|export function useUseLatest(data: string) {
//// return useLatest(data);
//// }|]
verify.moveToNewFile({
newFileContents: {
"/test.ts":
`
`,
"/useUseLatest.ts":
`import { useLatest } from 'react-use';
export function useUseLatest(data: string) {
return useLatest(data);
}
`,
},
});

View File

@ -0,0 +1,25 @@
/// <reference path='fourslash.ts' />
// @module: esnext
// @filename: /a.ts
////export interface A {}
// @filename: /b.ts
////export * as A from "./a";
////export type B = string
// @filename: /c.ts
////import { A } from "./b"
////[|type B = A.B|]
verify.moveToNewFile({
newFileContents: {
"/c.ts": '',
"/B.1.ts":
`import { A } from "./a";
type B = A.B;
`,
},
});

View File

@ -0,0 +1,39 @@
// @filename: /src/test.ts
//// import type * as ambient from "ambient";
////
//// [|export class Yadda {
//// foo(): ambient.Thing {
//// throw new Error("not implemented");
//// }
////
//// bar(): ambient.DoesNotExist {
//// throw new Error("not implemented");
//// }
//// }|]
// @filename: /src/globals.ts
//// declare module "ambient" {
//// export interface Thing {}
//// }
verify.moveToNewFile({
newFileContents: {
"/src/test.ts":
`
`,
"/src/Yadda.ts":
`import type * as ambient from "ambient";
export class Yadda {
foo(): ambient.Thing {
throw new Error("not implemented");
}
bar(): ambient.DoesNotExist {
throw new Error("not implemented");
}
}
`
}
});

View File

@ -0,0 +1,41 @@
/// <reference path='fourslash.ts' />
// @jsx: react
// @module: esnext
// @target: es2020
// @moduleResolution: bundler
// @Filename: /node_modules/react/index.d.ts
//// export = React;
//// export as namespace React;
//// declare namespace React {
//// class Component<P, S> {}
//// }
// @Filename: /src/main.tsx
//// import React from "react";
////
//// [|class MyComponent extends React.Component {
//// render() {
//// return <div />;
//// }
//// }|]
// this test only crashes with bundler and non-preserve
verify.moveToNewFile({
newFileContents: {
"/src/main.tsx":
`
`,
"/src/MyComponent.tsx":
`import React from "react";
class MyComponent extends React.Component {
render() {
return <div />;
}
}
`
}
});

View File

@ -0,0 +1,44 @@
/// <reference path='fourslash.ts' />
// @jsx: preserve
// @Filename: /node_modules/react/index.d.ts
////export = React;
////export as namespace React;
////declare namespace React {
//// class Component {}
////}
// @Filename: /src/main.tsx
//// import * as React from 'react';
////
//// export const main = () => {};
////
//// [|interface SProps {
//// children: string;
//// }
////
//// function SidebarSection({children}: SProps) {
//// return <div>{children}</div>;
//// }|]
verify.moveToNewFile({
newFileContents: {
"/src/main.tsx":
`
export const main = () => {};
`,
"/src/SProps.tsx":
`import * as React from 'react';
interface SProps {
children: string;
}
function SidebarSection({ children }: SProps) {
return <div>{children}</div>;
}
`
}
});

View File

@ -1,6 +1,6 @@
/// <reference path="../fourslash.ts" />
// @Filename: /home/src/workspaces/project/c.ts
// @Filename: /home/src/workspaces/project/folder/c.ts
////[||]
// @Filename: /home/src/workspaces/project/a.ts
@ -15,7 +15,7 @@
//// console.log("abc");
// @Filename: /home/src/workspaces/project/tsconfig.json
////{ "files": ["c.ts", "a.ts", "b.ts"] }
////{ "files": ["folder/c.ts", "a.ts", "b.ts"] }
const ranges = test.ranges();
verify.pasteEdits({
@ -25,8 +25,8 @@ verify.pasteEdits({
copiedFrom: { file: "/home/src/workspaces/project/b.ts", range: [ranges[1]] },
},
newFileContents: {
"/home/src/workspaces/project/c.ts":
`import { abc } from "./a";
"/home/src/workspaces/project/folder/c.ts":
`import { abc } from "../a";
console.log(abc);`
}

View File

@ -0,0 +1,31 @@
/// <reference path="../fourslash.ts" />
// @Filename: /home/src/workspaces/project/folder/c.ts
////[||]
// @Filename: /home/src/workspaces/project/b.ts
////import foo from "./a";
////[|const b = foo("bar");|]
// @Filename: /home/src/workspaces/project/a.ts
//// export default function foo(name: string): void {
//// console.log(name);
//// }
// @Filename: /home/src/workspaces/project/tsconfig.json
////{ "files": ["folder/c.ts", "a.ts", "b.ts"] }
const range = test.ranges();
verify.pasteEdits({
args: {
pastedText: [`const b = foo("bar");`],
pasteLocations: [range[0]],
copiedFrom: { file: "/home/src/workspaces/project/b.ts", range: [range[1]] },
},
newFileContents: {
"/home/src/workspaces/project/folder/c.ts":
`import foo from "../a";
const b = foo("bar");`
}
});

View File

@ -0,0 +1,28 @@
/// <reference path="../fourslash.ts" />
// @Filename: /home/src/workspaces/project/folder/c.ts
////[||]
// @Filename: /home/src/workspaces/project/a.ts
////[|const b = foo("bar");|]
//// export default function foo(name: string): void {
//// console.log(name);
//// }
// @Filename: /home/src/workspaces/project/tsconfig.json
////{ "files": ["folder/c.ts", "a.ts"] }
const range = test.ranges();
verify.pasteEdits({
args: {
pastedText: [`const b = foo("bar");`],
pasteLocations: [range[0]],
copiedFrom: { file: "/home/src/workspaces/project/a.ts", range: [range[1]] },
},
newFileContents: {
"/home/src/workspaces/project/folder/c.ts":
`import foo from "../a";
const b = foo("bar");`
}
});

View File

@ -0,0 +1,45 @@
/// <reference path="../fourslash.ts" />
// @Filename: /home/src/workspaces/project/folder/folder/c.ts
//// [||]
// @Filename: /home/src/workspaces/project/folder/b.mts
//// import test from "./a.js";
////
//// [|function foo(abc: test.testInterface, def: test.testInterface) {
//// console.log(abc);
//// console.log(def);
//// }|]
////
// @Filename: /home/src/workspaces/project/folder/a.ts
//// const abc = 10;
//// const def = 20;
//// export interface testInterface {
//// abc: number;
//// def: number;
//// }
// @Filename: /home/src/workspaces/project/folder/tsconfig.json
////{ "compilerOptions": { "module": "nodenext" }, "files": ["folder/c.ts", "a.ts", "b.mts"] }
const range = test.ranges();
verify.pasteEdits({
args: {
pastedText: [`function foo(abc: test.abc, def: test.def) {
console.log(abc);
console.log(def);
}`],
pasteLocations: [range[0]],
copiedFrom: { file: "/home/src/workspaces/project/folder/b.mts", range: [range[1]] },
},
newFileContents: {
"/home/src/workspaces/project/folder/folder/c.ts":
`import test from "../a";
function foo(abc: test.abc, def: test.def) {
console.log(abc);
console.log(def);
}`
}
});

View File

@ -0,0 +1,46 @@
/// <reference path="../fourslash.ts" />
// @Filename: /home/src/workspaces/project/folder/c.ts
//// [||]
// @Filename: /home/src/workspaces/project/a.ts
//// const abc = 10;
//// const def = 20;
//// export interface testInterface {
//// abc: number;
//// def: number;
//// }
// @Filename: /home/src/workspaces/project/b.ts
//// import * as test from "./a";
////
//// [|function foo(abc: test.abc, def: test.def) {
//// console.log(abc);
//// console.log(def);
//// }|]
////
// @Filename: /home/src/workspaces/project/tsconfig.json
////{ "files": ["folder/c.ts", "a.ts", "b.ts"] }
const range = test.ranges();
verify.pasteEdits({
args: {
pastedText: [`function foo(abc: test.abc, def: test.def) {
console.log(abc);
console.log(def);
}`],
pasteLocations: [range[0]],
copiedFrom: { file: "/home/src/workspaces/project/b.ts", range: [range[1]] },
},
newFileContents: {
"/home/src/workspaces/project/folder/c.ts":
`import * as test from "../a";
function foo(abc: test.abc, def: test.def) {
console.log(abc);
console.log(def);
}`
}
});

View File

@ -0,0 +1,47 @@
/// <reference path="../fourslash.ts" />
// @Filename: /home/src/workspaces/project/folder/c.jsx
//// [||]
// @Filename: /home/src/workspaces/project/b.jsx
//// import React = require("./react");
////
//// [|class MyComponent extends React.Component {
//// render() {
//// return <div />;
//// }
//// }|]
// @Filename: /home/src/workspaces/project/react.d.ts
////export = React;
////export as namespace React;
////declare namespace React {
//// class Component {}
////}
// @Filename: /home/src/workspaces/project/tsconfig.json
////{ "files": ["folder/c.jsx", "react.d.ts", "b.jsx"] }
const range = test.ranges();
verify.pasteEdits({
args: {
pastedText:
[`class MyComponent extends React.Component {
render() {
return <div />;
}
}`],
pasteLocations: [range[0]],
copiedFrom: { file: "/home/src/workspaces/project/b.jsx", range: [range[1]] },
},
newFileContents: {
"/home/src/workspaces/project/folder/c.jsx":
`const React = require("../react");
class MyComponent extends React.Component {
render() {
return <div />;
}
}`
}
});