yoda-language-server 0.10.0 → 0.10.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +22 -27
- data/client/vscode/README.md +17 -2
- data/images/hover-method.png +0 -0
- data/images/method-complete.png +0 -0
- data/lib/yoda/services/loadable_path_resolver.rb +8 -1
- data/lib/yoda/version.rb +1 -1
- data/yoda-language-server.gemspec +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aca43eab2442fcf7e960a42490a0945b1dcce68c171dc8293c7aeb3e227b882f
|
4
|
+
data.tar.gz: 8a2c97c341fdafcb1b56388b772eed7b2dad27f092ca2900f0ad86afeeb20061
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7560acadbea2749e6a55770ad5b605e49d8a7a81dac122b429fe29c7ecdddeec4ada597bc5bc891c2e9428b17c46c8d094d409cda613521ea08be6d3c99362f4
|
7
|
+
data.tar.gz: 7f27afd1912aa6abf694792bf0cb61935d8e67293f3c1320b8797a578f3e422c8f63b1502d23d0ed543c371e9fafc00580cfdff88e116ff1e32dce80deb3a244
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,20 +1,31 @@
|
|
1
|
-
# Yoda [](https://github.com/tomoasleep/yoda/actions/workflows/test.yml)
|
2
2
|
|
3
3
|
Yoda is a Language Server (http://langserver.org/) for Ruby.
|
4
4
|
Yoda infers signatures of your Ruby program and its dependencies from various data sources (RBS and YARD documentation) and provides autocompletion and code analysis (go-to-definition, code information, etc...).
|
5
5
|
|
6
6
|
**Note: Yoda is alpha version. Please use with caution. Contributions are welcome!**
|
7
7
|
|
8
|
-
##
|
8
|
+
## Supporting Features
|
9
9
|
|
10
|
-
|
10
|
+
Yoda provides these features by analyzing Ruby code and its dependencies in Gemfile.lock with YARD.
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
* Code completion (method, constant, variables, etc...)
|
13
|
+
* Comment completion (YARD tag, types)
|
14
|
+
* Hover code information (method, constant, etc...)
|
15
|
+
* Go to definition (method, constant, require file, etc...)
|
16
|
+
|
17
|
+

|
18
|
+
|
19
|
+

|
20
|
+
|
21
|
+
## Install VSCode Extension (Recommended)
|
16
22
|
|
17
|
-
|
23
|
+
Yoda can be available as VSCode extension at: https://marketplace.visualstudio.com/items?itemName=tomoasleep.yoda
|
24
|
+
On launch of VSCode, Yoda will be installed automatically.
|
25
|
+
|
26
|
+
## Other installation methods
|
27
|
+
|
28
|
+
### Install language server gem
|
18
29
|
|
19
30
|
Yoda is hosted on RubyGems.
|
20
31
|
|
@@ -33,7 +44,7 @@ $ yoda infer path-to-your-code:line_num:char_num # Show information of the code
|
|
33
44
|
$ yoda complete <path-to-your-code>:<line-num>:<char-num> # Show completion at the specified position.
|
34
45
|
```
|
35
46
|
|
36
|
-
###
|
47
|
+
### Install Editor Plugin
|
37
48
|
|
38
49
|
#### Atom
|
39
50
|
|
@@ -41,7 +52,7 @@ $ yoda complete <path-to-your-code>:<line-num>:<char-num> # Show completion at t
|
|
41
52
|
apm install tomoasleep/yoda
|
42
53
|
```
|
43
54
|
|
44
|
-
|
55
|
+
#### VSCode (from source code)
|
45
56
|
|
46
57
|
```
|
47
58
|
rake vscode:install
|
@@ -69,29 +80,13 @@ TBW
|
|
69
80
|
Yoda figures structures of your source codes and library codes with YARD.
|
70
81
|
Yoda intepret YARD tags such as `@return` tags and `@param` tags and infer code types from these information.
|
71
82
|
|
83
|
+
|
72
84
|
### Indexing
|
73
85
|
|
74
86
|
Yoda built index files for fast inference under `<your-project-dir>/.yoda` at startup.
|
75
87
|
These index files contains structures of external sources (gems and standard libraries).
|
76
88
|
Your project codes are parsed at startup but does not stored in indexes.
|
77
89
|
|
78
|
-
### Supporting Features
|
79
|
-
|
80
|
-
- autocompletion
|
81
|
-
- [x] method completion
|
82
|
-
- [x] constant completion
|
83
|
-
- [x] (local, class, instance) variable completion
|
84
|
-
- comment completion
|
85
|
-
- [x] YARD tag completion
|
86
|
-
- [x] YARD type literal completion
|
87
|
-
- [x] parameter completion
|
88
|
-
- [x] jump to definition
|
89
|
-
- [x] hover
|
90
|
-
- [x] signature help
|
91
|
-
- [x] find references
|
92
|
-
- [x] workspace symbols
|
93
|
-
- [ ] diagnostics
|
94
|
-
|
95
90
|
## Development
|
96
91
|
|
97
92
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/client/vscode/README.md
CHANGED
@@ -1,11 +1,26 @@
|
|
1
|
-
#
|
1
|
+
# Yoda (Ruby Language Server)
|
2
|
+
|
3
|
+
This extension provides Ruby development features by Yoda (a Ruby language server).
|
2
4
|
|
3
5
|
## Features
|
4
6
|
|
7
|
+
Yoda provides these features by analyzing Ruby code and its dependencies in Gemfile.lock with YARD.
|
8
|
+
|
9
|
+
* Code completion (method, constant, variables, etc...)
|
10
|
+
* Comment completion (YARD tag, types)
|
11
|
+
* Hover code information (method, constant, etc...)
|
12
|
+
* Go to definition (method, constant, require file, etc...)
|
13
|
+
|
14
|
+

|
15
|
+
|
16
|
+

|
17
|
+
|
18
|
+
See: https://github.com/tomoasleep/yoda
|
5
19
|
|
6
20
|
## Requirements
|
7
21
|
|
8
|
-
|
22
|
+
This extension automatically installs [yoda-language-server](https://rubygems.org/gems/yoda-language-server) gem.
|
23
|
+
(If you want to install manually, please refer https://github.com/tomoasleep/yoda)
|
9
24
|
|
10
25
|
## Release Notes
|
11
26
|
|
Binary file
|
Binary file
|
@@ -9,7 +9,7 @@ module Yoda
|
|
9
9
|
# @return [String, nil]
|
10
10
|
def find_loadable_path(base_paths, pattern)
|
11
11
|
# TODO: Support absolute path
|
12
|
-
return nil if
|
12
|
+
return nil if absolute_path?(pattern)
|
13
13
|
return nil if pattern.start_with?("~/")
|
14
14
|
return nil if pattern.start_with?("./")
|
15
15
|
return nil if pattern.start_with?("../")
|
@@ -28,6 +28,13 @@ module Yoda
|
|
28
28
|
|
29
29
|
return nil
|
30
30
|
end
|
31
|
+
|
32
|
+
# This is a workaround for Ruby 2.6 (This version does not have `File.absolute_path?`)
|
33
|
+
# @param path [String]
|
34
|
+
# @return [Boolean]
|
35
|
+
def absolute_path?(path)
|
36
|
+
path[0] == "/"
|
37
|
+
end
|
31
38
|
end
|
32
39
|
end
|
33
40
|
end
|
data/lib/yoda/version.rb
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency 'rubyzip', '>= 1.0.0'
|
35
35
|
|
36
36
|
spec.add_development_dependency "bundler"
|
37
|
-
spec.add_development_dependency "rake"
|
37
|
+
spec.add_development_dependency "rake"
|
38
38
|
spec.add_development_dependency "rspec"
|
39
39
|
spec.add_development_dependency "rspec-benchmark"
|
40
40
|
spec.add_development_dependency "pry"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yoda-language-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomoya Chiba
|
@@ -182,16 +182,16 @@ dependencies:
|
|
182
182
|
name: rake
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - "
|
185
|
+
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: '
|
187
|
+
version: '0'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- - "
|
192
|
+
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
194
|
+
version: '0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: rspec
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -326,6 +326,8 @@ files:
|
|
326
326
|
- client/vscode/tsconfig.json
|
327
327
|
- client/vscode/vsc-extension-quickstart.md
|
328
328
|
- exe/yoda
|
329
|
+
- images/hover-method.png
|
330
|
+
- images/method-complete.png
|
329
331
|
- lib/yoda.rb
|
330
332
|
- lib/yoda/ast.rb
|
331
333
|
- lib/yoda/ast/array_node.rb
|
@@ -725,7 +727,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
725
727
|
- !ruby/object:Gem::Version
|
726
728
|
version: '0'
|
727
729
|
requirements: []
|
728
|
-
rubygems_version: 3.2.
|
730
|
+
rubygems_version: 3.2.32
|
729
731
|
signing_key:
|
730
732
|
specification_version: 4
|
731
733
|
summary: Ruby completion engine
|