Request textDocument/codeAction failed.
wondertalik opened this issue · 2 comments
Hello,
Thanks for your extension. Can i use your extension for dart (flutter) code? If yes i had a problem. All details i have already explained here.
I had a look in the code, and I think the issue is the use of Number.MAX_VALUE
here:
vscode-code-coverage/src/extension.ts
Line 160 in bb8cdae
Although I'm not certain that's really a bug. VS Code seems to allow this value fine. However, it's not valid in LSP and the LSP client appears to just pass the value on as-is. I've filed an issue at microsoft/vscode-languageserver-node#761 to see whether this is considered a bug and will be fixed there.
I think a better way to handle this than using Number.MAX_VALUE
would be to change:
new Range(
new Position(detail.line - 1, 0),
new Position(detail.line - 1, Number.MAX_VALUE)
)
To document.lineAt(detail.line - 1).range
instead. This will require access to the TextDocument
for a file, but it looks like that's already available in showStatus
(activeTextEditor.document
) here:
vscode-code-coverage/src/extension.ts
Line 97 in bb8cdae