Class: Rfmt::LSP::DocumentStore
- Inherits:
-
Object
- Object
- Rfmt::LSP::DocumentStore
- Defined in:
- lib/rfmt/lsp/document_store.rb
Instance Method Summary collapse
- #change(uri, text) ⇒ Object
- #close(uri) ⇒ Object
-
#initialize ⇒ DocumentStore
constructor
A new instance of DocumentStore.
- #open(uri, text) ⇒ Object
- #source_for(uri) ⇒ Object
Constructor Details
#initialize ⇒ DocumentStore
Returns a new instance of DocumentStore.
6 7 8 |
# File 'lib/rfmt/lsp/document_store.rb', line 6 def initialize @documents = {} end |
Instance Method Details
#change(uri, text) ⇒ Object
14 15 16 |
# File 'lib/rfmt/lsp/document_store.rb', line 14 def change(uri, text) @documents[uri] = text end |
#close(uri) ⇒ Object
18 19 20 |
# File 'lib/rfmt/lsp/document_store.rb', line 18 def close(uri) @documents.delete(uri) end |
#open(uri, text) ⇒ Object
10 11 12 |
# File 'lib/rfmt/lsp/document_store.rb', line 10 def open(uri, text) @documents[uri] = text end |
#source_for(uri) ⇒ Object
22 23 24 |
# File 'lib/rfmt/lsp/document_store.rb', line 22 def source_for(uri) @documents[uri] end |