mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
This patchset adds dynamic capability registration. Dynamic capabilities are implemented in a form of dynamic features, by conforming to the `DynamicFeature` interface (and its corresponding `Descriptor`). Symmetrically, one can create "static" features by conforming to the `StaticFeature` interface. This is mostly mimicking the vscode model. As an example, two features were implemented: `LSPPublishDiagnosticFeature` which is a "static" feature, and `LSPDiagnosticFeature`, which is an example of a "dynamic" feature. Dynamic features can be "activated" by registering them. The registration can happen upon server initialisation, if the server responds to the initialised request with registration data in its capabilities. If not, the server may later invoke the `"registerCapability"` method to register a dynamic feature. Dynamic features can be later "deactivated" if the server invokes the `"unregisterCapability"` method with the corresponding registration id. This is the starting point for converting more features to allow their dynamic registration, which is a requirement for some servers. GitOrigin-RevId: 5ad44219ed08546ab200d7b210d8176c5d45bf8b
62 lines
1.6 KiB
Kotlin
62 lines
1.6 KiB
Kotlin
package com.jetbrains.lsp.protocol
|
|
|
|
import kotlinx.serialization.Serializable
|
|
import kotlinx.serialization.json.JsonElement
|
|
|
|
@Serializable
|
|
data class ClientWindowCapabilities(
|
|
/**
|
|
* It indicates whether the client supports server-initiated progress using
|
|
* the `window/workDoneProgress/create` request.
|
|
*
|
|
* The capability also controls whether the client supports handling
|
|
* of progress notifications. If set servers are allowed to report a
|
|
* `workDoneProgress` property in the request-specific server capabilities.
|
|
*
|
|
* @since 3.15.0
|
|
*/
|
|
val workDoneProgress: Boolean? = null,
|
|
|
|
/**
|
|
* Capabilities specific to the showMessage request.
|
|
*
|
|
* @since 3.16.0
|
|
*/
|
|
val showMessage: ShowMessageRequestClientCapabilities? = null,
|
|
|
|
/**
|
|
* Client capabilities for the show document request.
|
|
*
|
|
* @since 3.16.0
|
|
*/
|
|
val showDocument: ShowDocumentClientCapabilities? = null
|
|
)
|
|
|
|
@Serializable
|
|
data class ShowMessageRequestClientCapabilities(
|
|
/**
|
|
* Capabilities specific to the `MessageActionItem` type.
|
|
*/
|
|
val messageActionItem: MessageActionItem? = null,
|
|
) {
|
|
@Serializable
|
|
data class MessageActionItem(
|
|
/**
|
|
* Whether the client supports additional attributes which
|
|
* are preserved and sent back to the server in the
|
|
* request's response.
|
|
*/
|
|
val additionalPropertiesSupport: Boolean? = null,
|
|
)
|
|
}
|
|
|
|
@Serializable
|
|
data class ShowDocumentClientCapabilities(
|
|
/**
|
|
* The client has support for the show document
|
|
* request.
|
|
*/
|
|
val support: Boolean,
|
|
)
|
|
|
|
typealias Unknown = JsonElement |