Support workspace/executeCommand
for actions' data (#26239)
Closes https://github.com/zed-industries/zed/issues/16746 Part of https://github.com/zed-extensions/deno/issues/2 Changes the action-related code so, that * `lsp::Command` as actions are supported, if server replies with them * actions with commands are filtered out based on servers' `executeCommandOptions` (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#executeCommandOptions) — commands that are not listed won't be executed and the corresponding actions will be hidden in Zed Release Notes: - Added support of `workspace/executeCommand` for actions' data --------- Co-authored-by: Peter Tripp <petertripp@gmail.com>
This commit is contained in:
parent
97c0a0a86e
commit
af5af9d7c5
9 changed files with 217 additions and 87 deletions
|
@ -851,7 +851,7 @@ impl CodeActionsItem {
|
|||
|
||||
pub fn label(&self) -> String {
|
||||
match self {
|
||||
Self::CodeAction { action, .. } => action.lsp_action.title.clone(),
|
||||
Self::CodeAction { action, .. } => action.lsp_action.title().to_owned(),
|
||||
Self::Task(_, task) => task.resolved_label.clone(),
|
||||
}
|
||||
}
|
||||
|
@ -984,7 +984,7 @@ impl CodeActionsMenu {
|
|||
.overflow_hidden()
|
||||
.child(
|
||||
// TASK: It would be good to make lsp_action.title a SharedString to avoid allocating here.
|
||||
action.lsp_action.title.replace("\n", ""),
|
||||
action.lsp_action.title().replace("\n", ""),
|
||||
)
|
||||
.when(selected, |this| {
|
||||
this.text_color(colors.text_accent)
|
||||
|
@ -1029,7 +1029,7 @@ impl CodeActionsMenu {
|
|||
.max_by_key(|(_, action)| match action {
|
||||
CodeActionsItem::Task(_, task) => task.resolved_label.chars().count(),
|
||||
CodeActionsItem::CodeAction { action, .. } => {
|
||||
action.lsp_action.title.chars().count()
|
||||
action.lsp_action.title().chars().count()
|
||||
}
|
||||
})
|
||||
.map(|(ix, _)| ix),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue