yoda-language-server 0.8.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +22 -27
  4. data/client/vscode/README.md +17 -2
  5. data/client/vscode/package-lock.json +908 -817
  6. data/client/vscode/package.json +17 -7
  7. data/client/vscode/src/check-versions.ts +49 -0
  8. data/client/vscode/src/config.ts +8 -1
  9. data/client/vscode/src/extension.ts +4 -3
  10. data/client/vscode/src/install-tools.ts +56 -16
  11. data/client/vscode/src/language-server.ts +5 -0
  12. data/client/vscode/src/test/runTest.ts +1 -1
  13. data/client/vscode/src/test/suite/hover.test.ts +13 -25
  14. data/client/vscode/src/test/suite/index.ts +1 -2
  15. data/client/vscode/src/utils.ts +11 -0
  16. data/images/hover-method.png +0 -0
  17. data/images/method-complete.png +0 -0
  18. data/lib/yoda/cli/analyze_deps.rb +46 -25
  19. data/lib/yoda/id_mask.rb +84 -0
  20. data/lib/yoda/instrument.rb +7 -0
  21. data/lib/yoda/model/descriptions/require_path_description.rb +45 -0
  22. data/lib/yoda/model/descriptions.rb +1 -0
  23. data/lib/yoda/model/node_signatures/node.rb +9 -1
  24. data/lib/yoda/model/values/literal_value.rb +3 -0
  25. data/lib/yoda/parsing/location.rb +9 -0
  26. data/lib/yoda/server/concurrent_writer.rb +1 -1
  27. data/lib/yoda/server/lifecycle_handler.rb +101 -78
  28. data/lib/yoda/server/notifier.rb +2 -55
  29. data/lib/yoda/services/loadable_path_resolver.rb +40 -0
  30. data/lib/yoda/services.rb +1 -0
  31. data/lib/yoda/store/actions/read_project_files.rb +9 -7
  32. data/lib/yoda/store/adapters/gdbm_adapter/namespace_accessor.rb +1 -1
  33. data/lib/yoda/store/adapters/memory_adapter.rb +1 -1
  34. data/lib/yoda/store/objects/libraries_status.rb +1 -1
  35. data/lib/yoda/store/objects/library/core.rb +8 -0
  36. data/lib/yoda/store/objects/library/gem.rb +14 -3
  37. data/lib/yoda/store/objects/library/path_resolvable.rb +29 -0
  38. data/lib/yoda/store/objects/library/std.rb +9 -0
  39. data/lib/yoda/store/objects/library.rb +1 -0
  40. data/lib/yoda/store/objects/patch.rb +1 -1
  41. data/lib/yoda/store/objects/patch_set.rb +2 -2
  42. data/lib/yoda/store/project/dependency.rb +22 -4
  43. data/lib/yoda/store/project/file_finder.rb +20 -0
  44. data/lib/yoda/store/project.rb +2 -0
  45. data/lib/yoda/store/registry/cache.rb +2 -2
  46. data/lib/yoda/store/registry/composer.rb +9 -7
  47. data/lib/yoda/store/registry/index.rb +14 -10
  48. data/lib/yoda/store/registry/library_registry.rb +3 -1
  49. data/lib/yoda/store/registry.rb +1 -1
  50. data/lib/yoda/typing/constant_resolver/code_query.rb +25 -0
  51. data/lib/yoda/typing/constant_resolver/query.rb +12 -1
  52. data/lib/yoda/typing/constant_resolver.rb +13 -8
  53. data/lib/yoda/typing/inferencer/load_resolver.rb +37 -0
  54. data/lib/yoda/typing/inferencer/tracer.rb +32 -0
  55. data/lib/yoda/typing/inferencer.rb +3 -2
  56. data/lib/yoda/typing/node_info.rb +5 -0
  57. data/lib/yoda/typing/tree/{defined.rb → ask_defined.rb} +3 -2
  58. data/lib/yoda/typing/tree/base.rb +65 -20
  59. data/lib/yoda/typing/tree/begin.rb +5 -5
  60. data/lib/yoda/typing/tree/block_call.rb +26 -0
  61. data/lib/yoda/typing/tree/case.rb +8 -19
  62. data/lib/yoda/typing/tree/class_tree.rb +10 -18
  63. data/lib/yoda/typing/tree/conditional_loop.rb +15 -0
  64. data/lib/yoda/typing/tree/constant.rb +19 -0
  65. data/lib/yoda/typing/tree/constant_assignment.rb +2 -2
  66. data/lib/yoda/typing/tree/ensure.rb +17 -0
  67. data/lib/yoda/typing/tree/for.rb +7 -0
  68. data/lib/yoda/typing/tree/hash_tree.rb +32 -0
  69. data/lib/yoda/typing/tree/if.rb +10 -5
  70. data/lib/yoda/typing/tree/interpolation_text.rb +21 -0
  71. data/lib/yoda/typing/tree/literal.rb +8 -36
  72. data/lib/yoda/typing/tree/literal_inferable.rb +48 -0
  73. data/lib/yoda/typing/tree/local_exit.rb +15 -0
  74. data/lib/yoda/typing/tree/logical_assignment.rb +5 -5
  75. data/lib/yoda/typing/tree/logical_operator.rb +6 -5
  76. data/lib/yoda/typing/tree/method_def.rb +41 -0
  77. data/lib/yoda/typing/tree/method_inferable.rb +51 -0
  78. data/lib/yoda/typing/tree/module_tree.rb +7 -20
  79. data/lib/yoda/typing/tree/multiple_assignment.rb +6 -10
  80. data/lib/yoda/typing/tree/namespace_inferable.rb +20 -0
  81. data/lib/yoda/typing/tree/rescue.rb +18 -0
  82. data/lib/yoda/typing/tree/rescue_clause.rb +42 -0
  83. data/lib/yoda/typing/tree/self.rb +2 -1
  84. data/lib/yoda/typing/tree/send.rb +8 -60
  85. data/lib/yoda/typing/tree/send_inferable.rb +89 -0
  86. data/lib/yoda/typing/tree/singleton_class_tree.rb +24 -0
  87. data/lib/yoda/typing/tree/singleton_method_def.rb +41 -0
  88. data/lib/yoda/typing/tree/super.rb +9 -2
  89. data/lib/yoda/typing/tree/variable.rb +5 -10
  90. data/lib/yoda/typing/tree/variable_assignment.rb +11 -8
  91. data/lib/yoda/typing/tree/yield.rb +9 -2
  92. data/lib/yoda/typing/tree.rb +55 -22
  93. data/lib/yoda/typing.rb +1 -0
  94. data/lib/yoda/version.rb +1 -1
  95. data/lib/yoda.rb +1 -0
  96. data/yoda-language-server.gemspec +1 -1
  97. metadata +35 -18
  98. data/lib/yoda/typing/inferencer/ast_traverser.rb +0 -408
  99. data/lib/yoda/typing/tree/block.rb +0 -12
  100. data/lib/yoda/typing/tree/const.rb +0 -12
  101. data/lib/yoda/typing/tree/escape.rb +0 -12
  102. data/lib/yoda/typing/tree/hash_body.rb +0 -36
  103. data/lib/yoda/typing/tree/literal_with_interpolation.rb +0 -21
  104. data/lib/yoda/typing/tree/method.rb +0 -43
  105. data/lib/yoda/typing/tree/rescue_body.rb +0 -12
  106. data/lib/yoda/typing/tree/singleton_method.rb +0 -47
  107. data/lib/yoda/typing/tree/while.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18cb55e5cd8509c2745109f37bd32b94347a2f6740bf982dbcc7d2d436070410
4
- data.tar.gz: cd748b6986f9f673646c50b69806c8459023e2ed398fe3ced988b2e0b6c654eb
3
+ metadata.gz: aca43eab2442fcf7e960a42490a0945b1dcce68c171dc8293c7aeb3e227b882f
4
+ data.tar.gz: 8a2c97c341fdafcb1b56388b772eed7b2dad27f092ca2900f0ad86afeeb20061
5
5
  SHA512:
6
- metadata.gz: 4a66918e474a09349c98587414d01f71efcd232724ce9a9854634eeb79ed0ca83a4f848a9bd2250f99540b3b80a5649512610ed16f3a85f2be7de748a2bdf827
7
- data.tar.gz: 7b3021e01a8b3415154f7746a6009d1043065f094070119c588c203e4b839340fbf0950bfe7e2aa7cba3d9b7c4ea12951efed6f9efeab729dde08673513768e0
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 [![Build Status](https://travis-ci.org/tomoasleep/yoda.svg?branch=master)](https://travis-ci.org/tomoasleep/yoda)
1
+ # Yoda [![Test](https://github.com/tomoasleep/yoda/actions/workflows/test.yml/badge.svg)](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
- ## Instation and Usage
8
+ ## Supporting Features
9
9
 
10
- ## Getting Started
10
+ Yoda provides these features by analyzing Ruby code and its dependencies in Gemfile.lock with YARD.
11
11
 
12
- ```bash
13
- rake install # Install language server
14
- rake vscode:install # Install vscode plugin
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
+ ![](https://github.com/tomoasleep/yoda/blob/master/images/method-complete.png)
18
+
19
+ ![](https://github.com/tomoasleep/yoda/blob/master/images/hover-method.png)
20
+
21
+ ## Install VSCode Extension (Recommended)
16
22
 
17
- ### Install language server
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
- ### Installation of Editor Plugin
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
- ### VSCode
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.
@@ -1,11 +1,26 @@
1
- # yoda
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
+ ![](https://github.com/tomoasleep/yoda/blob/master/images/method-complete.png)
15
+
16
+ ![](https://github.com/tomoasleep/yoda/blob/master/images/hover-method.png)
17
+
18
+ See: https://github.com/tomoasleep/yoda
5
19
 
6
20
  ## Requirements
7
21
 
8
- Install yoda.
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