Skip to content

Implements Balanced Bracket Pair Delete #134371

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hediet
Copy link
Member

@hediet hediet commented Oct 4, 2021

This PR fixes #133663

Unfortunately, this code throws when deleting a bracket pair:

 ERR Cannot read property 'push' of undefined: TypeError: Cannot read property 'push' of undefined
    at vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/controller/cursor.js:644:71
    at Function._computeCursorState (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/model/editStack.js:365:46)
    at EditStack.pushEditOperation (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/model/editStack.js:352:48)
    at TextModel._pushEditOperations (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/model/textModel.js:1041:41)
    at TextModel.pushEditOperations (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/model/textModel.js:963:29)
    at Function._innerExecuteCommands (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/controller/cursor.js:634:45)
    at Function.executeCommands (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/controller/cursor.js:601:33)
    at CursorsController._executeEditOperation (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/controller/cursor.js:366:44)
    at vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/controller/cursor.js:584:22
    at CursorsController._executeEdit (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/controller/cursor.js:497:17)
    at CursorsController.executeCommands (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/controller/cursor.js:583:18)
    at vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/viewModel/viewModelImpl.js:814:69
    at ViewModel._withViewEventsCollector (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/viewModel/viewModelImpl.js:863:17)
    at ViewModel._executeCursorEdit (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/viewModel/viewModelImpl.js:785:18)
    at ViewModel.executeCommands (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/common/viewModel/viewModelImpl.js:814:18)
    at CodeEditorWidget.executeCommands (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/browser/widget/codeEditorWidget.js:822:39)
    at DeleteWordLeft.runEditorCommand (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/contrib/wordOperations/wordOperations.js:304:20)
    at vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/browser/editorExtensions.js:158:29
    at InstantiationService.invokeFunction (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/platform/instantiation/common/instantiationService.js:44:24)
    at CodeEditorWidget.invokeWithinContext (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/browser/widget/codeEditorWidget.js:206:47)
    at DeleteWordLeft.runCommand (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/browser/editorExtensions.js:152:27)
    at handler (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/editor/browser/editorExtensions.js:52:51)
    at InstantiationService.invokeFunction (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/platform/instantiation/common/instantiationService.js:44:24)
    at CommandService._tryExecuteCommand (vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/workbench/services/commands/common/commandService.js:74:59)
    at vscode-file://vscode-app/c:/dev/microsoft/vscode/out/vs/workbench/services/commands/common/commandService.js:64:47

@hediet hediet self-assigned this Oct 4, 2021
@hediet hediet force-pushed the hediet/balanced-bracket-delete branch from 4355651 to 4cd3de0 Compare November 3, 2021 13:20
@hediet hediet force-pushed the hediet/balanced-bracket-delete branch from 4cd3de0 to 690891b Compare November 3, 2021 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Balanced bracket delete
1 participant