-
Notifications
You must be signed in to change notification settings - Fork 676
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
Fix missing imports due to pylance thinking open documents are under default workspace #8033
Conversation
bschnurr
commented
Oct 21, 2024
- inject workspace definitions into the "initialize" call to pylance so that there is no chance of a textdocument/didopen call triggering the creation of a dfeault workspace before getfolders is called to setup the workspace.
… we wont be creating a default workspace if textdocument/didopen is sent before workspacefolders are updated
@@ -593,24 +590,35 @@ private Tuple<StreamData, bool> OnSendToServer(StreamData data) { | |||
return Tuple.Create(data, true); | |||
} | |||
|
|||
private async Task OnWorkspaceOpening(object sende, EventArgs e) { | |||
private IEnumerable<WorkspaceFolder> GetFolders() { |
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.
Could you have this always return a list? Every place you call it you're turning it into a list.
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.
true. such a small list. no reason to make it enumerable
@@ -138,7 +135,7 @@ public async Task<Connection> ActivateAsync(CancellationToken token) { | |||
await JoinableTaskContext.Factory.SwitchToMainThreadAsync(); | |||
CreateClientContexts(); | |||
|
|||
_deferredSettingsChangedTimer = new Timer(OnDeferredSettingsChanged, state: null, Timeout.Infinite, Timeout.Infinite); |
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.
just replacing this function with a lamda to cut down on fuctions
return InvokeDidChangeConfigurationAsync(new LSP.DidChangeConfigurationParams() { | ||
// Pylance will ask us for per workspace configuration settings. We can send | ||
// default workspace settings here. | ||
Settings = GetSettings() |
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.
now include actual settings which get applied to any default workspace
Quality Gate passedIssues Measures |