-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Error: Debug Failure. False expression. in 'doChange' during 'getCodeFixes' #32856
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
Comments
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
Here's a repro // @noUnreachableCode: true
function foo() {
return 100;
foo/*cursor*/
} |
This issue reproduced in the following context:
|
@DanielRosenwasser where were you able to repro this? I can repro in the playground, but not in VS Code or fourslash 🤔 |
Same, I can't repro this locally, but it was happening at the time. Not sure what's up there. |
This issue reproduced in the following context:
|
By debugging the playground, I’ve determined that Monaco is calling the language service with a zero-length error span, which the checker does not produce. It looks like it’s trying to get code fixes at a certain position on every cursor change, not just when the cursor is within an existing error span. @orta do you know anything about this? This kind of request doesn’t repro for me in VS Code, so I’m not sure how/why these are turning up in telemetry. Could it be that other extensions or LS plugins are making bad requests? @DanielRosenwasser, what would you propose we do here? |
@amcasey should know more about zero length spans for fixes/refactorings |
which I think we started alpha/beta testing in VS? See #34784 |
My comment's still accurate - we haven't merged it because the telemetry needed for A/B testing isn't in place. It's being actively worked on. |
Also, VS was only looking at this for refactorings, because they could be anywhere. Code fixes have to be within error spans, so that sort of probing isn't necessary. |
monaco-typescript handles this independently (though maybe the TS support in vscode has the same code) - I think this is the part you're interested in. Definitely looks like it can send a zero width cursor: https://github.com/microsoft/monaco-typescript/blob/0c05f6af2887c343941d9db31b4eb3797eb1726e/src/languageFeatures.ts#L700-L701 |
My point is that the only way I can repro this is when someone is sending the LS a clearly invalid set of params. The expectation is that start/end on codefix requests == the start/end of an error span. It’s also potentially a non-negligible amount of work to validate that invariant, so I’m not sure there’s a “fix” that we should be doing on our side. It sounds like we could send a patch to monaco-typescript, but I am confused about how/why we’re seeing this triggered by VS Code in telemetry, because I can’t repro that. So perhaps we can also add more details to that assertion after we detect something has gone wrong. But I don’t yet have any evidence that TS Server is doing something wrong, and I also am not sure we want to fail silently either—if a client is sending us something invalid, that’s useful to know. My plan is just to try to squeeze a bit more info out of those failures. |
With #36420 merged, I'm going to move this to backlog and revisit if @typescript-bot gives us anything else. |
I see this has been merged, but has it gone out in a release? Error However, I have not been able to repro. The error also doesn't tell me much to understand what's going wrong. |
It’s in 3.8 RC and on. Monaco or monaco-typescript probably still needs to be updated to stop requesting code fixes on spans that aren’t errors. |
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue reproduced in the following context:
|
This issue comes from crash dumps in telemetry. We've tried to de-duplicate issues on a best-effort basis, comparing the sequence of methods called and the command requested while ignoring line numbers.
TypeScript version prefix: 3.5.3
VSCode version: 1.37.0
Command requested: getCodeFixes
Hitting sessions: 749
Five line hash: d8ddc31dc603a09c9deda8393918dd1f
Stack:
The text was updated successfully, but these errors were encountered: