vscode: textDocument/codeAction request has end character set as 1.7976931348623157E+308

From https://github.com/powershell/vscode-powershell/issues/2135.

  • VSCode Version: 1.37.0
  • OS Version: Windows_NT x64 10.0.17763

Steps to Reproduce:

See GIF.

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:

    {
      "jsonrpc": "2.0",
      "id": 8,
      "method": "textDocument/codeAction",
      "params": {
        "textDocument": {
          "uri": "file:///c%3A/Users/Keith/.vscode/extensions/ms-vscode.powershell-2019.5.0/examples/2135_Repro.Tests.ps1"
        },
        "range": {
          "start": {
            "line": 2,
            "character": 8
          },
          "end": {
            "line": 2,
            "character": 1.7976931348623157E+308
          }
        },
        "context": {
          "diagnostics": []
        }
      }
    }

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 to Number.MAX_VALUE in JS.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 31 (26 by maintainers)

Commits related to this issue

Most upvoted comments

2147483647 seems fine for the end character position. I’ll make the change for the July iteration.

Thanks for the investigation!

Adding @alexr00 for the problem matcher. Using a large number like 2^31-1 sounds reasonable

@mjbvz Please try renaming foo.ps1 to foo.Tests.ps1 and reproduce as described above.