Class: LanguageServer::Protocol::Interface::NotebookCellTextDocumentFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb

Overview

A notebook cell text document filter denotes a cell text document by different properties.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notebook:, language: nil) ⇒ NotebookCellTextDocumentFilter

Returns a new instance of NotebookCellTextDocumentFilter.

Since:

  • 3.17.0



11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 11

def initialize(notebook:, language: nil)
  @attributes = {}

  @attributes[:notebook] = notebook
  @attributes[:language] = language if language

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.17.0



42
43
44
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 42

def attributes
  @attributes
end

Instance Method Details

#languagestring | nil

A language id like python.

Will be matched against the language id of the notebook cell document. ‘*’ matches every language.

Returns:

  • (string | nil)

Since:

  • 3.17.0



38
39
40
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 38

def language
  attributes.fetch(:language)
end

#notebookstring | NotebookDocumentFilter

A filter that matches against the notebook containing the notebook cell. If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.

Returns:

Since:

  • 3.17.0



27
28
29
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 27

def notebook
  attributes.fetch(:notebook)
end

#to_hashObject

Since:

  • 3.17.0



44
45
46
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 44

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17.0



48
49
50
# File 'lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb', line 48

def to_json(*args)
  to_hash.to_json(*args)
end