ruby: Fix solargraph completion highlighting (#11825)
Hi. This pull request fixes a small error with `solargraph` completions to make them more detailed. It removes the nested match expression to resolve the problem with highlighting the completion items and their signatures with the return type as well. Thanks. See screenshots below. Release Notes: - N/A | Before | After | | ------------- | ------------- | |  |  |
This commit is contained in:
parent
26b5f34046
commit
43be375c76
1 changed files with 36 additions and 42 deletions
|
@ -20,8 +20,6 @@ impl Solargraph {
|
|||
}
|
||||
|
||||
pub fn label_for_completion(&self, completion: Completion) -> Option<CodeLabel> {
|
||||
match completion.kind? {
|
||||
CompletionKind::Method => {
|
||||
let highlight_name = match completion.kind? {
|
||||
CompletionKind::Class | CompletionKind::Module => "type",
|
||||
CompletionKind::Constant => "constant",
|
||||
|
@ -44,8 +42,7 @@ impl Solargraph {
|
|||
};
|
||||
|
||||
let len = completion.label.len();
|
||||
let name_span =
|
||||
CodeLabelSpan::literal(completion.label, Some(highlight_name.to_string()));
|
||||
let name_span = CodeLabelSpan::literal(completion.label, Some(highlight_name.to_string()));
|
||||
|
||||
Some(CodeLabel {
|
||||
code: Default::default(),
|
||||
|
@ -61,9 +58,6 @@ impl Solargraph {
|
|||
filter_range: (0..len).into(),
|
||||
})
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn label_for_symbol(&self, symbol: Symbol) -> Option<CodeLabel> {
|
||||
let name = &symbol.name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue