-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Fixing exception on unsaved file #60362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
248 changes: 248 additions & 0 deletions
248
tests/baselines/reference/tsserver/pasteEdits/should-not-error.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,248 @@ | ||
| 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 | ||
| Before request | ||
| //// [/home/src/projects/project/file1.ts] | ||
| export const r = 1; | ||
| console.log(r); | ||
|
|
||
| //// [/home/src/projects/project/tsconfig.json] | ||
| {} | ||
|
|
||
| //// [/home/src/tslibs/TS/Lib/lib.d.ts] | ||
| /// <reference no-default-lib="true"/> | ||
| interface Boolean {} | ||
| interface Function {} | ||
| interface CallableFunction {} | ||
| interface NewableFunction {} | ||
| interface IArguments {} | ||
| interface Number { toExponential: any; } | ||
| interface Object {} | ||
| interface RegExp {} | ||
| interface String { charAt: any; } | ||
| interface Array<T> { length: number; [n: number]: T; } | ||
| interface ReadonlyArray<T> {} | ||
| declare const console: { log(msg: any): void; }; | ||
|
|
||
|
|
||
| Info seq [hh:mm:ss:mss] request: | ||
| { | ||
| "command": "updateOpen", | ||
| "arguments": { | ||
| "changedFiles": [], | ||
| "closedFiles": [], | ||
| "openFiles": [ | ||
| { | ||
| "file": "^/untitled/ts-nul-authority/Untitled-1", | ||
| "fileContent": "function foo(){}\r\n \r\n", | ||
| "scriptKindName": "TS" | ||
| } | ||
| ] | ||
| }, | ||
| "seq": 1, | ||
| "type": "request" | ||
| } | ||
| Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: ^/untitled/ts-nul-authority/Untitled-1 ProjectRootPath: undefined:: Result: undefined | ||
| Info seq [hh:mm:ss:mss] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /home/src/Vscode/Projects/bin | ||
| Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* | ||
| 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/Vscode/Projects/bin/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots | ||
| Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/Projects/bin/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots | ||
| Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/Projects/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots | ||
| Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/Projects/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots | ||
| Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots | ||
| Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Vscode/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots | ||
| 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 (2) | ||
| /home/src/tslibs/TS/Lib/lib.d.ts Text-1 "/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };" | ||
| ^/untitled/ts-nul-authority/Untitled-1 SVC-1-0 "function foo(){}\r\n \r\n" | ||
|
|
||
|
|
||
| ../../../tslibs/TS/Lib/lib.d.ts | ||
| Default library for target 'es5' | ||
| ^/untitled/ts-nul-authority/Untitled-1 | ||
| Root file specified for compilation | ||
|
|
||
| Info seq [hh:mm:ss:mss] ----------------------------------------------- | ||
| Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) | ||
| Info seq [hh:mm:ss:mss] Files (2) | ||
|
|
||
| Info seq [hh:mm:ss:mss] ----------------------------------------------- | ||
| Info seq [hh:mm:ss:mss] Open files: | ||
| Info seq [hh:mm:ss:mss] FileName: ^/untitled/ts-nul-authority/Untitled-1 ProjectRootPath: undefined | ||
| Info seq [hh:mm:ss:mss] Projects: /dev/null/inferredProject1* | ||
| Info seq [hh:mm:ss:mss] response: | ||
| { | ||
| "response": true, | ||
| "responseRequired": true, | ||
| "performanceData": { | ||
| "updateGraphDurationMs": * | ||
| } | ||
| } | ||
| After request | ||
|
|
||
| PolledWatches:: | ||
| /home/src/Vscode/Projects/bin/node_modules/@types: *new* | ||
| {"pollingInterval":500} | ||
| /home/src/Vscode/Projects/node_modules/@types: *new* | ||
| {"pollingInterval":500} | ||
| /home/src/Vscode/node_modules/@types: *new* | ||
| {"pollingInterval":500} | ||
|
|
||
| FsWatches:: | ||
| /home/src/tslibs/TS/Lib/lib.d.ts: *new* | ||
| {} | ||
|
|
||
| Projects:: | ||
| /dev/null/inferredProject1* (Inferred) *new* | ||
| projectStateVersion: 1 | ||
| projectProgramVersion: 1 | ||
| autoImportProviderHost: false | ||
|
|
||
| ScriptInfos:: | ||
| /home/src/tslibs/TS/Lib/lib.d.ts *new* | ||
| version: Text-1 | ||
| containingProjects: 1 | ||
| /dev/null/inferredProject1* | ||
| ^/untitled/ts-nul-authority/Untitled-1 (Dynamic) (Open) *new* | ||
| version: SVC-1-0 | ||
| containingProjects: 1 | ||
| /dev/null/inferredProject1* *default* | ||
|
|
||
| Before request | ||
|
|
||
| Info seq [hh:mm:ss:mss] request: | ||
| { | ||
| "command": "getPasteEdits", | ||
| "arguments": { | ||
| "file": "^/untitled/ts-nul-authority/Untitled-1", | ||
| "pastedText": [ | ||
| "console.log(r);" | ||
| ], | ||
| "pasteLocations": [ | ||
| { | ||
| "start": { | ||
| "line": 1, | ||
| "offset": 0 | ||
| }, | ||
| "end": { | ||
| "line": 1, | ||
| "offset": 0 | ||
| } | ||
| } | ||
| ], | ||
| "copiedFrom": { | ||
| "file": "/home/src/projects/project/file1.ts", | ||
| "spans": [ | ||
| { | ||
| "start": { | ||
| "line": 2, | ||
| "offset": 0 | ||
| }, | ||
| "end": { | ||
| "line": 2, | ||
| "offset": 13 | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "seq": 2, | ||
| "type": "request" | ||
| } | ||
| Info seq [hh:mm:ss:mss] response: | ||
| { | ||
| "responseRequired": true | ||
| } | ||
| After request | ||
|
|
||
| Before request | ||
|
|
||
| Info seq [hh:mm:ss:mss] request: | ||
| { | ||
| "command": "geterr", | ||
| "arguments": { | ||
| "delay": 0, | ||
| "files": [ | ||
| "^/untitled/ts-nul-authority/Untitled-1" | ||
| ] | ||
| }, | ||
| "seq": 3, | ||
| "type": "request" | ||
| } | ||
| After request | ||
|
|
||
| Timeout callback:: count: 1 | ||
| 1: checkOne *new* | ||
|
|
||
| Before running Timeout callback:: count: 1 | ||
| 1: checkOne | ||
|
|
||
| Info seq [hh:mm:ss:mss] event: | ||
| { | ||
| "seq": 0, | ||
| "type": "event", | ||
| "event": "syntaxDiag", | ||
| "body": { | ||
| "file": "^/untitled/ts-nul-authority/Untitled-1", | ||
| "diagnostics": [] | ||
| } | ||
| } | ||
| After running Timeout callback:: count: 0 | ||
|
|
||
| Immedidate callback:: count: 1 | ||
| 1: semanticCheck *new* | ||
|
|
||
| Before running Immedidate callback:: count: 1 | ||
| 1: semanticCheck | ||
|
|
||
| Info seq [hh:mm:ss:mss] event: | ||
| { | ||
| "seq": 0, | ||
| "type": "event", | ||
| "event": "semanticDiag", | ||
| "body": { | ||
| "file": "^/untitled/ts-nul-authority/Untitled-1", | ||
| "diagnostics": [] | ||
| } | ||
| } | ||
| After running Immedidate callback:: count: 1 | ||
|
|
||
| Immedidate callback:: count: 1 | ||
| 2: suggestionCheck *new* | ||
|
|
||
| Before running Immedidate callback:: count: 1 | ||
| 2: suggestionCheck | ||
|
|
||
| Info seq [hh:mm:ss:mss] event: | ||
| { | ||
| "seq": 0, | ||
| "type": "event", | ||
| "event": "suggestionDiag", | ||
| "body": { | ||
| "file": "^/untitled/ts-nul-authority/Untitled-1", | ||
| "diagnostics": [] | ||
| } | ||
| } | ||
| Info seq [hh:mm:ss:mss] event: | ||
| { | ||
| "seq": 0, | ||
| "type": "event", | ||
| "event": "requestCompleted", | ||
| "body": { | ||
| "request_seq": 3, | ||
| "performanceData": { | ||
| "diagnosticsDuration": [ | ||
| { | ||
| "syntaxDiag": *, | ||
| "semanticDiag": *, | ||
| "suggestionDiag": *, | ||
| "file": "^/untitled/ts-nul-authority/Untitled-1" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| After running Immedidate callback:: count: 0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
isDynamicFileNameinstead