lib/theme_check/language_server/server.rb in theme-check-0.2.2 vs lib/theme_check/language_server/server.rb in theme-check-0.3.0
- old
+ new
@@ -7,10 +7,12 @@
module LanguageServer
class DoneStreaming < StandardError; end
class IncompatibleStream < StandardError; end
class Server
+ attr_reader :handler
+
def initialize(
in_stream: STDIN,
out_stream: STDOUT,
err_stream: $DEBUG ? File.open('/tmp/lsp.log', 'a') : STDERR
)
@@ -85,11 +87,9 @@
params = request_json['params']
method_name = "on_#{to_snake_case(method_name)}"
if @handler.respond_to?(method_name)
@handler.send(method_name, id, params)
- else
- log("Handler does not respond to #{method_name}")
end
end
def to_snake_case(method_name)
method_name.gsub(/[^\w]/, '_').underscore