Skip to content

Commit 6d2d5a7

Browse files
committed
Map symbol types to LSP better
1 parent 3b08189 commit 6d2d5a7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/PowerShellEditorServices/Services/Symbols/SymbolType.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ internal static SymbolKind GetSymbolKind(SymbolType symbolType)
9494
SymbolType.Method => SymbolKind.Method,
9595
SymbolType.Property => SymbolKind.Property,
9696
SymbolType.EnumMember => SymbolKind.EnumMember,
97-
SymbolType.Variable => SymbolKind.Variable,
98-
// TODO: More delicately handle the other symbol types.
99-
_ => SymbolKind.Variable,
97+
SymbolType.Variable or SymbolType.Parameter => SymbolKind.Variable,
98+
SymbolType.HashtableKey => SymbolKind.Key,
99+
SymbolType.Type => SymbolKind.TypeParameter,
100+
SymbolType.Unknown or _ => SymbolKind.Object,
100101
};
101102
}
102103
}

src/PowerShellEditorServices/Services/Symbols/Visitors/SymbolVisitor.cs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace Microsoft.PowerShell.EditorServices.Services.Symbols;
1515
/// The goal of this is to be our one and only visitor, which parses a file when necessary
1616
/// performing Action, which takes a SymbolReference (that this visitor creates) and returns an
1717
/// AstVisitAction. In this way, all our symbols are created with the same initialization logic.
18+
/// TODO: Visit hashtable keys, constants, arrays, namespaces, interfaces, operators, etc.
1819
/// </summary>
1920
internal sealed class SymbolVisitor : AstVisitor2
2021
{

0 commit comments

Comments
 (0)