Module: RubyLsp::RubyLspSlim::StorePatch
- Defined in:
- lib/ruby_lsp/ruby_lsp_slim/addon.rb
Instance Method Summary collapse
Instance Method Details
#get(uri) ⇒ Object
78 79 80 81 82 83 84 85 86 |
# File 'lib/ruby_lsp/ruby_lsp_slim/addon.rb', line 78 def get(uri) super rescue Store::NonExistingDocumentError path = uri.to_standardized_path raise unless path && File.extname(path) == ".slim" && File.file?(path) set(uri: uri, source: File.binread(path), version: 0, language_id: :slim) @state[uri.to_s] end |
#set(uri:, source:, version:, language_id:) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/ruby_lsp/ruby_lsp_slim/addon.rb', line 88 def set(uri:, source:, version:, language_id:) if language_id == :slim @state[uri.to_s] = SlimDocument.new( source: source, version: version, uri: uri, global_state: @global_state ) else super end end |