-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
π Search Terms
- Copilot
π Version & Regression Information
5.7.0-dev.20240927, not a regression
β― Playground Link
No response
π» Code
Using copilot in VS Code:
- Add this selection to panel chat https://github.com/microsoft/vscode/blob/d085816005ae61fc8f39b3720b3ec4594b35ecd0/src/vs/base/common/async.ts#L1145-L1278.
- Have this be your current selection https://github.com/microsoft/vscode/blob/d085816005ae61fc8f39b3720b3ec4594b35ecd0/src/vs/base/test/common/async.test.ts#L1523-L1554
- As
@workspace /tests The last work call has a delay of 51 ms, but I already waited out the throttle delay why is this and how do I fix it. - π The TS Server crashes
π Actual behavior
As the result is streaming back, we get a crash:
Err 55338 [09:24:42.710] Exception on executing command {
"seq": 18117,
"type": "request",
"command": "updateOpen",
"arguments": {
"changedFiles": [
{
"fileName": "^/vscode-chat-code-block/ts-nul-authority/Users/matb/projects/vscode/src/vs/base/test/common/async.test.ts",
"textChanges": [
{
"newText": "",
"start": {
"line": 1503,
"offset": 1
},
"end": {
"line": 1503,
"offset": 42
}
}
]
}
],
"closedFiles": [],
"openFiles": []
}
}:
Cannot read properties of undefined (reading 'charCount')
TypeError: Cannot read properties of undefined (reading 'charCount')
at _LineNode.walk (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:194903:30)
at _LineIndex.edit (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:194803:17)
at _ScriptVersionCache._getSnapshot (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:194609:31)
at _ScriptVersionCache.lineOffsetToPosition (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:194628:17)
at TextStorage.lineOffsetToPosition (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:184011:22)
at ScriptInfo.lineOffsetToPosition (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:184319:29)
at /Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:191473:40
at mapDefinedIterator (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:2602:19)
at mapDefinedIterator.next (<anonymous>)
at _ProjectService.applyChangesToFile (/Users/matb/projects/vscode/node_modules/typescript/lib/typescript.js:190256:16)
The crash seems to happen during response streaming. During this, code blocks may be updated multiple times and the code in them may not be complete
π Expected behavior
No crash
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue