diff --git a/changelog.xml b/changelog.xml index 15d34d26..a84d09c9 100644 --- a/changelog.xml +++ b/changelog.xml @@ -13,6 +13,15 @@ + + Rename `ltex.ltex-ls.languageToolHttpServerUri` → [`ltex.languageToolHttpServerUri`](https://valentjn.github.io/ltex/settings.html#ltexlanguagetoolhttpserveruri); the previous name is deprecated + + + Rename `ltex.ltex-ls.languageToolOrgUsername` → [`ltex.languageToolOrg.username`](https://valentjn.github.io/ltex/settings.html#ltexlanguagetoolorgusername); the previous name is deprecated + + + Rename `ltex.ltex-ls.languageToolOrgApiKey` → [`ltex.languageToolOrg.apiKey`](https://valentjn.github.io/ltex/settings.html#ltexlanguagetoolorgapikey); the previous name is deprecated + Add support for completion requests for English and German diff --git a/src/main/kotlin/org/bsplines/ltexls/settings/Settings.kt b/src/main/kotlin/org/bsplines/ltexls/settings/Settings.kt index 85663bc8..762f3f05 100644 --- a/src/main/kotlin/org/bsplines/ltexls/settings/Settings.kt +++ b/src/main/kotlin/org/bsplines/ltexls/settings/Settings.kt @@ -120,7 +120,7 @@ data class Settings( } if (languageToolHttpServerUri != other.languageToolHttpServerUri) { - differences.add(SettingsDifference("ltex-ls.languageToolHttpServerUri", + differences.add(SettingsDifference("languageToolHttpServerUri", this.languageToolHttpServerUri, other.languageToolHttpServerUri)) } @@ -213,12 +213,43 @@ data class Settings( getSettingFromJsonAsString(jsonSettings, "additionalRules.neuralNetworkModel") val word2VecModelRulesDirectory: String? = getSettingFromJsonAsString(jsonSettings, "additionalRules.word2VecModel") - val languageToolHttpServerUri: String? = + + val languageToolHttpServerUri: String? = getSettingFromJsonAsString( + jsonSettings, + "languageToolHttpServerUri", + ).let { + if (it?.isNotEmpty() == true) { + it + } else { + // deprecated in 14.1.0 getSettingFromJsonAsString(jsonSettings, "ltex-ls.languageToolHttpServerUri") - val languageToolOrgUsername: String? = + } + } + + val languageToolOrgUsername: String? = getSettingFromJsonAsString( + jsonSettings, + "languageToolOrg.username", + ).let { + if (it?.isNotEmpty() == true) { + it + } else { + // deprecated in 14.1.0 getSettingFromJsonAsString(jsonSettings, "ltex-ls.languageToolOrgUsername") - val languageToolOrgApiKey: String? = + } + } + + val languageToolOrgApiKey: String? = getSettingFromJsonAsString( + jsonSettings, + "languageToolOrg.apiKey", + ).let { + if (it?.isNotEmpty() == true) { + it + } else { + // deprecated in 14.1.0 getSettingFromJsonAsString(jsonSettings, "ltex-ls.languageToolOrgApiKey") + } + } + val logLevel: Level? = getSettingFromJsonAsEnum( jsonSettings, "ltex-ls.logLevel",