-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
textDocument/codeAction request has end character set as 1.7976931348623157E+308 #80288
Comments
Can you please write out the steps to reproduce this (instead of a gif) |
Describe "Repro" {
It "Test" -Test {
3 % 2 | Should -BeExactly 0
}
}
{
"label": "Test",
"type": "shell",
"command": "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [
"$pester"
]
},
Pester writes an output to stdout and VSCode parses this. This output provides a line, but not a column. VSCode highlights this line, but then sends I appreciate that the LSP spec specifies this value as a number not an integer, but I feel that a floating point number of characters (which |
Just got around to looking into this but I can't reproduce the diagnostic showing up: @rjmholt Are there any extra steps required here? I'm not a heavy powershell/windows user so its possible my machine is not configured properly |
@rjmholt Any details on reproducing this? |
@mjbvz Please try renaming |
Sorry, lost the original notification!
Ah, yes, please give that a try. The issue itself lies in how the problem matcher handles not being given a column, so if that doesn't work I might be able to craft a more minimal scenario (that will just take time). |
It appears you are running an old version of Pester (3.4.0 - latest is 4.9.0), which does not yet have Or you could try adapting Describe "Repro" {
It "Test" -Test {
3 % 2 | Should -Be 0
}
} I was able to reproduce the issue using Pester 3.4.0 and the above script. Thanks for keeping it up 😃! |
Thanks. I can finally repo this. The root cause seems to be that the marker itself (the problem) has an invalid range. The code action itself just surfaces this range. I confirmed that the marker service is storing a marker that has an This comes from the
So if the problem matcher returned the end column, this wouldn't happen. I think I can also fix the code action provider to clip the range before passing it on however |
Made a fix but the Powershell extension still seems to crash when requesting the code actions. I confirmed that we are passing a more sane range now however |
Not surprised we still crash; we're quite sensitive to line offsets. But if the crash is happening after deserialisation, we're in business. |
@rjmholt If you can verify the fix works for you that would be great. Set the verified label if it does, or reopen. |
@mjbvz Are there verification steps? |
After snowplowing for like six iterations iterations, it's time to admit I'm not going to get around to this issue anytime soon. Marking as help wanted. @TylerLeonhardt It'd probably be best if someone from the Powershell extension could investigate this. It may be a bug on the VS Code side but so far I've only seen reports of it effecting Powershell |
I mean this affects any language extension that uses: https://github.com/OmniSharp/csharp-language-server-protocol Which includes the ARM extension, the Razor, extension, and more. Because that library tries to serialize the column into the int, but vscode defaults to some massive number outside of that range when it can't find a column. If vscode defaulted to something within the range of int, this would resolve the issue. |
It would be helpful to have someone from any of effected extensions investigate this. I don't deal with any of those languages/extensions regularly, so just setting up a repo for this bug is a big time sink. Someone with more knowledge of how these extensions are implemented should be able to pinpoint what is going wrong much more quickly |
Without knowing any of the code, I wonder if it has something to do at the serialization layer, when column is set to undefined |
@mjbvz the problem is this line:
It uses The best value for the default for this would be: 2^31-1, or 2,147,483,647 which is the largest standard 32bit integer. I verified that setting that line to @mjbvz how would you like to proceed here? Surely that value is large enough to be the default? |
Thanks for the investigation! Adding @alexr00 for the problem matcher. Using a large number like |
It might be worth spot checking some of the other usages of |
|
From PowerShell/vscode-powershell#2135.
Steps to Reproduce:
See .
Does this issue occur when all extensions are disabled?: No -- need an extension for a CodeLens
We've been looking into this on the PowerShell extension side, but see this message in the logs:
This value for
range.end.character
causes the extension to crash, but there's not much sane we can do with it. It's equal toNumber.MAX_VALUE
in JS.The text was updated successfully, but these errors were encountered: