From 39d777a8c32700c330c0020d4a74fd9316d15795 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Mon, 27 Oct 2025 19:18:08 +1000 Subject: [PATCH] fix looking up references of class with a primary ctor --- .../Features/CodeEditor/SharpIdeCodeEdit_SymbolLookup.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolLookup.cs b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolLookup.cs index 2478c01..4e19cb6 100644 --- a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolLookup.cs +++ b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolLookup.cs @@ -31,6 +31,9 @@ public partial class SharpIdeCodeEdit GD.Print($"Symbol is declared here: {symbolString}"); // TODO: Lookup references instead var references = await _roslynAnalysis.FindAllSymbolReferences(semanticInfo.Value.DeclaredSymbol); + // Filter out primary constructor references, as they are not useful to navigate to - we are already at the symbol declaration + // This may also filter out other useful references, so may need to revisit later + references = references.Where(s => s.LocationsArray.Length is not 0).ToImmutableArray(); if (references.Length is 1) { var reference = references[0];