File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -147,14 +147,23 @@ private CSSyntax.ExpressionSyntax HoistByRefDeclaration(VBSyntax.SimpleArgumentS
147147 private ISymbol GetInvocationSymbol ( SyntaxNode invocation )
148148 {
149149 var symbol = invocation . TypeSwitch (
150- ( VBSyntax . InvocationExpressionSyntax e ) => _semanticModel . GetSymbolInfo ( e ) . ExtractBestMatch < ISymbol > ( ) ,
150+ ( VBSyntax . InvocationExpressionSyntax e ) => _semanticModel . GetSymbolInfo ( e ) . CandidateSymbols
151+ . OrderByDescending ( s => s . GetParameters ( ) . Length == e . ArgumentList . Arguments . Count )
152+ . ThenByDescending ( s => ParameterMatchScore ( s , e . ArgumentList . Arguments ) )
153+ . FirstOrDefault ( ) ,
151154 ( VBSyntax . ObjectCreationExpressionSyntax e ) => _semanticModel . GetSymbolInfo ( e ) . ExtractBestMatch < ISymbol > ( ) ,
152155 ( VBSyntax . RaiseEventStatementSyntax e ) => _semanticModel . GetSymbolInfo ( e . Name ) . ExtractBestMatch < ISymbol > ( ) ,
153156 ( VBSyntax . MidExpressionSyntax _ ) => CommonConversions . KnownTypes . VbCompilerStringType ? . GetMembers ( "MidStmtStr" ) . FirstOrDefault ( ) ,
154157 _ => throw new NotSupportedException ( ) ) ;
155158 return symbol ;
156159 }
157160
161+ private static int ParameterMatchScore ( ISymbol symbol , SeparatedSyntaxList < VBSyntax . ArgumentSyntax > arguments )
162+ {
163+ //TODO: Match on name/position and type
164+ return 1 ;
165+ }
166+
158167 private IEnumerable < CSSyntax . ArgumentSyntax > GetAdditionalRequiredArgs (
159168 IEnumerable < VBSyntax . ArgumentSyntax > arguments ,
160169 ISymbol invocationSymbol )
You can’t perform that action at this time.
0 commit comments