#pragma once #include "LibLsp/lsp/method_type.h" #include #include "LibLsp/JsonRpc/message.h" #include "LibLsp/lsp/lsDocumentUri.h" #include "LibLsp/lsp/lsAny.h" #include "LibLsp/lsp/extention/jdtls/searchSymbols.h" /** * Capabilities specific to `WorkspaceEdit`s */ //New in version 3.13: ResourceOperationKind and FailureHandlingKind and the client capability workspace.workspaceEdit. //resourceOperations as well as workspace.workspaceEdit.failureHandling. //The capabilities of a workspace edit has evolved over the time. //Clients can describe their support using the following client capability : struct lschangeAnnotationSupport { /** * Whether the client groups edits with equal labels into tree nodes, * for instance all edits labelled with "Changes in Strings" would * be a tree node. */ optional groupsOnLabel; MAKE_SWAP_METHOD(lschangeAnnotationSupport, groupsOnLabel) }; MAKE_REFLECT_STRUCT(lschangeAnnotationSupport, groupsOnLabel) struct WorkspaceEditCapabilities { /** * The client supports versioned document changes in `WorkspaceEdit`s */ optional documentChanges; /** * The client supports resource changes * in `WorkspaceEdit`s. * * @deprecated Since LSP introduces resource operations, use {link #resourceOperations} */ optional resourceChanges; /** * The resource operations the client supports. Clients should at least * support 'create', 'rename' and 'delete' files and folders. * * @since 3.13.0 */ optional> resourceOperations; /** * The failure handling strategy of a client if applying the workspace edit * fails. * * See {@link FailureHandlingKind} for allowed values. */ optional failureHandling; /** * Whether the client normalizes line endings to the client specific * setting. * If set to `true` the client will normalize line ending characters * in a workspace edit to the client specific new line character(s). * * @since 3.16.0 */ optional normalizesLineEndings; ; /** * Whether the client in general supports change annotations on text edits, * create file, rename file and delete file changes. * * @since 3.16.0 */ optional changeAnnotationSupport; MAKE_SWAP_METHOD( WorkspaceEditCapabilities, documentChanges, resourceChanges, resourceOperations, failureHandling, normalizesLineEndings, changeAnnotationSupport ) }; MAKE_REFLECT_STRUCT( WorkspaceEditCapabilities, documentChanges, resourceChanges, resourceOperations, failureHandling, normalizesLineEndings, changeAnnotationSupport ) struct DynamicRegistrationCapabilities { // Did foo notification supports dynamic registration. optional dynamicRegistration; MAKE_SWAP_METHOD(DynamicRegistrationCapabilities, dynamicRegistration); }; MAKE_REFLECT_STRUCT(DynamicRegistrationCapabilities, dynamicRegistration); struct InlayHintLazyProperties { optional> properties; MAKE_SWAP_METHOD(InlayHintLazyProperties, properties) }; MAKE_REFLECT_STRUCT(InlayHintLazyProperties, properties) struct InlayHintClientCapabilities { // Whether inlay hints support dynamic registration. optional dynamicRegistration; optional resolveSupport; MAKE_SWAP_METHOD(InlayHintClientCapabilities, dynamicRegistration, resolveSupport); }; MAKE_REFLECT_STRUCT(InlayHintClientCapabilities, dynamicRegistration, resolveSupport) // Workspace specific client capabilities. struct SymbolKindCapabilities { optional> valueSet; MAKE_SWAP_METHOD(SymbolKindCapabilities, valueSet) }; MAKE_REFLECT_STRUCT(SymbolKindCapabilities, valueSet) struct SymbolCapabilities : public DynamicRegistrationCapabilities { /** * Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. */ optional symbolKind; MAKE_SWAP_METHOD(SymbolCapabilities, symbolKind, dynamicRegistration) }; MAKE_REFLECT_STRUCT(SymbolCapabilities, symbolKind, dynamicRegistration) struct lsFileOperations { /** * Whether the client supports dynamic registration for file * requests/notifications. */ optional dynamicRegistration; /** * The client has support for sending didCreateFiles notifications. */ optional didCreate; /** * The client has support for sending willCreateFiles requests. */ optional willCreate; /** * The client has support for sending didRenameFiles notifications. */ optional didRename; /** * The client has support for sending willRenameFiles requests. */ optional willRename; /** * The client has support for sending didDeleteFiles notifications. */ optional didDelete; /** * The client has support for sending willDeleteFiles requests. */ optional willDelete; MAKE_SWAP_METHOD( lsFileOperations, dynamicRegistration, didCreate, willCreate, didRename, willRename, didDelete, willDelete ) }; MAKE_REFLECT_STRUCT( lsFileOperations, dynamicRegistration, didCreate, willCreate, didRename, willRename, didDelete, willDelete ) struct lsWorkspaceClientCapabilites { // The client supports applying batch edits to the workspace. optional applyEdit; // Capabilities specific to `WorkspaceEdit`s optional workspaceEdit; // Capabilities specific to the `workspace/didChangeConfiguration` // notification. optional didChangeConfiguration; // Capabilities specific to the `workspace/didChangeWatchedFiles` // notification. optional didChangeWatchedFiles; // Capabilities specific to the `workspace/symbol` request. optional symbol; // Capabilities specific to the `workspace/executeCommand` request. optional executeCommand; /** * The client has support for workspace folders. * * Since 3.6.0 */ optional workspaceFolders; /** * The client supports `workspace/configuration` requests. * * Since 3.6.0 */ optional configuration; /** * Capabilities specific to the semantic token requests scoped to the * workspace. * * @since 3.16.0 */ optional semanticTokens; /** * Capabilities specific to the code lens requests scoped to the * workspace. * * @since 3.16.0 */ optional codeLens; /** * The client has support for file requests/notifications. * * @since 3.16.0 */ optional fileOperations; MAKE_SWAP_METHOD( lsWorkspaceClientCapabilites, applyEdit, workspaceEdit, didChangeConfiguration, didChangeWatchedFiles, symbol, executeCommand, workspaceFolders, configuration, semanticTokens, codeLens, fileOperations ) }; MAKE_REFLECT_STRUCT( lsWorkspaceClientCapabilites, applyEdit, workspaceEdit, didChangeConfiguration, didChangeWatchedFiles, symbol, executeCommand, workspaceFolders, configuration, semanticTokens, codeLens, fileOperations )