solargraph 0.23.2 → 0.23.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/solargraph/language_server/host.rb +12 -10
- data/lib/solargraph/language_server/message/initialize.rb +1 -3
- data/lib/solargraph/language_server/message/initialized.rb +1 -1
- data/lib/solargraph/language_server/message/workspace/did_change_configuration.rb +1 -1
- data/lib/solargraph/library.rb +5 -2
- data/lib/solargraph/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37ebc106375480d4721557e69fb312eb21c7ab0d554448e7c71c975cdebc36af
|
4
|
+
data.tar.gz: d9bd5e65e05323ade331a4d864029688bb46f1eac4456a3394e128988651c987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98be9bd79773d42e69e81cafefa214c9c6f9ea4b0fccb59386433d81dfd4718d69c97a1670c3f006f7fd445f6282a9575cb7a8f74a35b009f5f8b513496ed905
|
7
|
+
data.tar.gz: 99fb8faa39d51725271b6bb92dde96e0b61933bd2350403784cee3aee65ca5179c879d05fe32e745608a14b9f96042d4a29e9245bd77f30b59449827a4db5205
|
@@ -22,7 +22,7 @@ module Solargraph
|
|
22
22
|
@stopped = false
|
23
23
|
@next_request_id = 0
|
24
24
|
@dynamic_capabilities = Set.new
|
25
|
-
@registered_capabilities =
|
25
|
+
@registered_capabilities = Set.new
|
26
26
|
start_change_thread
|
27
27
|
start_diagnostics_thread
|
28
28
|
end
|
@@ -252,8 +252,8 @@ module Solargraph
|
|
252
252
|
def register_capabilities methods
|
253
253
|
@register_semaphore.synchronize do
|
254
254
|
send_request 'client/registerCapability', {
|
255
|
-
registrations: methods.select{|m|
|
256
|
-
@registered_capabilities.
|
255
|
+
registrations: methods.select{|m| can_register?(m) and !registered?(m)}.map { |m|
|
256
|
+
@registered_capabilities.add m
|
257
257
|
{
|
258
258
|
id: m,
|
259
259
|
method: m,
|
@@ -272,7 +272,7 @@ module Solargraph
|
|
272
272
|
def unregister_capabilities methods
|
273
273
|
@register_semaphore.synchronize do
|
274
274
|
send_request 'client/unregisterCapability', {
|
275
|
-
unregisterations: methods.select{|m|
|
275
|
+
unregisterations: methods.select{|m| registered?(m)}.map{ |m|
|
276
276
|
@registered_capabilities.delete m
|
277
277
|
{
|
278
278
|
id: m,
|
@@ -292,16 +292,18 @@ module Solargraph
|
|
292
292
|
end
|
293
293
|
end
|
294
294
|
|
295
|
+
# @param method [String]
|
296
|
+
# @return [Boolean]
|
297
|
+
def can_register? method
|
298
|
+
@dynamic_capabilities.include?(method)
|
299
|
+
end
|
300
|
+
|
295
301
|
# True if the specified method has been registered.
|
296
302
|
#
|
297
303
|
# @param method [String] The method name, e.g., 'textDocument/completion'
|
298
304
|
# @return [Boolean]
|
299
305
|
def registered? method
|
300
|
-
|
301
|
-
@register_semaphore.synchronize do
|
302
|
-
result = @registered_capabilities.include?(method)
|
303
|
-
end
|
304
|
-
result
|
306
|
+
@registered_capabilities.include?(method)
|
305
307
|
end
|
306
308
|
|
307
309
|
# True if the specified file is in the process of changing.
|
@@ -607,7 +609,7 @@ module Solargraph
|
|
607
609
|
'textDocument/documentSymbol' => {
|
608
610
|
documentSymbolProvider: true
|
609
611
|
},
|
610
|
-
'workspace/
|
612
|
+
'workspace/symbol' => {
|
611
613
|
workspaceSymbolProvider: true
|
612
614
|
}
|
613
615
|
}
|
@@ -105,9 +105,7 @@ module Solargraph
|
|
105
105
|
params['capabilities'][section] and
|
106
106
|
params['capabilities'][section][capability] and
|
107
107
|
params['capabilities'][section][capability]['dynamicRegistration'])
|
108
|
-
#
|
109
|
-
adjcap = (section == 'workspace' and capability == 'symbol') ? 'workspaceSymbol' : capability
|
110
|
-
host.allow_registration("#{section}/#{adjcap}") if result
|
108
|
+
host.allow_registration("#{section}/#{capability}") if result
|
111
109
|
result
|
112
110
|
end
|
113
111
|
end
|
@@ -17,7 +17,7 @@ module Solargraph::LanguageServer::Message::Workspace
|
|
17
17
|
(host.options['hover'] ? y : n).push('textDocument/hover', 'textDocument/signatureHelp')
|
18
18
|
(host.options['autoformat'] ? y : n).push('textDocument/onTypeFormatting')
|
19
19
|
(host.options['formatting'] ? y : n).push('textDocument/formatting')
|
20
|
-
(host.options['symbols'] ? y : n).push('textDocument/documentSymbol', 'workspace/
|
20
|
+
(host.options['symbols'] ? y : n).push('textDocument/documentSymbol', 'workspace/symbol')
|
21
21
|
(host.options['definitions'] ? y : n).push('textDocument/definition')
|
22
22
|
(host.options['references'] ? y : n).push('textDocument/references')
|
23
23
|
host.register_capabilities y
|
data/lib/solargraph/library.rb
CHANGED
@@ -96,8 +96,11 @@ module Solargraph
|
|
96
96
|
def overwrite filename, version
|
97
97
|
source = source_hash[filename]
|
98
98
|
return if source.nil?
|
99
|
-
|
100
|
-
|
99
|
+
if source.version > version
|
100
|
+
STDERR.puts "Save out of sync for #{filename} (current #{source.version}, overwrite #{version})" if source.version > version
|
101
|
+
else
|
102
|
+
open filename, File.read(filename), version
|
103
|
+
end
|
101
104
|
end
|
102
105
|
|
103
106
|
# Get completion suggestions at the specified file and location.
|
data/lib/solargraph/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solargraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Snyder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|