Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 40d6b7b

Browse files
authored
Merge pull request #734 from aldonogueira/master
Removes local variables from outline #594
2 parents b113fcd + fe88c7b commit 40d6b7b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/lsp_data.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,21 @@ pub mod ls_util {
181181
/// Convert an RLS def-kind to a language server protocol symbol-kind.
182182
pub fn source_kind_from_def_kind(k: DefKind) -> SymbolKind {
183183
match k {
184-
DefKind::Enum => SymbolKind::Enum,
185-
DefKind::TupleVariant => SymbolKind::Constant,
184+
DefKind::Enum | DefKind::Union => SymbolKind::Enum,
185+
DefKind::Static | DefKind::Const => SymbolKind::Constant,
186186
DefKind::Tuple => SymbolKind::Array,
187-
DefKind::StructVariant | DefKind::Union | DefKind::Struct => SymbolKind::Class,
188-
DefKind::Function | DefKind::Method | DefKind::Macro => SymbolKind::Function,
187+
DefKind::Struct => SymbolKind::Class,
188+
DefKind::Function | DefKind::Macro => SymbolKind::Function,
189+
DefKind::Method => SymbolKind::Method,
189190
DefKind::Mod => SymbolKind::Module,
190191
DefKind::Trait | DefKind::Type | DefKind::ExternType => SymbolKind::Interface,
191-
DefKind::Local | DefKind::Static | DefKind::Const | DefKind::Field => SymbolKind::Variable,
192+
DefKind::Local => SymbolKind::Variable,
193+
DefKind::Field | DefKind::TupleVariant | DefKind::StructVariant => SymbolKind::Field,
194+
195+
// Waiting for languageserver-types be updated to LSP 3 spec
196+
//DefKind::Struct => SymbolKind::Struct,
197+
//DefKind::TupleVariant | DefKind::StructVariant => SymbolKind::EnumMember,
198+
//DefKind::Type => SymbolKind::TypeParameter,
192199
}
193200
}
194201

0 commit comments

Comments
 (0)