...
This commit is contained in:
@@ -37,7 +37,7 @@ internal class DefinitionHandler(WorkspaceManager workspaceManager) : Definition
|
||||
{
|
||||
var function = compilationUnit.FunctionAtPosition(line, character);
|
||||
|
||||
var parameter = function?.Prototype.Parameters.FirstOrDefault(x => x.Name == variableIdentifierNode.Name);
|
||||
var parameter = function?.Prototype.Parameters.FirstOrDefault(x => x.NameToken.Value == variableIdentifierNode.NameToken.Value);
|
||||
if (parameter != null)
|
||||
{
|
||||
return new LocationOrLocationLinks(parameter.ToLocation());
|
||||
@@ -46,7 +46,7 @@ internal class DefinitionHandler(WorkspaceManager workspaceManager) : Definition
|
||||
var variable = function?.Body?
|
||||
.Descendants()
|
||||
.OfType<VariableDeclarationNode>()
|
||||
.FirstOrDefault(x => x.Name == variableIdentifierNode.Name);
|
||||
.FirstOrDefault(x => x.NameToken.Value == variableIdentifierNode.NameToken.Value);
|
||||
|
||||
if (variable != null)
|
||||
{
|
||||
@@ -57,7 +57,11 @@ internal class DefinitionHandler(WorkspaceManager workspaceManager) : Definition
|
||||
}
|
||||
case FuncIdentifierNode funcIdentifierNode:
|
||||
{
|
||||
var prototype = compilationUnit.ImportedFunctions.FirstOrDefault(x => x.Module == funcIdentifierNode.Module && x.Name == funcIdentifierNode.Name);
|
||||
var prototype = compilationUnit.ImportedFunctions
|
||||
.Where(x => x.Key.Value == funcIdentifierNode.ModuleToken.Value)
|
||||
.SelectMany(x => x.Value)
|
||||
.FirstOrDefault(x => x.NameToken.Value == funcIdentifierNode.NameToken.Value);
|
||||
|
||||
if (prototype != null)
|
||||
{
|
||||
return new LocationOrLocationLinks(prototype.ToLocation());
|
||||
|
||||
Reference in New Issue
Block a user