Skip to content
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

Cannot read property 'start' of undefined: TypeError: Cannot read property 'start' of undefined #99410

Closed
StephenWeatherford opened this issue Jun 4, 2020 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-code-actions Editor inplace actions (Ctrl + .) help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@StephenWeatherford
Copy link

Issue Type: Bug

Seeing this frequently in my pipeline builds (e.g. https://dev.azure.com/ms-azuretools/AzCode/_build/results?buildId=20513&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=95359773-9cfc-583f-7b87-0a0d44ca7da9&l=769). Have occasionally see it locally, but don't have a repro scenaro.

Pretty sure this is not in my code.

VS Code version: Code - Insiders 1.46.0-insider (595d2b9, 2020-06-03T05:38:33.098Z)
OS version: Darwin x64 18.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 3
Memory (System) 16.00GB (0.67GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (11)
Extension Author (truncated) Version
vscode-azurestorage ms- 0.9.0
vscode-azurevirtualmachines ms- 0.1.0
vscode-cosmosdb ms- 0.13.0
vscode-docker ms- 1.2.1
csharp ms- 1.22.0
vscode-dotnet-runtime ms- 0.1.2
azure-account ms- 0.8.11
vscode-typescript-tslint-plugin ms- 1.2.3
vscode-yaml red 0.8.0
tmcolor sle 0.0.1
vscode-todo-highlight way 1.0.4
@StephenWeatherford
Copy link
Author

intersection(t){const i=v.Max(t.start,this._start)

@alexdima
Copy link
Member

if (ran.intersection(diagnostic.range)) {

@alexdima alexdima assigned mjbvz and unassigned alexdima Jun 22, 2020
@mjbvz mjbvz added editor-code-actions Editor inplace actions (Ctrl + .) bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Jun 22, 2020
@mjbvz mjbvz added this to the Backlog milestone Jun 23, 2020
@StephenWeatherford
Copy link
Author

Thanks for the pointer, allowed me to find the issue - our language server was returning some Diagnostics with a null Range. This wasn't a problem for publishing errors to the diagnostics collection, that code was tolerant of this and this code has been like this a long time.

What triggered the error is that we started implementing provideCodeActions in the TypeScript (completely separate from our language server, which is a C# LSP), and that code in vscode didn't handle the null ranges in the diagnostics collection. Seems like this could trip other extensions even...

I've fixed our code, but I recommend that you either sanitize the range when they're pushed to a diagnostics collection teach the code actions code to be tolerant of a null range. Thanks!

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 30, 2020

@sandy081 Assigning you since it sounds like we may want to validate diagnostics before adding them to the diagnostic collection

@sandy081 sandy081 assigned jrieken and unassigned sandy081 Jul 30, 2020
@sandy081
Copy link
Member

This seems to be in diagnostics API so moving to @jrieken

@jrieken jrieken modified the milestones: Backlog, August 2020 Aug 10, 2020
@mjbvz mjbvz removed their assignment Aug 11, 2020
@jrieken
Copy link
Member

jrieken commented Aug 12, 2020

creating diagnostics without range or message now throws a type error

@StephenWeatherford
Copy link
Author

Thx

@isidorn
Copy link
Contributor

isidorn commented Sep 3, 2020

Adding verified based on code review

@isidorn isidorn added the verified Verification succeeded label Sep 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-code-actions Editor inplace actions (Ctrl + .) help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@jrieken @isidorn @alexdima @StephenWeatherford @sandy081 @mjbvz and others