Allow each language adapter to provide their own code action kinds array
This commit is contained in:
parent
007aa92581
commit
cdde523ea4
4 changed files with 41 additions and 10 deletions
|
@ -4,6 +4,7 @@ use async_trait::async_trait;
|
|||
use client::http::HttpClient;
|
||||
use futures::StreamExt;
|
||||
use language::{LanguageServerBinary, LanguageServerName, LspAdapter};
|
||||
use lsp::CodeActionKind;
|
||||
use serde_json::json;
|
||||
use smol::fs;
|
||||
use std::{
|
||||
|
@ -142,6 +143,15 @@ impl LspAdapter for TypeScriptLspAdapter {
|
|||
.log_err()
|
||||
}
|
||||
|
||||
fn code_action_kinds(&self) -> Option<Vec<CodeActionKind>> {
|
||||
Some(vec![
|
||||
CodeActionKind::QUICKFIX,
|
||||
CodeActionKind::REFACTOR,
|
||||
CodeActionKind::REFACTOR_EXTRACT,
|
||||
CodeActionKind::SOURCE,
|
||||
])
|
||||
}
|
||||
|
||||
async fn label_for_completion(
|
||||
&self,
|
||||
item: &lsp::CompletionItem,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue