Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit ce877c1

Browse files
authored
Check for workspace/configuration availability before sending request (microsoft#1506)
1 parent 2febe16 commit ce877c1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/LanguageServer/Impl/LanguageServer.Lifetime.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public async Task Initialized(JToken token, CancellationToken cancellationToken)
5353
}
5454

5555
private async Task<JToken> GetPythonConfigurationAsync(CancellationToken cancellationToken = default, int? cancelAfterMilli = null) {
56+
if (_initParams?.capabilities?.workspace?.configuration != true) {
57+
return null;
58+
}
59+
5660
try {
5761
using (var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken)) {
5862
if (cancelAfterMilli.HasValue) {

src/LanguageServer/Impl/Protocol/Classes.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ public struct SymbolKindCapabilities {
198198

199199
public struct ExecuteCommandCapabilities { public bool dynamicRegistration; }
200200
public ExecuteCommandCapabilities? executeCommand;
201+
202+
/// <summary>
203+
/// Supports the 'workspace/configuration' request.
204+
/// </summary>
205+
public bool? configuration;
201206
}
202207

203208
[Serializable]

0 commit comments

Comments
 (0)