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

Hook up DidChangeConfiguration from client #66861

Merged
merged 65 commits into from
Mar 22, 2023

Conversation

Cosifne
Copy link
Member

@Cosifne Cosifne commented Feb 13, 2023

Linked the server to client to use the DidChangeConfiguration and workspace/configuration to update the configuration value.
Some other change:

  • Add a few options I feel should be meaningful in the Lsp world.
  • Add a unit test to guard the workflow.

The model used is the LSP pull model from the server, it is done in this way.

  1. When initialized, refresh all the options.
  2. When the client notices us there is a change via DidChangeConfigurationParams, refresh all the options again.

The section sends to the client is in this pattern:

  1. Option is a single value option. {optionGroupName}.{optionName}
  2. Option is per language value option. The server will ask the client the value for C# and VB. The format would be
    {csharp|visual_basic}.{optionGroupName}.{optionName}
    It is done in this way because I think Roslyn server is CSharpVisualBasicLspServer, so the server should ask all the options for both languages. It is the client's responsibility to figure out which language should be supported. If the client only support C# or VB, it should give empty value to server for the supported language options.

internal partial class DidChangeConfigurationNotificationHandler
{
// TODO: all the supported options here
private static readonly ImmutableArray<ISingleValuedOption> s_supportedGlobalOptions = ImmutableArray.Create<ISingleValuedOption>();
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need "supported" options? Why not just allow any options?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean here we don't care if the options is meaningful to the cilent not and just asking it for all the options?
If case the client doesn't have that, (it might return null), we just ignore the value and fall back to our default value?

Copy link
Member

Choose a reason for hiding this comment

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

pretty much

@Cosifne Cosifne requested a review from tmat March 16, 2023 18:26
@Cosifne
Copy link
Member Author

Cosifne commented Mar 16, 2023

Tag @tmat and @dibarbet to review

@Cosifne
Copy link
Member Author

Cosifne commented Mar 16, 2023

cc @jasonmalinowski

Copy link
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

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

Mostly all seems reasonable - some minor feedback.

@Cosifne
Copy link
Member Author

Cosifne commented Mar 20, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

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

I'm good with this

@Cosifne Cosifne removed the request for review from tmat March 22, 2023 20:26
@Cosifne Cosifne dismissed tmat’s stale review March 22, 2023 21:35

Tomas is OOF now, and I have synced with him before he left, as long as David is fine with the change he is also fine with that

@Cosifne Cosifne merged commit aff74c6 into dotnet:main Mar 22, 2023
@ghost ghost added this to the Next milestone Mar 22, 2023
@Cosifne Cosifne deleted the dev/shech/LSPConfiguration branch March 22, 2023 21:36
@allisonchou allisonchou modified the milestones: Next, 17.6 P3 Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants