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 resource.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#external ⇒ boolean
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
An optional selection range if the document is a text document.
-
#take_focus ⇒ boolean
An optional property to indicate whether the editor showing the document should take focus or not.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ string
The uri to show.
Constructor Details
#initialize(uri:, external: nil, take_focus: nil, selection: nil) ⇒ ShowDocumentParams
Returns a new instance of ShowDocumentParams.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 8 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)
Returns the value of attribute attributes.
59 60 61 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 59 def attributes @attributes end |
Instance Method Details
#external ⇒ boolean
Indicates to show the resource in an external program. To show, for example, ‘code.visualstudio.com/` in the default WEB browser set `external` to `true`.
33 34 35 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 33 def external attributes.fetch(:external) end |
#selection ⇒ Range
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.
55 56 57 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 55 def selection attributes.fetch(:selection) end |
#take_focus ⇒ boolean
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.
44 45 46 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 44 def take_focus attributes.fetch(:takeFocus) end |
#to_hash ⇒ Object
61 62 63 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 61 def to_hash attributes end |
#to_json(*args) ⇒ Object
65 66 67 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 65 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ string
The uri to show.
23 24 25 |
# File 'lib/language_server/protocol/interface/show_document_params.rb', line 23 def uri attributes.fetch(:uri) end |