microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.73k stars 29.09k forks source link

Cannot read properties of undefined (reading 'getModelColumnOfViewPosition') #200117

Closed RedCMD closed 6 months ago

RedCMD commented 10 months ago

2nd time I got the error Cannot read properties of undefined (reading 'getModelColumnOfViewPosition')

has only happened twice both times it was when I ctrl+A ctrl+X all the code in a .tmLanguage.json file

Windows 11 x64 zip installation VSCode 1.8.4 stable

related: https://github.com/microsoft/vscode/issues/97449

mjbvz commented 10 months ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

If it does, please share the file which causes this

einarpersson commented 10 months ago

I just experienced this while doing a first test with Github Copilot inline chat refactorisation

  1. I selected a all lines in a typescript file (~19 LOC)
  2. I started an inline chat and asked it to refactor it to use proper functions instead of consts
  3. It started streaming correctly, but then got that error message (Cannot read properties of undefined (reading 'getModelColumnOfViewPosition')

This was repetable.

Interestingly, when I only selected the first 10 LOC it worked as expected.

Version: 1.85.0 (user setup)
Commit: af28b32d7e553898b2a91af498b1fb666fdebe0c
Date: 2023-12-06T20:48:09.019Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19044
Github Copilot v1.141.594 (pre-release)
mjbvz commented 10 months ago

Please share the TS code and copilot prompt you used

endomorphosis commented 10 months ago

I have experienced the same error under the same circumstances as mjbvz

hexrw commented 10 months ago

I recently ran into the same issue when asking Copilot to write a simple ETL script using TS and Node 20. Didn't resolve even when I disabled all other extensions. There's nothing in logs other than successful [fetchCompletions] requests

Prompt

Make this code take every file inside ../api/schemas/ (including nested files) and compile it using compileFromFile() and then write the result to a corresponding file in ../api/types overwriting if needed

Copilot

Environment

Feature Flags

Node setup

Network Configuration

Reachability

VS Code Configuration

Extensions

Tejareddy94 commented 9 months ago

I too got the same error for Github Co-pilot. It stopped generating the response with the below error

image

If i modify this prompt to "Convert to module" it generated the response.

FYI image

RoyPrinsGH commented 9 months ago

Same issue here. Only happens when I select all lines in a file and use CTRL + I to request an edit.

coffee-mug commented 9 months ago

Same issue here. What's strange is that the prompt worked fine for another file, that uses the same structure overall. Cannot share the prompt publicly as it uses some information from a database.

VeniVidiV1c1 commented 9 months ago

If this happens to anyone just restart the application it solves it everytime it appears for me

vscodenpa commented 6 months ago

Hey @alexdima, this issue might need further attention.

@RedCMD, you can help us out by closing this issue if the problem no longer exists, or adding more information.

vscodenpa commented 6 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!