Skip to content

On-the-fly-docs -- Add better testing and provide more context for more cases#78148

Open
akhera99 wants to merge 7 commits intodotnet:mainfrom
akhera99:dev/ankitakhera/fix_otfd_tests
Open

On-the-fly-docs -- Add better testing and provide more context for more cases#78148
akhera99 wants to merge 7 commits intodotnet:mainfrom
akhera99:dev/ankitakhera/fix_otfd_tests

Conversation

@akhera99
Copy link
Member

@akhera99 akhera99 commented Apr 14, 2025

Fixes #78102

@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 14, 2025
@akhera99 akhera99 removed the VSCode label Apr 14, 2025
@akhera99 akhera99 marked this pull request as ready for review April 16, 2025 19:31
@akhera99 akhera99 requested a review from a team as a code owner April 16, 2025 19:31
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp.QuickInfo;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.QuickInfo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed?

{
return TestSymbolContextAsync(
testCode,
(syntaxTree, semanticModel) => GetMethodSymbol(syntaxTree, semanticModel),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(syntaxTree, semanticModel) => GetMethodSymbol(syntaxTree, semanticModel),
GetMethodSymbol,

expectedText,
expectAllNull,
resultIndex);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can create single helper fort hsi and the above method that generically is passed a <TSyntaxNode> type arg.

{
return elementInfo;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question/concern

if (typeSymbol is IArrayTypeSymbol arrayTypeSymbol)
{
typeSymbol = arrayTypeSymbol.ElementType;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IPointerTypeSymbol as well.

typeSymbol = namedTypeSymbol.TypeArguments[0];
}

var typeSyntaxReference = typeSymbol.DeclaringSyntaxReferences.FirstOrDefault();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. what does this mean for partial types?

@CyrusNajmabadi
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On-the-fly-docs context testing

3 participants