Class: LanguageServer::Protocol::Interface::ShowDocumentParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ShowDocumentParams
- Defined in:
- lib/language_server/protocol/interface/show_document_params.rb
Overview
Params to show a document.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#external ⇒ boolean | nil
Indicates to show the resource in an external program.
-
#initialize(uri:, external: nil, take_focus: nil, selection: nil) ⇒ ShowDocumentParams
constructor
A new instance of ShowDocumentParams.
-
#selection ⇒ Range | nil
An optional selection range if the document is a text document.
-
#take_focus ⇒ boolean | nil
An optional property to indicate whether the editor showing the document should take focus or not.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ URI
The document uri to show.
Constructor Details
#initialize(uri:, external: nil, take_focus: nil, selection: nil) ⇒ ShowDocumentParams
Returns a new instance of ShowDocumentParams.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 10 def initialize(uri:, external: nil, take_focus: nil, selection: nil) @attributes = {} @attributes[:uri] = uri @attributes[:external] = external if external @attributes[:takeFocus] = take_focus if take_focus @attributes[:selection] = selection if selection @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
61 62 63 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 61 def attributes @attributes end |
Instance Method Details
#external ⇒ boolean | nil
Indicates to show the resource in an external program. To show for example https://code.visualstudio.com/ in the default WEB browser set external to true.
35 36 37 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 35 def external attributes.fetch(:external) end |
#selection ⇒ Range | nil
An optional selection range if the document is a text document. Clients might ignore the property if an external program is started or the file is not a text file.
57 58 59 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 57 def selection attributes.fetch(:selection) end |
#take_focus ⇒ boolean | nil
An optional property to indicate whether the editor showing the document should take focus or not. Clients might ignore this property if an external program is started.
46 47 48 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 46 def take_focus attributes.fetch(:takeFocus) end |
#to_hash ⇒ Object
63 64 65 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 63 def to_hash attributes end |
#to_json(*args) ⇒ Object
67 68 69 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 67 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ URI
The document uri to show.
25 26 27 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 25 def uri attributes.fetch(:uri) end |