Class: Jade::LSP::State

Inherits:
Data
  • Object
show all
Defined in:
lib/jade/lsp/state.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#buffersObject (readonly)

Returns the value of attribute buffers

Returns:

  • (Object)

    the current value of buffers



3
4
5
# File 'lib/jade/lsp/state.rb', line 3

def buffers
  @buffers
end

#registryObject (readonly)

Returns the value of attribute registry

Returns:

  • (Object)

    the current value of registry



3
4
5
# File 'lib/jade/lsp/state.rb', line 3

def registry
  @registry
end

#source_rootObject (readonly)

Returns the value of attribute source_root

Returns:

  • (Object)

    the current value of source_root



3
4
5
# File 'lib/jade/lsp/state.rb', line 3

def source_root
  @source_root
end

Class Method Details

.emptyObject



4
5
6
# File 'lib/jade/lsp/state.rb', line 4

def self.empty
  new(source_root: nil, buffers: {}, registry: nil)
end

Instance Method Details

#close(uri) ⇒ Object



16
17
18
# File 'lib/jade/lsp/state.rb', line 16

def close(uri)
  with(buffers: buffers.except(uri))
end

#put_buffer(uri, text) ⇒ Object



12
13
14
# File 'lib/jade/lsp/state.rb', line 12

def put_buffer(uri, text)
  with(buffers: buffers.merge(uri => text))
end

#set_registry(reg) ⇒ Object



20
21
22
# File 'lib/jade/lsp/state.rb', line 20

def set_registry(reg)
  with(registry: reg)
end

#with_root(root) ⇒ Object



8
9
10
# File 'lib/jade/lsp/state.rb', line 8

def with_root(root)
  with(source_root: root)
end