-
Notifications
You must be signed in to change notification settings - Fork 225
Try adjusting caret position to provide better results from Roslyn #8716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try adjusting caret position to provide better results from Roslyn #8716
Conversation
| protected virtual bool TreatAnyAttributePositionAsAttributeName { get; } = false; | ||
|
|
||
| /// <summary> | ||
| /// If <see cref="TreatAnyAttributePositionAsAttributeName "/> is <see langword="true"/>, returns whether the position was adjusted | ||
| /// </summary> | ||
| protected bool DidTreatAttributePositionAsAttributeName { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// If <see cref="TreatAnyAttributePositionAsAttributeName "/> is <see langword="true"/>, returns the range of the full attribute | ||
| /// </summary> | ||
| protected Range OriginalAttributeRange { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is getting a little big IMO, and doing a few things, but I couldn't see a nice way to split it up, and more importantly I couldn't come up with a nice name for a class that could sit in the middle of the hierarchy and provide this functionality. AbstractRazorDelegatingEndpointThatAdjustsCaretPositionToAttributeNamesIfPossible is just silly :)
I don't think this is too egregious that we can't merge this, but its on a slippery slope. Open to feedback.
|
|
||
| protected override string CustomMessageTarget => RazorLanguageServerCustomMessageTargets.RazorImplementationEndpointName; | ||
|
|
||
| protected override bool PreferCSharpOverHtmlIfPossible => true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This strictly out of scope, and was an oversight from a previous PR that turned this on for Go To Def that I just noticed, but seemed simple enough to fix.
ryzngard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the testing and explanations, but the design seems a little bit clunky. Is there a way we can make this more isolated, or generalize more? In the base it seems VERY targeted right now
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs
Outdated
Show resolved
Hide resolved
|
@ryzngard Check out the latest commit, I moved the caret projection logic into a different class, and allowed specific endpoints to provide their preferred strategy. In future we could also move the |
|
ping @dotnet/razor-tooling for reviews :D |
Fixes #8536