-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Closed
Labels
*as-designedDescribed behavior is as designedDescribed behavior is as designededitor-code-actionsEditor inplace actions (Ctrl + .)Editor inplace actions (Ctrl + .)
Description
Coming from clangd/vscode-clangd#376
- VS Code Version: 1.71.2
- OS Version: MacOS
Steps to Reproduce:
- opened a dummy
t.cc(auto S = 1;) in VSCode with vscode-clangd extension, waiting for clangd to warm up. - Move the cursor to
auto, click the 💡 and get a CodeAction menu - Move the cursor to the
Expand auto typeCode ACtion, and pressCommand + Enter
Expected result: a preview pane will be shown
Actual result: we apply the code action without showing the preview
A special bit about clangd which may be related: the CodeAction returned from clangd doesn't have the edit field propagated, instead we use the applyTweak command to apply a workspace edit.
The detailed logs in case it is useful:
V[] <<< {"id":9,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[],"triggerKind":2},"range":{"end":{"character":2,"line":0},"start":{"character":2,"line":0}},"textDocument":{"uri":"file:///tmp/t3.cpp"}}}
I[] <-- textDocument/codeAction(9)
I[] --> reply:textDocument/codeAction(9) 0 ms
V[] >>> {"id":9,"jsonrpc":"2.0","result":[{"command":{"arguments":[{"file":"file:///tmp/t3.cpp","selection":{"end":{"character":2,"line":0},"start":{"character":2,"line":0}},"tweakID":"ExpandAutoType"}],"command":"clangd.applyTweak","title":"Expand auto type"},"kind":"refactor","title":"Expand auto type"}]}
V[] <<< {"id":10,"jsonrpc":"2.0","method":"workspace/executeCommand","params":{"arguments":[{"file":"file:///tmp/t3.cpp","selection":{"end":{"character":2,"line":0},"start":{"character":2,"line":0}},"tweakID":"ExpandAutoType"}],"command":"clangd.applyTweak"}}
I[] <-- workspace/executeCommand(10)
I[] --> workspace/applyEdit(1)
V[] >>> {"id":1,"jsonrpc":"2.0","method":"workspace/applyEdit","params":{"edit":{"changes":{"file:///tmp/t3.cpp":[{"newText":"int","range":{"end":{"character":4,"line":0},"start":{"character":0,"line":0}}},{"newText":"\n","range":{"end":{"character":0,"line":2},"start":{"character":11,"line":0}}}]}}}}
Metadata
Metadata
Assignees
Labels
*as-designedDescribed behavior is as designedDescribed behavior is as designededitor-code-actionsEditor inplace actions (Ctrl + .)Editor inplace actions (Ctrl + .)