Class: LSP::CompletionClientCapabilities

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_protocol.rb

Overview

export interface CompletionClientCapabilities

/**
 * Whether completion supports dynamic registration.
 */
dynamicRegistration?: boolean;
/**
 * The client supports the following `CompletionItem` specific
 * capabilities.
 */
completionItem?: {
    /**
     * Client supports snippets as insert text.
     *
     * A snippet can define tab stops and placeholders with `$1`, `$2`
     * and `${3:foo`. `$0` defines the final tab stop, it defaults to
     * the end of the snippet. Placeholders with equal identifiers are linked,
     * that is typing in one will update others too.
     */
    snippetSupport?: boolean;
    /**
     * Client supports commit characters on a completion item.
     */
    commitCharactersSupport?: boolean;
    /**
     * Client supports the follow content formats for the documentation
     * property. The order describes the preferred format of the client.
     */
    documentationFormat?: MarkupKind[];
    /**
     * Client supports the deprecated property on a completion item.
     */
    deprecatedSupport?: boolean;
    /**
     * Client supports the preselect property on a completion item.
     */
    preselectSupport?: boolean;
    /**
     * Client supports the tag property on a completion item. Clients supporting
     * tags have to handle unknown tags gracefully. Clients especially need to
     * preserve unknown tags when sending a completion item back to the server in
     * a resolve call.
     *
     * @since 3.15.0
     */
    tagSupport?: {
        /**
         * The tags supported by the client.
         */
        valueSet: CompletionItemTag[];
    };
};
completionItemKind?: {
    /**
     * The completion item kind values the client supports. When this
     * property exists the client also guarantees that it will
     * handle values outside its set gracefully and falls back
     * to a default value when unknown.
     *
     * If this property is not present the client only supports
     * the completion items kinds from `Text` to `Reference` as defined in
     * the initial version of the protocol.
     */
    valueSet?: CompletionItemKind[];
};
/**
 * The client supports to send additional context information for a
 * `textDocument/completion` requestion.
 */
contextSupport?: boolean;

}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ CompletionClientCapabilities

Returns a new instance of CompletionClientCapabilities.



1008
1009
1010
1011
# File 'lib/lsp/lsp_protocol.rb', line 1008

def initialize(initial_hash = nil)
  super
  @optional_method_names = i[dynamicRegistration completionItem completionItemKind contextSupport]
end

Instance Attribute Details

#completionItemObject

type: boolean # type: {



951
952
953
# File 'lib/lsp/lsp_protocol.rb', line 951

def completionItem
  @completionItem
end

#completionItemKindObject

/**

     * Client supports snippets as insert text.
     *
     * A snippet can define tab stops and placeholders with `$1`, `$2`
     * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
     * the end of the snippet. Placeholders with equal identifiers are linked,
     * that is typing in one will update others too.
     */
    snippetSupport?: boolean;
    /**
     * Client supports commit characters on a completion item.
     */
    commitCharactersSupport?: boolean;
    /**
     * Client supports the follow content formats for the documentation
     * property. The order describes the preferred format of the client.
     */
    documentationFormat?: MarkupKind[];
    /**
     * Client supports the deprecated property on a completion item.
     */
    deprecatedSupport?: boolean;
    /**
     * Client supports the preselect property on a completion item.
     */
    preselectSupport?: boolean;
    /**
     * Client supports the tag property on a completion item. Clients supporting
     * tags have to handle unknown tags gracefully. Clients especially need to
     * preserve unknown tags when sending a completion item back to the server in
     * a resolve call.
     *
     * @since 3.15.0
     */
    tagSupport?: {
        /**
         * The tags supported by the client.
         */
        valueSet: CompletionItemTag[];
    };
}


993
994
995
# File 'lib/lsp/lsp_protocol.rb', line 993

def completionItemKind
  @completionItemKind
end

#contextSupportObject

/**

     * The completion item kind values the client supports. When this
     * property exists the client also guarantees that it will
     * handle values outside its set gracefully and falls back
     * to a default value when unknown.
     *
     * If this property is not present the client only supports
     * the completion items kinds from `Text` to `Reference` as defined in
     * the initial version of the protocol.
     */
    valueSet?: CompletionItemKind[];
}


1006
1007
1008
# File 'lib/lsp/lsp_protocol.rb', line 1006

def contextSupport
  @contextSupport
end

#dynamicRegistrationObject

type: boolean # type: {



951
952
953
# File 'lib/lsp/lsp_protocol.rb', line 951

def dynamicRegistration
  @dynamicRegistration
end

Instance Method Details

#from_h!(value) ⇒ Object



1013
1014
1015
1016
1017
1018
1019
1020
# File 'lib/lsp/lsp_protocol.rb', line 1013

def from_h!(value)
  value = {} if value.nil?
  self.dynamicRegistration = value['dynamicRegistration'] # Unknown type
  self.completionItem = value['completionItem'] # Unknown type
  self.completionItemKind = value['completionItemKind'] # Unknown type
  self.contextSupport = value['contextSupport'] # Unknown type
  self
end