-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
WorkspaceEdit should have an option to adjust whitespaces (like snippets) #52272
Comments
We could do this but only when the code action use an edit, not a command. @yaohaizh Can you provide a concrete sample please. |
@jrieken Given a workspace with everything set to indent using 2 spaces: {
"editor.insertSpaces": true,
"editor.tabSize": 2
} When applying a code action like I assume what @yaohaizh meant was that as an API consumer he wants to read the language agnostic formatting settings like |
Yes, we use the Command for codeaction, but not edit. I have uploaded a java sample project for this.
|
What command? Is your extension implementing that? Does it use the |
The Command object of LSP for CodeAction result. Command
Represents a reference to a command. Provides a title which will be used to represent a command in the UI. Commands are identified by a string identifier. The protocol currently doesn’t specify a set of well-known commands. So executing a command requires some tool extension code.
interface Command {
/**
* Title of the command, like `save`.
*/
title: string;
/**
* The identifier of the actual command handler.
*/
command: string;
/**
* Arguments that the command handler should be
* invoked with.
*/
arguments?: any[];
} And this is the java implementation: We put the WorkspaceEdit object in the arguments array. |
Ok, so the WorkspaceEdit describes the textual changes you are making. I will update the title accordingly. |
Hi @jrieken, May I ask is there any further plan about this issue? |
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation. Happy Coding |
1 similar comment
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation. Happy Coding |
🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
CodeAction and CompletionItems result doesn't format according to current selected opened file.
Code snippets (like ctor) are indented with tabs, but vscode fixes the indentation on-the-fly, according to its preferences. And the codeaction doesn't pass the current editor's indentation setting when invoke codeaction/completions.
Snippet/CodeAction/Completion should have similar behavior.
The text was updated successfully, but these errors were encountered: