Skip to content

Commit

Permalink
Merge pull request #540 from fwcd/rename-inlayhints-config
Browse files Browse the repository at this point in the history
Rename config object to `inlayHints` for consistency
  • Loading branch information
fwcd authored Jan 14, 2024
2 parents 9c7b828 + 7b05be0 commit e5a0fe3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion server/src/main/kotlin/org/javacs/kt/Configuration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ public data class Configuration(
val scripts: ScriptsConfiguration = ScriptsConfiguration(),
val indexing: IndexingConfiguration = IndexingConfiguration(),
val externalSources: ExternalSourcesConfiguration = ExternalSourcesConfiguration(),
val hints: InlayHintsConfiguration = InlayHintsConfiguration()
val inlayHints: InlayHintsConfiguration = InlayHintsConfiguration()
)
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class KotlinTextDocumentService(

override fun inlayHint(params: InlayHintParams): CompletableFuture<List<InlayHint>> = async.compute {
val (file, _) = recover(params.textDocument.uri, params.range.start, Recompile.ALWAYS)
provideHints(file, config.hints)
provideHints(file, config.inlayHints)
}

override fun hover(position: HoverParams): CompletableFuture<Hover?> = async.compute {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ class KotlinWorkspaceService(

// Update options for inlay hints
get("inlayHints")?.asJsonObject?.apply {
val hints = config.hints
get("typeHints")?.asBoolean?.let { hints.typeHints = it }
get("parameterHints")?.asBoolean?.let { hints.parameterHints = it }
get("chainedHints")?.asBoolean?.let { hints.chainedHints = it }
val inlayHints = config.inlayHints
get("typeHints")?.asBoolean?.let { inlayHints.typeHints = it }
get("parameterHints")?.asBoolean?.let { inlayHints.parameterHints = it }
get("chainedHints")?.asBoolean?.let { inlayHints.chainedHints = it }
}

// Update diagnostics options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ abstract class LanguageServerTestFixture(
uri = workspaceRoot.toUri().toString()
})

languageServer.config.hints.apply {
this.typeHints = true
this.parameterHints = true
this.chainedHints = true
languageServer.config.inlayHints.apply {
typeHints = true
parameterHints = true
chainedHints = true
}
languageServer.sourcePath.indexEnabled = false
languageServer.connect(this)
Expand Down

0 comments on commit e5a0fe3

Please sign in to comment.