Skip to content

Commit 38157fc

Browse files
committed
Only assign progress factory if client supports work done progress
1 parent b5f5d33 commit 38157fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/main/kotlin/org/javacs/kt/KotlinLanguageServer.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class KotlinLanguageServer : LanguageServer, LanguageClientAware, Closeable {
4545
this.client = client
4646
connectLoggingBackend()
4747

48-
progressFactory = LanguageClientProgress.Factory(client)
49-
5048
workspaces.connect(client)
5149
textDocuments.connect(client)
5250

@@ -82,6 +80,10 @@ class KotlinLanguageServer : LanguageServer, LanguageClientAware, Closeable {
8280
val clientCapabilities = params.capabilities
8381
config.completion.snippets.enabled = clientCapabilities?.textDocument?.completion?.completionItem?.snippetSupport ?: false
8482

83+
if (clientCapabilities.window.workDoneProgress) {
84+
progressFactory = LanguageClientProgress.Factory(client)
85+
}
86+
8587
val folders = params.workspaceFolders
8688
val progress = params.workDoneToken?.let { LanguageClientProgress("Workspace folders", it, client) }
8789

0 commit comments

Comments
 (0)