ensime_bridge 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ensime.rb +1 -1
- data/lib/ensime_bridge.rb +1 -15
- metadata +1 -1
data/lib/ensime.rb
CHANGED
@@ -74,7 +74,7 @@ EOF
|
|
74
74
|
puts "ensime is already running"
|
75
75
|
else
|
76
76
|
FileUtils.mkdir_p @conf['cache-dir']
|
77
|
-
out = quiet ? "/
|
77
|
+
out = quiet ? ".ensime_cache/server.log" : STDOUT
|
78
78
|
@pid = Process.spawn(
|
79
79
|
"#{@conf['java-home']}/bin/java #{@conf['java-flags']} \
|
80
80
|
-cp #{get_classpath} -Densime.config=#{@conf_path} org.ensime.server.Server",
|
data/lib/ensime_bridge.rb
CHANGED
@@ -113,6 +113,7 @@ class EnsimeBridge
|
|
113
113
|
result = nil
|
114
114
|
@logger.info "command: #{command}"
|
115
115
|
if command.start_with? "{"
|
116
|
+
@logger.info "direct send #{command}"
|
116
117
|
@socket.send command
|
117
118
|
else
|
118
119
|
result = instance_eval command
|
@@ -140,18 +141,6 @@ class EnsimeBridge
|
|
140
141
|
end
|
141
142
|
i
|
142
143
|
end
|
143
|
-
def at_point what, path, row, col, size, where = "range"
|
144
|
-
i = to_position path, row, col
|
145
|
-
req({"typehint" => what + "AtPointReq",
|
146
|
-
"file" => path,
|
147
|
-
where => {"from" => i,"to" => i + size}})
|
148
|
-
end
|
149
|
-
def type path, row, col, size
|
150
|
-
at_point "Type", path, row, col, size
|
151
|
-
end
|
152
|
-
def doc_uri path, row, col, size
|
153
|
-
at_point "DocUri", path, row, col, size, "point"
|
154
|
-
end
|
155
144
|
def complete path, row, col, contents = nil
|
156
145
|
i = to_position path, row, col
|
157
146
|
fileinfo = {"file"=>path}
|
@@ -161,8 +150,5 @@ class EnsimeBridge
|
|
161
150
|
req({"point"=>i, "maxResults"=>100,"typehint"=>"CompletionsReq",
|
162
151
|
"caseSens"=>true,"fileInfo"=> fileinfo,"reload"=>false})
|
163
152
|
end
|
164
|
-
def typecheck path
|
165
|
-
req({"typehint"=>"TypecheckFilesReq","files" => [path]})
|
166
|
-
end
|
167
153
|
end
|
168
154
|
EnsimeBridge.new(ARGV.size == 0 ? ".ensime" : ARGV[0]).run if __FILE__ == $0
|