Class: Rucoa::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rucoa/configuration.rb

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
# File 'lib/rucoa/configuration.rb', line 5

def initialize
  @settings = {}
end

Instance Method Details

#disable_code_actionvoid

This method returns an undefined value.



10
11
12
# File 'lib/rucoa/configuration.rb', line 10

def disable_code_action
  disable_feature('codeAction')
end

#disable_completionvoid

This method returns an undefined value.



15
16
17
# File 'lib/rucoa/configuration.rb', line 15

def disable_completion
  disable_feature('completion')
end

#disable_definitionvoid

This method returns an undefined value.



20
21
22
# File 'lib/rucoa/configuration.rb', line 20

def disable_definition
  disable_feature('definition')
end

#disable_diagnosticsvoid

This method returns an undefined value.



25
26
27
# File 'lib/rucoa/configuration.rb', line 25

def disable_diagnostics
  disable_feature('diagnostics')
end

#disable_document_symbolvoid

This method returns an undefined value.



30
31
32
# File 'lib/rucoa/configuration.rb', line 30

def disable_document_symbol
  disable_feature('documentSymbol')
end

#disable_formattingvoid

This method returns an undefined value.



35
36
37
# File 'lib/rucoa/configuration.rb', line 35

def disable_formatting
  disable_feature('formatting')
end

#disable_highlightvoid

This method returns an undefined value.



40
41
42
# File 'lib/rucoa/configuration.rb', line 40

def disable_highlight
  disable_feature('highlight')
end

#disable_hovervoid

This method returns an undefined value.



45
46
47
# File 'lib/rucoa/configuration.rb', line 45

def disable_hover
  disable_feature('hover')
end

#disable_selection_rangevoid

This method returns an undefined value.



50
51
52
# File 'lib/rucoa/configuration.rb', line 50

def disable_selection_range
  disable_feature('selectionRange')
end

#disable_signature_helpvoid

This method returns an undefined value.



55
56
57
# File 'lib/rucoa/configuration.rb', line 55

def disable_signature_help
  disable_feature('signatureHelp')
end

#enable_debugvoid

This method returns an undefined value.



60
61
62
63
64
# File 'lib/rucoa/configuration.rb', line 60

def enable_debug
  @settings ||= {}
  @settings['base'] ||= {}
  @settings['base']['debug'] = true
end

#enables_code_action?Boolean

Examples:

returns true if the configuration is empty

configuration = Rucoa::Configuration.new
expect(configuration).to be_enables_code_action

returns false if the configuration disables code action

configuration = Rucoa::Configuration.new
configuration.disable_code_action
expect(configuration).not_to be_enables_code_action

Returns:

  • (Boolean)


74
75
76
# File 'lib/rucoa/configuration.rb', line 74

def enables_code_action?
  enables_feature?('codeAction')
end

#enables_completion?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/rucoa/configuration.rb', line 79

def enables_completion?
  enables_feature?('completion')
end

#enables_debug?Boolean

Examples:

returns false if the configuration is empty

configuration = Rucoa::Configuration.new
expect(configuration).not_to be_enables_debug

returns true if the configuration enables debug

configuration = Rucoa::Configuration.new
configuration.update('base' => { 'debug' => true })
expect(configuration).to be_enables_debug

Returns:

  • (Boolean)


91
92
93
# File 'lib/rucoa/configuration.rb', line 91

def enables_debug?
  fetch('base', 'debug', default: false)
end

#enables_definition?Boolean

Returns:

  • (Boolean)


96
97
98
# File 'lib/rucoa/configuration.rb', line 96

def enables_definition?
  enables_feature?('definition')
end

#enables_diagnostics?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/rucoa/configuration.rb', line 101

def enables_diagnostics?
  enables_feature?('diagnostics')
end

#enables_document_symbol?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'lib/rucoa/configuration.rb', line 106

def enables_document_symbol?
  enables_feature?('documentSymbol')
end

#enables_formatting?Boolean

Returns:

  • (Boolean)


111
112
113
# File 'lib/rucoa/configuration.rb', line 111

def enables_formatting?
  enables_feature?('formatting')
end

#enables_highlight?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/rucoa/configuration.rb', line 116

def enables_highlight?
  enables_feature?('highlight')
end

#enables_hover?Boolean

Returns:

  • (Boolean)


121
122
123
# File 'lib/rucoa/configuration.rb', line 121

def enables_hover?
  enables_feature?('hover')
end

#enables_selection_range?Boolean

Returns:

  • (Boolean)


126
127
128
# File 'lib/rucoa/configuration.rb', line 126

def enables_selection_range?
  enables_feature?('selectionRange')
end

#enables_signature_help?Boolean

Returns:

  • (Boolean)


131
132
133
# File 'lib/rucoa/configuration.rb', line 131

def enables_signature_help?
  enables_feature?('signatureHelp')
end

#update(settings) ⇒ void

This method returns an undefined value.

Parameters:

  • settings (Hash)


137
138
139
# File 'lib/rucoa/configuration.rb', line 137

def update(settings)
  @settings = settings
end