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

Settings ILanguageClient impossible to get #270

Open
guillaume-kotulski opened this issue Oct 25, 2022 · 0 comments
Open

Settings ILanguageClient impossible to get #270

guillaume-kotulski opened this issue Oct 25, 2022 · 0 comments

Comments

@guillaume-kotulski
Copy link

guillaume-kotulski commented Oct 25, 2022

Installed products

  • Visual Studio 2022

Description

Cannot get the settings from the ILanguageClient

Steps to recreate

  1. Create an extension for LSP
public class LanguageClient : AsyncPackage, ILanguageClient
    {

        public async Task<Connection> ActivateAsync(CancellationToken token)
        {
           ...
        }

        public async Task OnLoadedAsync()
        {

            Config page = (Config)GetDialogPage(typeof(Config));
            _path = page.OptionPath;
            if (_path != null && _path != "")
            {
                await StartAsync.InvokeAsync(this, EventArgs.Empty);
            }
        }

        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
        {
            // When initialized asynchronously, the current thread may be a background thread at this point.
            // Do any initialization that requires the UI thread after switching to the UI thread.
            Config page = (Config)GetDialogPage(typeof(Config));

            await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
        }

Current behavior

The Page "Config" does exist but impossible to get it from the OnLoadedAsync I always obtain the default values.
But if I go directly to the settings InitializeAsync is called with the settings. InitializeAsync is called only when we go in the settings ?

Expected behavior

Should get the settings.

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

No branches or pull requests

1 participant