ruby-lsp 0.0.1 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +7 -16
  3. data/.github/pull_request_template.md +15 -0
  4. data/.github/workflows/ci.yml +31 -0
  5. data/.github/workflows/publish_docs.yml +32 -0
  6. data/.gitignore +9 -12
  7. data/.rubocop.yml +20 -2
  8. data/.vscode/settings.json +5 -0
  9. data/CHANGELOG.md +29 -0
  10. data/Gemfile +8 -4
  11. data/Gemfile.lock +76 -14
  12. data/README.md +69 -2
  13. data/Rakefile +5 -0
  14. data/VERSION +1 -1
  15. data/bin/tapioca +29 -0
  16. data/bin/test +7 -1
  17. data/dev.yml +7 -7
  18. data/exe/ruby-lsp +19 -2
  19. data/lib/internal.rb +7 -0
  20. data/lib/ruby-lsp.rb +4 -1
  21. data/lib/ruby_lsp/cli.rb +88 -0
  22. data/lib/ruby_lsp/document.rb +113 -0
  23. data/lib/ruby_lsp/handler.rb +236 -0
  24. data/lib/ruby_lsp/requests/base_request.rb +33 -0
  25. data/lib/ruby_lsp/requests/code_actions.rb +37 -0
  26. data/lib/ruby_lsp/requests/diagnostics.rb +37 -0
  27. data/lib/ruby_lsp/requests/document_highlight.rb +96 -0
  28. data/lib/ruby_lsp/requests/document_symbol.rb +216 -0
  29. data/lib/ruby_lsp/requests/folding_ranges.rb +213 -0
  30. data/lib/ruby_lsp/requests/formatting.rb +52 -0
  31. data/lib/ruby_lsp/requests/rubocop_request.rb +50 -0
  32. data/lib/ruby_lsp/requests/selection_ranges.rb +103 -0
  33. data/lib/ruby_lsp/requests/semantic_highlighting.rb +112 -0
  34. data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +88 -0
  35. data/lib/ruby_lsp/requests/support/selection_range.rb +17 -0
  36. data/lib/ruby_lsp/requests/support/semantic_token_encoder.rb +60 -0
  37. data/lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb +27 -0
  38. data/lib/ruby_lsp/requests.rb +24 -0
  39. data/lib/ruby_lsp/store.rb +59 -0
  40. data/rakelib/check_docs.rake +56 -0
  41. data/ruby-lsp.gemspec +5 -1
  42. data/{shipit.yml → shipit.production.yml} +0 -0
  43. data/sorbet/config +4 -0
  44. data/sorbet/rbi/.rubocop.yml +8 -0
  45. data/sorbet/rbi/gems/ansi@1.5.0.rbi +338 -0
  46. data/sorbet/rbi/gems/ast@2.4.2.rbi +522 -0
  47. data/sorbet/rbi/gems/builder@3.2.4.rbi +418 -0
  48. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  49. data/sorbet/rbi/gems/debug@1.5.0.rbi +1273 -0
  50. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +867 -0
  51. data/sorbet/rbi/gems/io-console@0.5.11.rbi +8 -0
  52. data/sorbet/rbi/gems/irb@1.4.1.rbi +376 -0
  53. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +7325 -0
  54. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  55. data/sorbet/rbi/gems/minitest-reporters@1.5.0.rbi +612 -0
  56. data/sorbet/rbi/gems/minitest@5.15.0.rbi +994 -0
  57. data/sorbet/rbi/gems/parallel@1.22.1.rbi +163 -0
  58. data/sorbet/rbi/gems/parser@3.1.2.0.rbi +3968 -0
  59. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +734 -0
  60. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  61. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +227 -0
  62. data/sorbet/rbi/gems/rake@13.0.6.rbi +1853 -0
  63. data/sorbet/rbi/gems/rbi@0.0.14.rbi +2337 -0
  64. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +1854 -0
  65. data/sorbet/rbi/gems/reline@0.3.1.rbi +1274 -0
  66. data/sorbet/rbi/gems/rexml@3.2.5.rbi +3852 -0
  67. data/sorbet/rbi/gems/rubocop-ast@1.18.0.rbi +4180 -0
  68. data/sorbet/rbi/gems/rubocop-minitest@0.20.0.rbi +1369 -0
  69. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +246 -0
  70. data/sorbet/rbi/gems/rubocop-shopify@2.6.0.rbi +8 -0
  71. data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +652 -0
  72. data/sorbet/rbi/gems/rubocop@1.30.0.rbi +36729 -0
  73. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +732 -0
  74. data/sorbet/rbi/gems/spoom@1.1.11.rbi +1600 -0
  75. data/sorbet/rbi/gems/syntax_tree@2.7.1.rbi +6777 -0
  76. data/sorbet/rbi/gems/tapioca@0.8.1.rbi +1972 -0
  77. data/sorbet/rbi/gems/thor@1.2.1.rbi +2921 -0
  78. data/sorbet/rbi/gems/unicode-display_width@2.1.0.rbi +27 -0
  79. data/sorbet/rbi/gems/unparser@0.6.5.rbi +2789 -0
  80. data/sorbet/rbi/gems/webrick@1.7.0.rbi +1779 -0
  81. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +289 -0
  82. data/sorbet/rbi/gems/yard@0.9.27.rbi +13048 -0
  83. data/sorbet/rbi/shims/fiddle.rbi +4 -0
  84. data/sorbet/rbi/shims/hash.rbi +6 -0
  85. data/sorbet/rbi/shims/rdoc.rbi +4 -0
  86. data/sorbet/tapioca/config.yml +13 -0
  87. data/sorbet/tapioca/require.rb +7 -0
  88. metadata +119 -9
  89. data/.vscode/launch.json +0 -19
  90. data/bin/package_extension +0 -5
  91. data/bin/style +0 -10
  92. data/lib/ruby/lsp/cli.rb +0 -37
  93. data/lib/ruby/lsp.rb +0 -3
@@ -0,0 +1,4 @@
1
+ # typed: true
2
+
3
+ module Fiddle::CParser; end
4
+ module Fiddle::Importer; end
@@ -0,0 +1,6 @@
1
+ # typed: true
2
+
3
+ class Hash
4
+ sig { returns(String) }
5
+ def to_json; end
6
+ end
@@ -0,0 +1,4 @@
1
+ # typed: true
2
+
3
+ module RDoc; end
4
+ class RDoc::Task; end
@@ -0,0 +1,13 @@
1
+ gem:
2
+ # Add your `gem` command parameters here:
3
+ #
4
+ # exclude:
5
+ # - gem_name
6
+ # doc: true
7
+ # workers: 5
8
+ dsl:
9
+ # Add your `dsl` command parameters here:
10
+ #
11
+ # exclude:
12
+ # - SomeGeneratorName
13
+ # workers: 5
@@ -0,0 +1,7 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ # Add your extra requires here (`bin/tapioca require` can be used to boostrap this list)
5
+
6
+ require "language_server-protocol"
7
+ require "syntax_tree"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-01 00:00:00.000000000 Z
11
+ date: 2022-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: language_server-protocol
@@ -24,6 +24,48 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sorbet-runtime
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: syntax_tree
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '2.3'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '2.3'
27
69
  description: A simple language server for ruby
28
70
  email:
29
71
  - ruby@shopify.com
@@ -34,11 +76,15 @@ extra_rdoc_files: []
34
76
  files:
35
77
  - ".github/dependabot.yml"
36
78
  - ".github/probots.yml"
79
+ - ".github/pull_request_template.md"
80
+ - ".github/workflows/ci.yml"
81
+ - ".github/workflows/publish_docs.yml"
37
82
  - ".gitignore"
38
83
  - ".rubocop.yml"
39
84
  - ".vscode/extensions.json"
40
- - ".vscode/launch.json"
85
+ - ".vscode/settings.json"
41
86
  - ".vscode/tasks.json"
87
+ - CHANGELOG.md
42
88
  - CODE_OF_CONDUCT.md
43
89
  - Gemfile
44
90
  - Gemfile.lock
@@ -46,20 +92,84 @@ files:
46
92
  - README.md
47
93
  - Rakefile
48
94
  - VERSION
49
- - bin/package_extension
50
95
  - bin/rubocop
51
- - bin/style
96
+ - bin/tapioca
52
97
  - bin/test
53
98
  - dev.yml
54
99
  - exe/ruby-lsp
100
+ - lib/internal.rb
55
101
  - lib/ruby-lsp.rb
56
- - lib/ruby/lsp.rb
57
- - lib/ruby/lsp/cli.rb
102
+ - lib/ruby_lsp/cli.rb
103
+ - lib/ruby_lsp/document.rb
104
+ - lib/ruby_lsp/handler.rb
105
+ - lib/ruby_lsp/requests.rb
106
+ - lib/ruby_lsp/requests/base_request.rb
107
+ - lib/ruby_lsp/requests/code_actions.rb
108
+ - lib/ruby_lsp/requests/diagnostics.rb
109
+ - lib/ruby_lsp/requests/document_highlight.rb
110
+ - lib/ruby_lsp/requests/document_symbol.rb
111
+ - lib/ruby_lsp/requests/folding_ranges.rb
112
+ - lib/ruby_lsp/requests/formatting.rb
113
+ - lib/ruby_lsp/requests/rubocop_request.rb
114
+ - lib/ruby_lsp/requests/selection_ranges.rb
115
+ - lib/ruby_lsp/requests/semantic_highlighting.rb
116
+ - lib/ruby_lsp/requests/support/rubocop_diagnostic.rb
117
+ - lib/ruby_lsp/requests/support/selection_range.rb
118
+ - lib/ruby_lsp/requests/support/semantic_token_encoder.rb
119
+ - lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
120
+ - lib/ruby_lsp/store.rb
121
+ - rakelib/check_docs.rake
58
122
  - ruby-lsp.gemspec
59
123
  - service.yml
60
- - shipit.yml
124
+ - shipit.production.yml
125
+ - sorbet/config
126
+ - sorbet/rbi/.rubocop.yml
127
+ - sorbet/rbi/gems/ansi@1.5.0.rbi
128
+ - sorbet/rbi/gems/ast@2.4.2.rbi
129
+ - sorbet/rbi/gems/builder@3.2.4.rbi
130
+ - sorbet/rbi/gems/coderay@1.1.3.rbi
131
+ - sorbet/rbi/gems/debug@1.5.0.rbi
132
+ - sorbet/rbi/gems/diff-lcs@1.5.0.rbi
133
+ - sorbet/rbi/gems/io-console@0.5.11.rbi
134
+ - sorbet/rbi/gems/irb@1.4.1.rbi
135
+ - sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi
136
+ - sorbet/rbi/gems/method_source@1.0.0.rbi
137
+ - sorbet/rbi/gems/minitest-reporters@1.5.0.rbi
138
+ - sorbet/rbi/gems/minitest@5.15.0.rbi
139
+ - sorbet/rbi/gems/parallel@1.22.1.rbi
140
+ - sorbet/rbi/gems/parser@3.1.2.0.rbi
141
+ - sorbet/rbi/gems/prettier_print@0.1.0.rbi
142
+ - sorbet/rbi/gems/pry@0.14.1.rbi
143
+ - sorbet/rbi/gems/rainbow@3.1.1.rbi
144
+ - sorbet/rbi/gems/rake@13.0.6.rbi
145
+ - sorbet/rbi/gems/rbi@0.0.14.rbi
146
+ - sorbet/rbi/gems/regexp_parser@2.5.0.rbi
147
+ - sorbet/rbi/gems/reline@0.3.1.rbi
148
+ - sorbet/rbi/gems/rexml@3.2.5.rbi
149
+ - sorbet/rbi/gems/rubocop-ast@1.18.0.rbi
150
+ - sorbet/rbi/gems/rubocop-minitest@0.20.0.rbi
151
+ - sorbet/rbi/gems/rubocop-rake@0.6.0.rbi
152
+ - sorbet/rbi/gems/rubocop-shopify@2.6.0.rbi
153
+ - sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi
154
+ - sorbet/rbi/gems/rubocop@1.30.0.rbi
155
+ - sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi
156
+ - sorbet/rbi/gems/spoom@1.1.11.rbi
157
+ - sorbet/rbi/gems/syntax_tree@2.7.1.rbi
158
+ - sorbet/rbi/gems/tapioca@0.8.1.rbi
159
+ - sorbet/rbi/gems/thor@1.2.1.rbi
160
+ - sorbet/rbi/gems/unicode-display_width@2.1.0.rbi
161
+ - sorbet/rbi/gems/unparser@0.6.5.rbi
162
+ - sorbet/rbi/gems/webrick@1.7.0.rbi
163
+ - sorbet/rbi/gems/yard-sorbet@0.6.1.rbi
164
+ - sorbet/rbi/gems/yard@0.9.27.rbi
165
+ - sorbet/rbi/shims/fiddle.rbi
166
+ - sorbet/rbi/shims/hash.rbi
167
+ - sorbet/rbi/shims/rdoc.rbi
168
+ - sorbet/tapioca/config.yml
169
+ - sorbet/tapioca/require.rb
61
170
  homepage: https://github.com/Shopify/ruby-lsp
62
- licenses: []
171
+ licenses:
172
+ - MIT
63
173
  metadata:
64
174
  allowed_push_host: https://rubygems.org
65
175
  post_install_message:
data/.vscode/launch.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "name": "Minitest - current line",
9
- "type": "Ruby",
10
- "cwd": "${workspaceRoot}",
11
- "request": "launch",
12
- "program": "${workspaceRoot}/bin/rails",
13
- "args": [
14
- "test",
15
- "${file}:${lineNumber}"
16
- ]
17
- }
18
- ]
19
- }
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- cd features/vscode_extension || exit
4
- yarn run vscode:prepublish
5
- yarn run package -o ../.. # drop the extension in the main directory
data/bin/style DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- echo "Linting gem..."
4
- bin/rubocop
5
-
6
- echo
7
- echo "Linting extension..."
8
- cd features/vscode_extension || exit
9
- yarn run lint
10
- cd ../..
data/lib/ruby/lsp/cli.rb DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "language_server-protocol"
4
-
5
- module Ruby
6
- module Lsp
7
- module Cli
8
- def self.start(_argv)
9
- writer = LanguageServer::Protocol::Transport::Stdio::Writer.new
10
- reader = LanguageServer::Protocol::Transport::Stdio::Reader.new
11
-
12
- subscribers = {
13
- initialize: -> {
14
- LanguageServer::Protocol::Interface::InitializeResult.new(
15
- capabilities: LanguageServer::Protocol::Interface::ServerCapabilities.new(
16
- text_document_sync: LanguageServer::Protocol::Interface::TextDocumentSyncOptions.new(
17
- change: LanguageServer::Protocol::Constant::TextDocumentSyncKind::FULL
18
- ),
19
- completion_provider: LanguageServer::Protocol::Interface::CompletionOptions.new(
20
- resolve_provider: true,
21
- trigger_characters: %w(.)
22
- ),
23
- definition_provider: true
24
- )
25
- )
26
- }
27
- }
28
-
29
- reader.read do |request|
30
- result = subscribers[request[:method].to_sym].call
31
- writer.write(id: request[:id], result: result)
32
- exit
33
- end
34
- end
35
- end
36
- end
37
- end
data/lib/ruby/lsp.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lsp/cli"