aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/syntax.rs40
1 files changed, 21 insertions, 19 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index a4e6d990..ce26a1bc 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -242,25 +242,27 @@ pub enum LanguageServerFeature {
impl Display for LanguageServerFeature {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(f, "{}", match self {
- LanguageServerFeature::Format => "format",
- LanguageServerFeature::GotoDeclaration => "goto-declaration",
- LanguageServerFeature::GotoDefinition => "goto-definition",
- LanguageServerFeature::GotoTypeDefinition => "goto-type-definition",
- LanguageServerFeature::GotoReference => "goto-type-definition",
- LanguageServerFeature::GotoImplementation => "goto-implementation",
- LanguageServerFeature::SignatureHelp => "signature-help",
- LanguageServerFeature::Hover => "hover",
- LanguageServerFeature::DocumentHighlight => "document-highlight",
- LanguageServerFeature::Completion => "completion",
- LanguageServerFeature::CodeAction => "code-action",
- LanguageServerFeature::WorkspaceCommand => "workspace-command",
- LanguageServerFeature::DocumentSymbols => "document-symbols",
- LanguageServerFeature::WorkspaceSymbols => "workspace-symbols",
- LanguageServerFeature::Diagnostics => "diagnostics",
- LanguageServerFeature::RenameSymbol => "rename-symbol",
- LanguageServerFeature::InlayHints => "inlay-hints",
- })
+ use LanguageServerFeature::*;
+ let feature = match self {
+ Format => "format",
+ GotoDeclaration => "goto-declaration",
+ GotoDefinition => "goto-definition",
+ GotoTypeDefinition => "goto-type-definition",
+ GotoReference => "goto-type-definition",
+ GotoImplementation => "goto-implementation",
+ SignatureHelp => "signature-help",
+ Hover => "hover",
+ DocumentHighlight => "document-highlight",
+ Completion => "completion",
+ CodeAction => "code-action",
+ WorkspaceCommand => "workspace-command",
+ DocumentSymbols => "document-symbols",
+ WorkspaceSymbols => "workspace-symbols",
+ Diagnostics => "diagnostics",
+ RenameSymbol => "rename-symbol",
+ InlayHints => "inlay-hints",
+ };
+ write!(f, "{feature}",)
}
}