Add typescript language server
Currently not tested for tsx files Co-authored-by: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
d466768eed
commit
0e1d371a67
7 changed files with 90 additions and 53 deletions
|
@ -2278,11 +2278,12 @@ impl Project {
|
|||
Ok(completions
|
||||
.into_iter()
|
||||
.filter_map(|lsp_completion| {
|
||||
let (old_range, new_text) = match lsp_completion.text_edit.as_ref()? {
|
||||
lsp::CompletionTextEdit::Edit(edit) => {
|
||||
let (old_range, new_text) = match lsp_completion.text_edit.as_ref() {
|
||||
Some(lsp::CompletionTextEdit::Edit(edit)) => {
|
||||
(range_from_lsp(edit.range), edit.new_text.clone())
|
||||
}
|
||||
lsp::CompletionTextEdit::InsertAndReplace(_) => {
|
||||
None => (position..position, lsp_completion.label.clone()),
|
||||
Some(lsp::CompletionTextEdit::InsertAndReplace(_)) => {
|
||||
log::info!("unsupported insert/replace completion");
|
||||
return None;
|
||||
}
|
||||
|
@ -2307,6 +2308,7 @@ impl Project {
|
|||
lsp_completion,
|
||||
})
|
||||
} else {
|
||||
log::info!("completion out of expected range");
|
||||
None
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue