Skip to content

Commit

Permalink
Add configuration to use new experimental ondisk cache for lsp-kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
themkat committed Aug 16, 2023
1 parent a319b2c commit c894a77
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions clients/lsp-kotlin.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ to Kotlin."
:group 'lsp-kotlin
:package-version '(lsp-mode . "8.0.1"))

;; cache in this case is the dependency cache. Given as an initialization option.
(defcustom lsp-kotlin-ondisk-cache-path ""
"Path to the ondisk cache if used."
:type 'string
:group 'lsp-kotlin)

(defcustom lsp-kotlin-ondisk-cache-enabled nil
"Specifies whether to enable ondisk cache or not. If nil, in-memory cache will be used."
:type 'boolean
:group 'lsp-kotlin)

(lsp-register-custom-settings
'(("kotlin.externalSources.autoConvertToKotlin" lsp-kotlin-external-sources-auto-convert-to-kotlin t)
("kotlin.externalSources.useKlsScheme" lsp-kotlin-external-sources-use-kls-scheme t)
Expand Down Expand Up @@ -260,6 +271,10 @@ to Kotlin."
:initialized-fn (lambda (workspace)
(with-lsp-workspace workspace
(lsp--set-configuration (lsp-configuration-section "kotlin"))))
:initialization-options (lambda ()
(if lsp-kotlin-ondisk-cache-enabled
(list :storagePath lsp-kotlin-ondisk-cache-path)
(list)))
:download-server-fn (lambda (_client callback error-callback _update?)
(lsp-package-ensure 'kotlin-language-server callback error-callback))))

Expand Down

0 comments on commit c894a77

Please sign in to comment.