Skip to content

Commit

Permalink
Merge pull request puppetlabs#179 from glennsarti/get-client-config
Browse files Browse the repository at this point in the history
(puppetlabsGH-177) Add ability to fetch the client configuration
  • Loading branch information
jpogran authored Sep 12, 2019
2 parents 2d3c745 + fb96652 commit f50d75c
Show file tree
Hide file tree
Showing 16 changed files with 1,384 additions and 25 deletions.
5 changes: 4 additions & 1 deletion lib/lsp/lsp.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# frozen_string_literal: true

%w[lsp_base lsp_enums lsp_protocol lsp_types lsp_custom].each do |lib|
# DO NOT MODIFY. This file is built automatically
# See tools/lsp_introspect/index.js

%w[lsp_base lsp_custom lsp_types lsp_enums lsp_protocol_colorprovider lsp_protocol_configuration lsp_protocol lsp_protocol_declaration lsp_protocol_foldingrange lsp_protocol_implementation lsp_protocol_typedefinition lsp_protocol_workspacefolders].each do |lib|
begin
require "lsp/#{lib}"
rescue LoadError
Expand Down
134 changes: 134 additions & 0 deletions lib/lsp/lsp_protocol_colorprovider.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# frozen_string_literal: true

# DO NOT MODIFY. This file is built automatically
# LSP Protocol: vscode-languageserver-protocol/lib/protocol.colorProvider.d.ts

# rubocop:disable Layout/EmptyLinesAroundClassBody
# rubocop:disable Lint/UselessAssignment
# rubocop:disable Style/AsciiComments

module LSP
# export interface ColorClientCapabilities {
# /**
# * The text document client capabilities
# */
# textDocument?: {
# /**
# * Capabilities specific to the colorProvider
# */
# colorProvider?: {
# /**
# * Whether implementation supports dynamic registration. If this is set to `true`
# * the client supports the new `(ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
# * return value for the corresponding server capability as well.
# */
# dynamicRegistration?: boolean;
# };
# };
# }
class ColorClientCapabilities < LSPBase
attr_accessor :textDocument # type: {
# /**
# * Capabilities specific to the colorProvider
# */
# colorProvider?: {
# /**
# * Whether implementation supports dynamic registration. If this is set to `true`
# * the client supports the new `(ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
# * return value for the corresponding server capability as well.
# */
# dynamicRegistration?: boolean;
# };
# }

def initialize(initial_hash = nil)
super
@optional_method_names = %i[textDocument]
end

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

# export interface ColorProviderOptions {
# }
class ColorProviderOptions < LSPBase

def from_h!(value)
value = {} if value.nil?
self
end
end

# export interface ColorServerCapabilities {
# /**
# * The server provides color provider support.
# */
# colorProvider?: boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
# }
class ColorServerCapabilities < LSPBase
attr_accessor :colorProvider # type: boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)

def initialize(initial_hash = nil)
super
@optional_method_names = %i[colorProvider]
end

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

# export interface DocumentColorParams {
# /**
# * The text document.
# */
# textDocument: TextDocumentIdentifier;
# }
class DocumentColorParams < LSPBase
attr_accessor :textDocument # type: TextDocumentIdentifier

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

# export interface ColorPresentationParams {
# /**
# * The text document.
# */
# textDocument: TextDocumentIdentifier;
# /**
# * The color to request presentations for.
# */
# color: Color;
# /**
# * The range where the color would be inserted. Serves as a context.
# */
# range: Range;
# }
class ColorPresentationParams < LSPBase
attr_accessor :textDocument # type: TextDocumentIdentifier
attr_accessor :color # type: Color
attr_accessor :range # type: Range

def from_h!(value)
value = {} if value.nil?
self.textDocument = value['textDocument'] # Unknown type
self.color = value['color'] # Unknown type
self.range = value['range'] # Unknown type
self
end
end
end

# rubocop:enable Layout/EmptyLinesAroundClassBody
# rubocop:enable Lint/UselessAssignment
# rubocop:enable Style/AsciiComments
85 changes: 85 additions & 0 deletions lib/lsp/lsp_protocol_configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# frozen_string_literal: true

# DO NOT MODIFY. This file is built automatically
# LSP Protocol: vscode-languageserver-protocol/lib/protocol.configuration.d.ts

# rubocop:disable Layout/EmptyLinesAroundClassBody
# rubocop:disable Lint/UselessAssignment
# rubocop:disable Style/AsciiComments

module LSP
# export interface ConfigurationClientCapabilities {
# /**
# * The workspace client capabilities
# */
# workspace?: {
# /**
# * The client supports `workspace/configuration` requests.
# */
# configuration?: boolean;
# };
# }
class ConfigurationClientCapabilities < LSPBase
attr_accessor :workspace # type: {
# /**
# * The client supports `workspace/configuration` requests.
# */
# configuration?: boolean;
# }

def initialize(initial_hash = nil)
super
@optional_method_names = %i[workspace]
end

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

# export interface ConfigurationItem {
# /**
# * The scope to get the configuration section for.
# */
# scopeUri?: string;
# /**
# * The configuration section asked for.
# */
# section?: string;
# }
class ConfigurationItem < LSPBase
attr_accessor :scopeUri # type: string
attr_accessor :section # type: string

def initialize(initial_hash = nil)
super
@optional_method_names = %i[scopeUri section]
end

def from_h!(value)
value = {} if value.nil?
self.scopeUri = value['scopeUri']
self.section = value['section']
self
end
end

# export interface ConfigurationParams {
# items: ConfigurationItem[];
# }
class ConfigurationParams < LSPBase
attr_accessor :items # type: ConfigurationItem[]

def from_h!(value)
value = {} if value.nil?
self.items = to_typed_aray(value['items'], ConfigurationItem)
self
end
end
end

# rubocop:enable Layout/EmptyLinesAroundClassBody
# rubocop:enable Lint/UselessAssignment
# rubocop:enable Style/AsciiComments
88 changes: 88 additions & 0 deletions lib/lsp/lsp_protocol_declaration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# frozen_string_literal: true

# DO NOT MODIFY. This file is built automatically
# LSP Protocol: vscode-languageserver-protocol/lib/protocol.declaration.d.ts

# rubocop:disable Layout/EmptyLinesAroundClassBody
# rubocop:disable Lint/UselessAssignment
# rubocop:disable Style/AsciiComments

module LSP
# export interface DeclarationClientCapabilities {
# /**
# * The text document client capabilities
# */
# textDocument?: {
# /**
# * Capabilities specific to the `textDocument/declaration`
# */
# declaration?: {
# /**
# * Whether declaration supports dynamic registration. If this is set to `true`
# * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
# * return value for the corresponding server capability as well.
# */
# dynamicRegistration?: boolean;
# /**
# * The client supports additional metadata in the form of declaration links.
# */
# linkSupport?: boolean;
# };
# };
# }
class DeclarationClientCapabilities < LSPBase
attr_accessor :textDocument # type: {
# /**
# * Capabilities specific to the `textDocument/declaration`
# */
# declaration?: {
# /**
# * Whether declaration supports dynamic registration. If this is set to `true`
# * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
# * return value for the corresponding server capability as well.
# */
# dynamicRegistration?: boolean;
# /**
# * The client supports additional metadata in the form of declaration links.
# */
# linkSupport?: boolean;
# };
# }

def initialize(initial_hash = nil)
super
@optional_method_names = %i[textDocument]
end

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

# export interface DeclarationServerCapabilities {
# /**
# * The server provides Goto Type Definition support.
# */
# declarationProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
# }
class DeclarationServerCapabilities < LSPBase
attr_accessor :declarationProvider # type: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions)

def initialize(initial_hash = nil)
super
@optional_method_names = %i[declarationProvider]
end

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

# rubocop:enable Layout/EmptyLinesAroundClassBody
# rubocop:enable Lint/UselessAssignment
# rubocop:enable Style/AsciiComments
Loading

0 comments on commit f50d75c

Please sign in to comment.