yoda-language-server 0.8.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 +18 -0
- data/README.md +22 -27
- data/client/vscode/README.md +17 -2
- data/client/vscode/package-lock.json +908 -817
- data/client/vscode/package.json +17 -7
- data/client/vscode/src/check-versions.ts +49 -0
- data/client/vscode/src/config.ts +8 -1
- data/client/vscode/src/extension.ts +4 -3
- data/client/vscode/src/install-tools.ts +56 -16
- data/client/vscode/src/language-server.ts +5 -0
- data/client/vscode/src/test/runTest.ts +1 -1
- data/client/vscode/src/test/suite/hover.test.ts +13 -25
- data/client/vscode/src/test/suite/index.ts +1 -2
- data/client/vscode/src/utils.ts +11 -0
- data/images/hover-method.png +0 -0
- data/images/method-complete.png +0 -0
- data/lib/yoda/cli/analyze_deps.rb +46 -25
- data/lib/yoda/id_mask.rb +84 -0
- data/lib/yoda/instrument.rb +7 -0
- data/lib/yoda/model/descriptions/require_path_description.rb +45 -0
- data/lib/yoda/model/descriptions.rb +1 -0
- data/lib/yoda/model/node_signatures/node.rb +9 -1
- data/lib/yoda/model/values/literal_value.rb +3 -0
- data/lib/yoda/parsing/location.rb +9 -0
- data/lib/yoda/server/concurrent_writer.rb +1 -1
- data/lib/yoda/server/lifecycle_handler.rb +101 -78
- data/lib/yoda/server/notifier.rb +2 -55
- data/lib/yoda/services/loadable_path_resolver.rb +40 -0
- data/lib/yoda/services.rb +1 -0
- data/lib/yoda/store/actions/read_project_files.rb +9 -7
- data/lib/yoda/store/adapters/gdbm_adapter/namespace_accessor.rb +1 -1
- data/lib/yoda/store/adapters/memory_adapter.rb +1 -1
- data/lib/yoda/store/objects/libraries_status.rb +1 -1
- data/lib/yoda/store/objects/library/core.rb +8 -0
- data/lib/yoda/store/objects/library/gem.rb +14 -3
- data/lib/yoda/store/objects/library/path_resolvable.rb +29 -0
- data/lib/yoda/store/objects/library/std.rb +9 -0
- data/lib/yoda/store/objects/library.rb +1 -0
- data/lib/yoda/store/objects/patch.rb +1 -1
- data/lib/yoda/store/objects/patch_set.rb +2 -2
- data/lib/yoda/store/project/dependency.rb +22 -4
- data/lib/yoda/store/project/file_finder.rb +20 -0
- data/lib/yoda/store/project.rb +2 -0
- data/lib/yoda/store/registry/cache.rb +2 -2
- data/lib/yoda/store/registry/composer.rb +9 -7
- data/lib/yoda/store/registry/index.rb +14 -10
- data/lib/yoda/store/registry/library_registry.rb +3 -1
- data/lib/yoda/store/registry.rb +1 -1
- data/lib/yoda/typing/constant_resolver/code_query.rb +25 -0
- data/lib/yoda/typing/constant_resolver/query.rb +12 -1
- data/lib/yoda/typing/constant_resolver.rb +13 -8
- data/lib/yoda/typing/inferencer/load_resolver.rb +37 -0
- data/lib/yoda/typing/inferencer/tracer.rb +32 -0
- data/lib/yoda/typing/inferencer.rb +3 -2
- data/lib/yoda/typing/node_info.rb +5 -0
- data/lib/yoda/typing/tree/{defined.rb → ask_defined.rb} +3 -2
- data/lib/yoda/typing/tree/base.rb +65 -20
- data/lib/yoda/typing/tree/begin.rb +5 -5
- data/lib/yoda/typing/tree/block_call.rb +26 -0
- data/lib/yoda/typing/tree/case.rb +8 -19
- data/lib/yoda/typing/tree/class_tree.rb +10 -18
- data/lib/yoda/typing/tree/conditional_loop.rb +15 -0
- data/lib/yoda/typing/tree/constant.rb +19 -0
- data/lib/yoda/typing/tree/constant_assignment.rb +2 -2
- data/lib/yoda/typing/tree/ensure.rb +17 -0
- data/lib/yoda/typing/tree/for.rb +7 -0
- data/lib/yoda/typing/tree/hash_tree.rb +32 -0
- data/lib/yoda/typing/tree/if.rb +10 -5
- data/lib/yoda/typing/tree/interpolation_text.rb +21 -0
- data/lib/yoda/typing/tree/literal.rb +8 -36
- data/lib/yoda/typing/tree/literal_inferable.rb +48 -0
- data/lib/yoda/typing/tree/local_exit.rb +15 -0
- data/lib/yoda/typing/tree/logical_assignment.rb +5 -5
- data/lib/yoda/typing/tree/logical_operator.rb +6 -5
- data/lib/yoda/typing/tree/method_def.rb +41 -0
- data/lib/yoda/typing/tree/method_inferable.rb +51 -0
- data/lib/yoda/typing/tree/module_tree.rb +7 -20
- data/lib/yoda/typing/tree/multiple_assignment.rb +6 -10
- data/lib/yoda/typing/tree/namespace_inferable.rb +20 -0
- data/lib/yoda/typing/tree/rescue.rb +18 -0
- data/lib/yoda/typing/tree/rescue_clause.rb +42 -0
- data/lib/yoda/typing/tree/self.rb +2 -1
- data/lib/yoda/typing/tree/send.rb +8 -60
- data/lib/yoda/typing/tree/send_inferable.rb +89 -0
- data/lib/yoda/typing/tree/singleton_class_tree.rb +24 -0
- data/lib/yoda/typing/tree/singleton_method_def.rb +41 -0
- data/lib/yoda/typing/tree/super.rb +9 -2
- data/lib/yoda/typing/tree/variable.rb +5 -10
- data/lib/yoda/typing/tree/variable_assignment.rb +11 -8
- data/lib/yoda/typing/tree/yield.rb +9 -2
- data/lib/yoda/typing/tree.rb +55 -22
- data/lib/yoda/typing.rb +1 -0
- data/lib/yoda/version.rb +1 -1
- data/lib/yoda.rb +1 -0
- data/yoda-language-server.gemspec +1 -1
- metadata +35 -18
- data/lib/yoda/typing/inferencer/ast_traverser.rb +0 -408
- data/lib/yoda/typing/tree/block.rb +0 -12
- data/lib/yoda/typing/tree/const.rb +0 -12
- data/lib/yoda/typing/tree/escape.rb +0 -12
- data/lib/yoda/typing/tree/hash_body.rb +0 -36
- data/lib/yoda/typing/tree/literal_with_interpolation.rb +0 -21
- data/lib/yoda/typing/tree/method.rb +0 -43
- data/lib/yoda/typing/tree/rescue_body.rb +0 -12
- data/lib/yoda/typing/tree/singleton_method.rb +0 -47
- data/lib/yoda/typing/tree/while.rb +0 -12
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
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Unreleased
|
|
2
|
+
## v0.10.1 - 2022-03-29
|
|
3
|
+
|
|
4
|
+
* Fix undefine method error on Ruby 2.6
|
|
5
|
+
|
|
6
|
+
## v0.10.0 - 2022-03-28
|
|
7
|
+
|
|
8
|
+
* Support go to definition on path of require clause
|
|
9
|
+
* Fix inference failure on code with constant node and super node
|
|
10
|
+
|
|
11
|
+
## v0.9.0 - 2022-03-22
|
|
12
|
+
|
|
13
|
+
* Support progress report of server initialization
|
|
14
|
+
|
|
15
|
+
## v0.8.0 - 2022-03-21
|
|
16
|
+
|
|
17
|
+
* Add CHANGELOG
|
|
18
|
+
* Added many features
|
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
|
|