-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
fix paste edits range: include all completely selected identifiers #60339
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 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 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 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
317 changes: 317 additions & 0 deletions
317
tests/baselines/reference/tsserver/fourslashServer/pasteEdits_rangeSelection0.js
This file contains 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,317 @@ | ||
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] | ||
function foo() { } | ||
const x = foo() | ||
|
||
foo() | ||
x | ||
|
||
//// [/home/src/workspaces/project/folder/target.ts] | ||
|
||
|
||
//// [/home/src/workspaces/project/tsconfig.json] | ||
{ "files": ["a.ts", "folder/target.ts"] } | ||
|
||
|
||
Info seq [hh:mm:ss:mss] request: | ||
{ | ||
"seq": 0, | ||
"type": "request", | ||
"arguments": { | ||
"file": "/home/src/workspaces/project/folder/target.ts" | ||
}, | ||
"command": "open" | ||
} | ||
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /home/src/workspaces/project/folder/target.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/a.ts", | ||
"/home/src/workspaces/project/folder/target.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/target.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/a.ts Text-1 "function foo() { }\nconst x = foo()\n\nfoo()\nx" | ||
/home/src/workspaces/project/folder/target.ts SVC-1-0 "" | ||
|
||
|
||
../../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' | ||
a.ts | ||
Part of 'files' list in tsconfig.json | ||
folder/target.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/target.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/target.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/target.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/target.ts", | ||
"pastedText": [ | ||
"" | ||
], | ||
"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": 1 | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"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/a.ts Text-1 "function foo() { }\nconst x = foo()\n\nfoo()\nx" | ||
/home/src/workspaces/project/folder/target.ts SVC-1-1 "" | ||
|
||
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": [], | ||
"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/target.ts (Open) *changed* | ||
version: SVC-1-2 *changed* | ||
containingProjects: 1 | ||
/home/src/workspaces/project/tsconfig.json *default* |
Oops, something went wrong.
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.
This should be jsdoc. At least, it seems like the comments are intended for callers of the function.