textDocument/codeAction does not send the correct selection range to the language server
@AdamYoblick is already working on this.
Since Dec 12, 2023.
Assessment
This issue has not been assessed yet.
Description
From https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1378352:
Affected Branch: 17 Preview 4
Affected Build: 8/19/2021
Affected Product Language:
Steps to reproduce:
See steps here for the extract method bug (ignore rename for now):
Extract method only works on one line and rename doesn't work at all · Issue #1694 · microsoft/pylance-release (github.com)
The extract portion of that bug isn't working because the LSP client sends this:
LSPClient.Pylance Information: 8 : {"id":8,"method":"textDocument/codeAction"}
LSPClient.Pylance Verbose: 8 : Sent: {
"traceparent": "00-308f1eda378a3c418cd446668e76c98a-5ae985e6ede6264a-01",
"jsonrpc": "2.0",
"id": 8,
"method": "textDocument/codeAction",
"params": {
"textDocument": {
"uri": "file:///C:/Users/aku91/source/repos/PythonApplication6/PythonApplication6/PythonApplication6.py"
},
"range": {
"start": {
"line": 12,
"character": 0
},
"end": {
"line": 12, <-- This only includes a single line.
"character": 14
}
},
"context": {
"_vs_selectionRange": {
"start": {
"line": 12,
"character": 0
},
"end": {
"line": 14, <-- This is the full range
"character": 17
}
},
"diagnostics": []
}
It looks like the _vs_selectionRange is correct, but the codeAction selection range isn't.
This same thing in VS code sends the full codeAction range.
- Dominant language
- C#
- Stars
- 2.6k
- Forks
- 680
- Avg merge
- 39m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/PTVS
-
needs repro
-
La Zafra Openneeds repro
-
La Zafra Openneeds repro
-
Solucion 1 Openneeds repro
-
bug needs repro needs triage
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100