Class: Canopus::Plugins::LocalRuntime
- Inherits:
-
Object
- Object
- Canopus::Plugins::LocalRuntime
- Defined in:
- lib/canopus/plugins/local_runtime.rb
Instance Method Summary collapse
- #close ⇒ Object
- #configure_lsp(language, command) ⇒ Object
-
#initialize(workspace, source, path, permissions) ⇒ LocalRuntime
constructor
A new instance of LocalRuntime.
- #register_action(name, description: name, &block) ⇒ Object
- #register_language(name, **options) ⇒ Object
- #register_panel(name, side: :right, &block) ⇒ Object
Constructor Details
#initialize(workspace, source, path, permissions) ⇒ LocalRuntime
Returns a new instance of LocalRuntime.
6 7 8 9 |
# File 'lib/canopus/plugins/local_runtime.rb', line 6 def initialize(workspace, source, path, ) @workspace, @plugin_id, @api = workspace, path, Canopus::Plugins::API.new(workspace, ) instance_eval(source, path, 1) end |
Instance Method Details
#close ⇒ Object
23 |
# File 'lib/canopus/plugins/local_runtime.rb', line 23 def close; end |
#configure_lsp(language, command) ⇒ Object
19 20 21 22 |
# File 'lib/canopus/plugins/local_runtime.rb', line 19 def configure_lsp(language, command) @api.permit!("process") @workspace.configure_plugin_language_server(@plugin_id, language, command) end |
#register_action(name, description: name, &block) ⇒ Object
10 11 12 13 |
# File 'lib/canopus/plugins/local_runtime.rb', line 10 def register_action(name, description: name, &block) raise ArgumentError, "action callback required" unless block @workspace.register_action(name, description: description) { block.call(@api) } end |
#register_language(name, **options) ⇒ Object
18 |
# File 'lib/canopus/plugins/local_runtime.rb', line 18 def register_language(name, **) = @workspace.register_language(name, **) |
#register_panel(name, side: :right, &block) ⇒ Object
14 15 16 17 |
# File 'lib/canopus/plugins/local_runtime.rb', line 14 def register_panel(name, side: :right, &block) raise ArgumentError, "panel callback required" unless block @workspace.register_panel(name, side: side) { block.call(@api) } end |