On-the-fly-docs -- Add better testing and provide more context for more cases#78148
On-the-fly-docs -- Add better testing and provide more context for more cases#78148akhera99 wants to merge 7 commits intodotnet:mainfrom
Conversation
src/EditorFeatures/CSharpTest/OnTheFlyDocs/OnTheFlyDocsUtilitiesTests.cs
Outdated
Show resolved
Hide resolved
src/Features/CSharp/Portable/QuickInfo/OnTheFlyDocsUtilities.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/OnTheFlyDocs/OnTheFlyDocsUtilitiesTests.cs
Outdated
Show resolved
Hide resolved
| using System.Threading.Tasks; | ||
| using Microsoft.CodeAnalysis.CSharp.QuickInfo; | ||
| using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
| using Microsoft.CodeAnalysis.QuickInfo; |
src/EditorFeatures/CSharpTest/OnTheFlyDocs/OnTheFlyDocsUtilitiesTests.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/OnTheFlyDocs/OnTheFlyDocsUtilitiesTests.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/OnTheFlyDocs/OnTheFlyDocsUtilitiesTests.cs
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/OnTheFlyDocs/OnTheFlyDocsUtilitiesTests.cs
Outdated
Show resolved
Hide resolved
| { | ||
| return TestSymbolContextAsync( | ||
| testCode, | ||
| (syntaxTree, semanticModel) => GetMethodSymbol(syntaxTree, semanticModel), |
There was a problem hiding this comment.
| (syntaxTree, semanticModel) => GetMethodSymbol(syntaxTree, semanticModel), | |
| GetMethodSymbol, |
| expectedText, | ||
| expectAllNull, | ||
| resultIndex); | ||
| } |
There was a problem hiding this comment.
can create single helper fort hsi and the above method that generically is passed a <TSyntaxNode> type arg.
| { | ||
| return elementInfo; | ||
| } | ||
| } |
There was a problem hiding this comment.
whats' the general logic/thinking here? I don't relaly get the idea of why we're just getting the first thing and returning, and ending with that. for example, if i have (string s, Customer c) why do i only get relevant file info for string and nto Customer?
| { | ||
| return constraintInfo; | ||
| } | ||
| } |
There was a problem hiding this comment.
same question/concern
| if (typeSymbol is IArrayTypeSymbol arrayTypeSymbol) | ||
| { | ||
| typeSymbol = arrayTypeSymbol.ElementType; | ||
| } |
There was a problem hiding this comment.
IPointerTypeSymbol as well.
| typeSymbol = namedTypeSymbol.TypeArguments[0]; | ||
| } | ||
|
|
||
| var typeSyntaxReference = typeSymbol.DeclaringSyntaxReferences.FirstOrDefault(); |
There was a problem hiding this comment.
same here. what does this mean for partial types?
|
Glad to see tests :) Consider adding tests taht show what happens when the call is in varying contexts: property initializers, accessors, constructors, operators, indexers, methods, local functions, top level functions, lambdas. |
Fixes #78102