@@ -57,7 +57,7 @@ public void LookForUnmatchedCommands(bool isLastTime) {
57
57
{
58
58
try
59
59
{
60
- Definitions [ matchedUcn . YarnName ] = CreateFunctionObject ( Uri , matchedUcn . YarnName , command , matchedUcn . IsCommand , false ) ;
60
+ Definitions [ matchedUcn . YarnName ] = CreateFunctionObject ( Uri , matchedUcn . YarnName , command , matchedUcn . IsCommand , 3 , false ) ;
61
61
Workspace . UnmatchedDefinitions . RemoveAll ( ucn => ucn . YarnName == matchedUcn . YarnName ) ;
62
62
}
63
63
catch ( Exception e )
@@ -85,7 +85,7 @@ private void RegisterCommandAttributeMatches()
85
85
command . AttributeLists . First ( ) . Attributes . First ( a => a . Name . ToString ( ) . Contains ( "YarnCommand" ) )
86
86
. ArgumentList . Arguments . First ( ) . ToString ( )
87
87
. Trim ( '\" ' ) ;
88
- Definitions [ yarnName ] = CreateFunctionObject ( Uri , yarnName , command , true , true ) ;
88
+ Definitions [ yarnName ] = CreateFunctionObject ( Uri , yarnName , command , true , 2 , true ) ;
89
89
Workspace . UnmatchedDefinitions . RemoveAll ( ucn => ucn . YarnName == yarnName ) ; // Matched some comands, can mark them off the list!
90
90
}
91
91
}
@@ -105,7 +105,7 @@ private void RegisterCommentTaggedCommandsAndFunctions()
105
105
var isCommand = string . IsNullOrWhiteSpace ( functionName ) ;
106
106
if ( ! string . IsNullOrWhiteSpace ( yarnName ) )
107
107
{
108
- Definitions [ yarnName ] = CreateFunctionObject ( Uri , yarnName , match , isCommand , false ) ;
108
+ Definitions [ yarnName ] = CreateFunctionObject ( Uri , yarnName , match , isCommand , 1 , false ) ;
109
109
Workspace . UnmatchedDefinitions . RemoveAll ( ucn => ucn . YarnName == yarnName ) ;
110
110
}
111
111
}
@@ -140,7 +140,7 @@ private void RegisterCommandAndFunctionBridges()
140
140
141
141
}
142
142
143
- private RegisteredDefinition CreateFunctionObject ( Uri uri , string yarnName , MethodDeclarationSyntax methodDeclaration , bool isCommand , bool isAttributeMatch = false )
143
+ private RegisteredDefinition CreateFunctionObject ( Uri uri , string yarnName , MethodDeclarationSyntax methodDeclaration , bool isCommand , int priority , bool isAttributeMatch = false )
144
144
{
145
145
string documentation = string . Empty ;
146
146
Dictionary < string , string > paramsDocumentation = new Dictionary < string , string > ( ) ;
@@ -245,6 +245,7 @@ private RegisteredDefinition CreateFunctionObject(Uri uri, string yarnName, Meth
245
245
IsBuiltIn = false ,
246
246
IsCommand = isCommand ,
247
247
Parameters = parameters ,
248
+ Priority = priority ,
248
249
MinParameterCount = parameters . Count ( p => p . DefaultValue == null && ! p . IsParamsArray ) ,
249
250
MaxParameterCount = parameters . Any ( p => p . IsParamsArray ) ? null : parameters . Count ( ) ,
250
251
DefinitionRange = PositionHelper . GetRange ( LineStarts , methodDeclaration . GetLocation ( ) . SourceSpan . Start , methodDeclaration . GetLocation ( ) . SourceSpan . End ) ,
0 commit comments