Skip to content
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

Restore behaviour for attributes when single server support is off #8653

Merged
merged 1 commit into from
May 3, 2023

Conversation

davidwengier
Copy link
Contributor

Fixes #8624

I broke Go To Def and Hover by making it smarter, but the smartness only works if we are delegating to other servers from ours, which is not always true. This restores the previous behaviour in those cases (ie, when single server is off)

@davidwengier davidwengier requested a review from a team as a code owner May 1, 2023 03:50
@@ -36,6 +36,8 @@ internal abstract class AbstractRazorDelegatingEndpoint<TRequest, TResponse> : I
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
}

protected bool SingleServerSupport => _languageServerFeatureOptions.SingleServerSupport;
Copy link
Contributor

Choose a reason for hiding this comment

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

How is SingleServerSupport different from OnlySingleServer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SingleServerSupport means "this client supports delegating requests to downstream language servers"

Normally these endpoints handle Razor contexts, and then if SingleServerSupport is on, they also can delegate to C# or HTML for those contexts. OnlySingleServer means "this endpoint should not run at all if SingleServerSupport isn't on". I think only one endpoint actually uses it, and I'm hoping to remove it in a future update to all of this stuff :D

// If we were trying to navigate to a property, and we couldn't find it, we can at least take
// them to the file for the component. If the property was defined in a partial class they can
// at least then press F7 to go there.
return new Range { Start = new Position(0, 0), End = new Position(0, 0) };
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised we don't have a Range.Zero

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, its not our type, but maybe a future C# version will allow extension everything :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Razor Intellisense not working on Blazor components
4 participants