ensime_bridge 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ensime_bridge.rb +7 -2
- metadata +1 -1
data/lib/ensime_bridge.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'websocket-eventmachine-client'
|
3
3
|
require 'json'
|
4
4
|
require 'thread'
|
5
|
+
require 'base64'
|
5
6
|
require_relative 'ensime'
|
6
7
|
class EnsimeBridge
|
7
8
|
attr_accessor :socket
|
@@ -134,10 +135,14 @@ class EnsimeBridge
|
|
134
135
|
def doc_uri path, row, col, size
|
135
136
|
at_point "DocUri", path, row, col, size, "point"
|
136
137
|
end
|
137
|
-
def complete path, row, col
|
138
|
+
def complete path, row, col, contents = nil
|
138
139
|
i = to_position path, row, col
|
140
|
+
fileinfo = {"file"=>path}
|
141
|
+
if contents
|
142
|
+
fileinfo["contents"] = Base64.decode64(contents.gsub("!EOL!", "\n"))
|
143
|
+
end
|
139
144
|
req({"point"=>i, "maxResults"=>100,"typehint"=>"CompletionsReq",
|
140
|
-
"caseSens"=>true,"fileInfo"=>
|
145
|
+
"caseSens"=>true,"fileInfo"=> fileinfo,"reload"=>false})
|
141
146
|
end
|
142
147
|
def typecheck path
|
143
148
|
req({"typehint"=>"TypecheckFilesReq","files" => [path]})
|