Fix caret affinity in GetReferencedSymbolsToLeftOfCaretAsync#52245
Fix caret affinity in GetReferencedSymbolsToLeftOfCaretAsync#52245sharwell merged 6 commits intodotnet:release/dev16.10from
Conversation
5bd566b to
d10df88
Compare
Fixes the inability to insert a snippet for 'object.Equals'.
jasonmalinowski
left a comment
There was a problem hiding this comment.
Good but the "two different types of method names" thing does look a bit funky. If that can be simplified do it, otherwise if it needs to be different a comment would be good.
src/VisualStudio/Core/Def/Implementation/Snippets/AbstractSnippetExpansionClient.cs
Outdated
Show resolved
Hide resolved
| /// </summary> | ||
| public void ResetOptions() | ||
| { | ||
| ResetOption(CompletionOptions.EnableArgumentCompletionSnippets); |
There was a problem hiding this comment.
Rather than calling this one out specifically, I think we can reset generally through the option service. This is the one reason option keys themselves get exported, to allow a general reset.
There was a problem hiding this comment.
We can, but I encountered problems with it last time I tried. Am reserving that [highly desired] change for a separate PR.
| { | ||
| Debug.Assert(_state._expansionSession != null); | ||
| _state._methodNameForInsertFullMethodCall = methodName; | ||
| _state._methodNameForInsertFullMethodCall = methodSymbols.First().Name; |
There was a problem hiding this comment.
It's a bit odd that we have two ways we get the method name, one from symbols (which is correct) and the other one which maybe isn't. Should we just initialize methodName this way on 535? Or if it's not the same sometimes, add a comment?
There was a problem hiding this comment.
💭 One is the method name as it appears in source code, and the other is the method name as it appears in the symbol.
There was a problem hiding this comment.
soundsl ike we should prefer the former? (but i don't care much).
Currently argument completion does not work for the following scenario:
;ConfigureAwaitThis change fixes caret affinity to allow it to work.
There are now two additional bug fixes in this pull request:
object.Equals(previously the code would insert theEqualssnippet, which made no sense at this location).ctor, and dismiss the session before providing arguments)