ruby-lsp 0.1.0 → 0.2.2

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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +2 -1
  4. data/VERSION +1 -1
  5. data/exe/ruby-lsp +1 -3
  6. data/lib/ruby-lsp.rb +2 -2
  7. data/lib/ruby_lsp/document.rb +10 -3
  8. data/lib/ruby_lsp/handler.rb +30 -134
  9. data/lib/ruby_lsp/internal.rb +3 -1
  10. data/lib/ruby_lsp/requests/code_actions.rb +2 -0
  11. data/lib/ruby_lsp/requests/diagnostics.rb +14 -9
  12. data/lib/ruby_lsp/requests/document_highlight.rb +27 -42
  13. data/lib/ruby_lsp/requests/document_link.rb +59 -0
  14. data/lib/ruby_lsp/requests/document_symbol.rb +2 -0
  15. data/lib/ruby_lsp/requests/folding_ranges.rb +26 -21
  16. data/lib/ruby_lsp/requests/formatting.rb +21 -16
  17. data/lib/ruby_lsp/requests/selection_ranges.rb +2 -0
  18. data/lib/ruby_lsp/requests/semantic_highlighting.rb +85 -11
  19. data/lib/ruby_lsp/requests/support/highlight_target.rb +88 -0
  20. data/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb +9 -2
  21. data/lib/ruby_lsp/requests/support/rubocop_diagnostics_runner.rb +61 -0
  22. data/lib/ruby_lsp/requests/support/rubocop_formatting_runner.rb +50 -0
  23. data/lib/ruby_lsp/requests.rb +14 -1
  24. data/lib/ruby_lsp/server.rb +192 -0
  25. data/lib/ruby_lsp/store.rb +12 -5
  26. metadata +10 -87
  27. data/.github/dependabot.yml +0 -11
  28. data/.github/probots.yml +0 -2
  29. data/.github/pull_request_template.md +0 -15
  30. data/.github/workflows/ci.yml +0 -31
  31. data/.github/workflows/publish_docs.yml +0 -32
  32. data/.gitignore +0 -9
  33. data/.rubocop.yml +0 -39
  34. data/.vscode/extensions.json +0 -5
  35. data/.vscode/settings.json +0 -5
  36. data/.vscode/tasks.json +0 -25
  37. data/CODE_OF_CONDUCT.md +0 -78
  38. data/Gemfile +0 -17
  39. data/Gemfile.lock +0 -124
  40. data/Rakefile +0 -21
  41. data/bin/rubocop +0 -29
  42. data/bin/tapioca +0 -29
  43. data/bin/test +0 -9
  44. data/dev.yml +0 -20
  45. data/lib/ruby_lsp/cli.rb +0 -88
  46. data/lib/ruby_lsp/requests/rubocop_request.rb +0 -60
  47. data/rakelib/check_docs.rake +0 -57
  48. data/ruby-lsp.gemspec +0 -26
  49. data/service.yml +0 -2
  50. data/sorbet/config +0 -4
  51. data/sorbet/rbi/.rubocop.yml +0 -8
  52. data/sorbet/rbi/gems/ansi@1.5.0.rbi +0 -338
  53. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -522
  54. data/sorbet/rbi/gems/builder@3.2.4.rbi +0 -418
  55. data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -8
  56. data/sorbet/rbi/gems/debug@1.5.0.rbi +0 -1273
  57. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -867
  58. data/sorbet/rbi/gems/io-console@0.5.11.rbi +0 -8
  59. data/sorbet/rbi/gems/irb@1.4.1.rbi +0 -376
  60. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +0 -7325
  61. data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -8
  62. data/sorbet/rbi/gems/minitest-reporters@1.5.0.rbi +0 -612
  63. data/sorbet/rbi/gems/minitest@5.15.0.rbi +0 -994
  64. data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -163
  65. data/sorbet/rbi/gems/parser@3.1.2.0.rbi +0 -3968
  66. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -734
  67. data/sorbet/rbi/gems/pry@0.14.1.rbi +0 -8
  68. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -227
  69. data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -1853
  70. data/sorbet/rbi/gems/rbi@0.0.14.rbi +0 -2337
  71. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +0 -1854
  72. data/sorbet/rbi/gems/reline@0.3.1.rbi +0 -1274
  73. data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -3852
  74. data/sorbet/rbi/gems/rubocop-ast@1.18.0.rbi +0 -4180
  75. data/sorbet/rbi/gems/rubocop-minitest@0.20.0.rbi +0 -1369
  76. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +0 -246
  77. data/sorbet/rbi/gems/rubocop-shopify@2.6.0.rbi +0 -8
  78. data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +0 -652
  79. data/sorbet/rbi/gems/rubocop@1.30.0.rbi +0 -36729
  80. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -732
  81. data/sorbet/rbi/gems/spoom@1.1.11.rbi +0 -1600
  82. data/sorbet/rbi/gems/syntax_tree@2.7.1.rbi +0 -6777
  83. data/sorbet/rbi/gems/tapioca@0.8.1.rbi +0 -1972
  84. data/sorbet/rbi/gems/thor@1.2.1.rbi +0 -2921
  85. data/sorbet/rbi/gems/unicode-display_width@2.1.0.rbi +0 -27
  86. data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -2789
  87. data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -1779
  88. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +0 -289
  89. data/sorbet/rbi/gems/yard@0.9.27.rbi +0 -13048
  90. data/sorbet/rbi/shims/fiddle.rbi +0 -4
  91. data/sorbet/rbi/shims/hash.rbi +0 -6
  92. data/sorbet/rbi/shims/rdoc.rbi +0 -4
  93. data/sorbet/tapioca/config.yml +0 -13
  94. data/sorbet/tapioca/require.rb +0 -7
@@ -0,0 +1,192 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ require "ruby_lsp/internal"
5
+
6
+ module RubyLsp
7
+ Handler.start do
8
+ on("initialize") do |request|
9
+ store.clear
10
+ initialization_options = request.dig(:params, :initializationOptions)
11
+ enabled_features = initialization_options.fetch(:enabledFeatures, [])
12
+
13
+ document_symbol_provider = if enabled_features.include?("documentSymbols")
14
+ Interface::DocumentSymbolClientCapabilities.new(
15
+ hierarchical_document_symbol_support: true,
16
+ symbol_kind: {
17
+ value_set: Requests::DocumentSymbol::SYMBOL_KIND.values,
18
+ }
19
+ )
20
+ end
21
+
22
+ document_link_provider = if enabled_features.include?("documentLink")
23
+ Interface::DocumentLinkOptions.new(resolve_provider: false)
24
+ end
25
+
26
+ folding_ranges_provider = if enabled_features.include?("foldingRanges")
27
+ Interface::FoldingRangeClientCapabilities.new(line_folding_only: true)
28
+ end
29
+
30
+ semantic_tokens_provider = if enabled_features.include?("semanticHighlighting")
31
+ Interface::SemanticTokensRegistrationOptions.new(
32
+ document_selector: { scheme: "file", language: "ruby" },
33
+ legend: Interface::SemanticTokensLegend.new(
34
+ token_types: Requests::SemanticHighlighting::TOKEN_TYPES.keys,
35
+ token_modifiers: Requests::SemanticHighlighting::TOKEN_MODIFIERS.keys
36
+ ),
37
+ range: false,
38
+ full: {
39
+ delta: true,
40
+ }
41
+ )
42
+ end
43
+
44
+ diagnostics_provider = if enabled_features.include?("diagnostics")
45
+ {
46
+ interFileDependencies: false,
47
+ workspaceDiagnostics: false,
48
+ }
49
+ end
50
+
51
+ # TODO: switch back to using Interface::ServerCapabilities once the gem is updated for spec 3.17
52
+ Interface::InitializeResult.new(
53
+ capabilities: {
54
+ textDocumentSync: Interface::TextDocumentSyncOptions.new(
55
+ change: Constant::TextDocumentSyncKind::INCREMENTAL,
56
+ open_close: true,
57
+ ),
58
+ selectionRangeProvider: enabled_features.include?("selectionRanges"),
59
+ documentSymbolProvider: document_symbol_provider,
60
+ documentLinkProvider: document_link_provider,
61
+ foldingRangeProvider: folding_ranges_provider,
62
+ semanticTokensProvider: semantic_tokens_provider,
63
+ documentFormattingProvider: enabled_features.include?("formatting"),
64
+ documentHighlightProvider: enabled_features.include?("documentHighlights"),
65
+ codeActionProvider: enabled_features.include?("codeActions"),
66
+ diagnosticProvider: diagnostics_provider,
67
+ }.reject { |_, v| !v }
68
+ )
69
+ end
70
+
71
+ on("textDocument/didChange") do |request|
72
+ uri = request.dig(:params, :textDocument, :uri)
73
+ store.push_edits(uri, request.dig(:params, :contentChanges))
74
+
75
+ Handler::VOID
76
+ end
77
+
78
+ on("textDocument/didOpen") do |request|
79
+ uri = request.dig(:params, :textDocument, :uri)
80
+ text = request.dig(:params, :textDocument, :text)
81
+ store.set(uri, text)
82
+
83
+ Handler::VOID
84
+ end
85
+
86
+ on("textDocument/didClose") do |request|
87
+ uri = request.dig(:params, :textDocument, :uri)
88
+ store.delete(uri)
89
+ clear_diagnostics(uri)
90
+
91
+ Handler::VOID
92
+ end
93
+
94
+ on("textDocument/documentSymbol") do |request|
95
+ store.cache_fetch(request.dig(:params, :textDocument, :uri), :document_symbol) do |document|
96
+ Requests::DocumentSymbol.new(document).run
97
+ end
98
+ end
99
+
100
+ on("textDocument/documentLink") do |request|
101
+ store.cache_fetch(request.dig(:params, :textDocument, :uri), :document_link) do |document|
102
+ RubyLsp::Requests::DocumentLink.new(document).run
103
+ end
104
+ end
105
+
106
+ on("textDocument/foldingRange") do |request|
107
+ store.cache_fetch(request.dig(:params, :textDocument, :uri), :folding_ranges) do |document|
108
+ Requests::FoldingRanges.new(document).run
109
+ end
110
+ end
111
+
112
+ on("textDocument/selectionRange") do |request|
113
+ uri = request.dig(:params, :textDocument, :uri)
114
+ positions = request.dig(:params, :positions)
115
+
116
+ ranges = store.cache_fetch(uri, :selection_ranges) do |document|
117
+ Requests::SelectionRanges.new(document).run
118
+ end
119
+
120
+ # Per the selection range request spec (https://microsoft.github.io/language-server-protocol/specification#textDocument_selectionRange),
121
+ # every position in the positions array should have an element at the same index in the response
122
+ # array. For positions without a valid selection range, the corresponding element in the response
123
+ # array will be nil.
124
+
125
+ unless ranges.nil?
126
+ positions.map do |position|
127
+ ranges.find do |range|
128
+ range.cover?(position)
129
+ end
130
+ end
131
+ end
132
+ end
133
+
134
+ on("textDocument/semanticTokens/full") do |request|
135
+ store.cache_fetch(request.dig(:params, :textDocument, :uri), :semantic_highlighting) do |document|
136
+ T.cast(
137
+ Requests::SemanticHighlighting.new(
138
+ document,
139
+ encoder: Requests::Support::SemanticTokenEncoder.new
140
+ ).run,
141
+ LanguageServer::Protocol::Interface::SemanticTokens
142
+ )
143
+ end
144
+ end
145
+
146
+ on("textDocument/formatting") do |request|
147
+ uri = request.dig(:params, :textDocument, :uri)
148
+
149
+ Requests::Formatting.new(uri, store.get(uri)).run
150
+ end
151
+
152
+ on("textDocument/documentHighlight") do |request|
153
+ document = store.get(request.dig(:params, :textDocument, :uri))
154
+
155
+ if document.parsed?
156
+ Requests::DocumentHighlight.new(document, request.dig(:params, :position)).run
157
+ end
158
+ end
159
+
160
+ on("textDocument/codeAction") do |request|
161
+ uri = request.dig(:params, :textDocument, :uri)
162
+ range = request.dig(:params, :range)
163
+ start_line = range.dig(:start, :line)
164
+ end_line = range.dig(:end, :line)
165
+
166
+ store.cache_fetch(uri, :code_actions) do |document|
167
+ Requests::CodeActions.new(uri, document, start_line..end_line).run
168
+ end
169
+ end
170
+
171
+ on("textDocument/diagnostic") do |request|
172
+ uri = request.dig(:params, :textDocument, :uri)
173
+ response = store.cache_fetch(uri, :diagnostics) do |document|
174
+ Requests::Diagnostics.new(uri, document).run
175
+ end
176
+
177
+ { kind: "full", items: response.map(&:to_lsp_diagnostic) } if response
178
+ rescue RuboCop::ValidationError => e
179
+ show_message(Constant::MessageType::ERROR, "Error in RuboCop configuration file: #{e.message}")
180
+ nil
181
+ end
182
+
183
+ on("shutdown") { shutdown }
184
+
185
+ on("exit") do
186
+ # We return zero if shutdown has already been received or one otherwise as per the recommendation in the spec
187
+ # https://microsoft.github.io/language-server-protocol/specification/#exit
188
+ status = store.empty? ? 0 : 1
189
+ exit(status)
190
+ end
191
+ end
192
+ end
@@ -25,9 +25,8 @@ module RubyLsp
25
25
 
26
26
  sig { params(uri: String, content: String).void }
27
27
  def set(uri, content)
28
- @state[uri] = Document.new(content)
29
- rescue SyntaxTree::Parser::ParseError
30
- # Do not update the store if there are syntax errors
28
+ document = Document.new(content)
29
+ @state[uri] = document
31
30
  end
32
31
 
33
32
  sig { params(uri: String, edits: T::Array[Document::EditShape]).void }
@@ -40,6 +39,11 @@ module RubyLsp
40
39
  @state.clear
41
40
  end
42
41
 
42
+ sig { returns(T::Boolean) }
43
+ def empty?
44
+ @state.empty?
45
+ end
46
+
43
47
  sig { params(uri: String).void }
44
48
  def delete(uri)
45
49
  @state.delete(uri)
@@ -51,10 +55,13 @@ module RubyLsp
51
55
  uri: String,
52
56
  request_name: Symbol,
53
57
  block: T.proc.params(document: Document).returns(T.type_parameter(:T))
54
- ).returns(T.type_parameter(:T))
58
+ ).returns(T.nilable(T.type_parameter(:T)))
55
59
  end
56
60
  def cache_fetch(uri, request_name, &block)
57
- get(uri).cache_fetch(request_name, &block)
61
+ document = get(uri)
62
+ return unless document.parsed?
63
+
64
+ document.cache_fetch(request_name, &block)
58
65
  end
59
66
  end
60
67
  end
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.1.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-15 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: language_server-protocol
@@ -24,20 +24,6 @@ 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
27
  - !ruby/object:Gem::Dependency
42
28
  name: sorbet-runtime
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +52,7 @@ dependencies:
66
52
  - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '2.4'
69
- description: A simple language server for ruby
55
+ description: An opinionated language server for Ruby
70
56
  email:
71
57
  - ruby@shopify.com
72
58
  executables:
@@ -74,31 +60,12 @@ executables:
74
60
  extensions: []
75
61
  extra_rdoc_files: []
76
62
  files:
77
- - ".github/dependabot.yml"
78
- - ".github/probots.yml"
79
- - ".github/pull_request_template.md"
80
- - ".github/workflows/ci.yml"
81
- - ".github/workflows/publish_docs.yml"
82
- - ".gitignore"
83
- - ".rubocop.yml"
84
- - ".vscode/extensions.json"
85
- - ".vscode/settings.json"
86
- - ".vscode/tasks.json"
87
63
  - CHANGELOG.md
88
- - CODE_OF_CONDUCT.md
89
- - Gemfile
90
- - Gemfile.lock
91
64
  - LICENSE.txt
92
65
  - README.md
93
- - Rakefile
94
66
  - VERSION
95
- - bin/rubocop
96
- - bin/tapioca
97
- - bin/test
98
- - dev.yml
99
67
  - exe/ruby-lsp
100
68
  - lib/ruby-lsp.rb
101
- - lib/ruby_lsp/cli.rb
102
69
  - lib/ruby_lsp/document.rb
103
70
  - lib/ruby_lsp/handler.rb
104
71
  - lib/ruby_lsp/internal.rb
@@ -107,65 +74,21 @@ files:
107
74
  - lib/ruby_lsp/requests/code_actions.rb
108
75
  - lib/ruby_lsp/requests/diagnostics.rb
109
76
  - lib/ruby_lsp/requests/document_highlight.rb
77
+ - lib/ruby_lsp/requests/document_link.rb
110
78
  - lib/ruby_lsp/requests/document_symbol.rb
111
79
  - lib/ruby_lsp/requests/folding_ranges.rb
112
80
  - lib/ruby_lsp/requests/formatting.rb
113
- - lib/ruby_lsp/requests/rubocop_request.rb
114
81
  - lib/ruby_lsp/requests/selection_ranges.rb
115
82
  - lib/ruby_lsp/requests/semantic_highlighting.rb
83
+ - lib/ruby_lsp/requests/support/highlight_target.rb
116
84
  - lib/ruby_lsp/requests/support/rubocop_diagnostic.rb
85
+ - lib/ruby_lsp/requests/support/rubocop_diagnostics_runner.rb
86
+ - lib/ruby_lsp/requests/support/rubocop_formatting_runner.rb
117
87
  - lib/ruby_lsp/requests/support/selection_range.rb
118
88
  - lib/ruby_lsp/requests/support/semantic_token_encoder.rb
119
89
  - lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
90
+ - lib/ruby_lsp/server.rb
120
91
  - lib/ruby_lsp/store.rb
121
- - rakelib/check_docs.rake
122
- - ruby-lsp.gemspec
123
- - service.yml
124
- - sorbet/config
125
- - sorbet/rbi/.rubocop.yml
126
- - sorbet/rbi/gems/ansi@1.5.0.rbi
127
- - sorbet/rbi/gems/ast@2.4.2.rbi
128
- - sorbet/rbi/gems/builder@3.2.4.rbi
129
- - sorbet/rbi/gems/coderay@1.1.3.rbi
130
- - sorbet/rbi/gems/debug@1.5.0.rbi
131
- - sorbet/rbi/gems/diff-lcs@1.5.0.rbi
132
- - sorbet/rbi/gems/io-console@0.5.11.rbi
133
- - sorbet/rbi/gems/irb@1.4.1.rbi
134
- - sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi
135
- - sorbet/rbi/gems/method_source@1.0.0.rbi
136
- - sorbet/rbi/gems/minitest-reporters@1.5.0.rbi
137
- - sorbet/rbi/gems/minitest@5.15.0.rbi
138
- - sorbet/rbi/gems/parallel@1.22.1.rbi
139
- - sorbet/rbi/gems/parser@3.1.2.0.rbi
140
- - sorbet/rbi/gems/prettier_print@0.1.0.rbi
141
- - sorbet/rbi/gems/pry@0.14.1.rbi
142
- - sorbet/rbi/gems/rainbow@3.1.1.rbi
143
- - sorbet/rbi/gems/rake@13.0.6.rbi
144
- - sorbet/rbi/gems/rbi@0.0.14.rbi
145
- - sorbet/rbi/gems/regexp_parser@2.5.0.rbi
146
- - sorbet/rbi/gems/reline@0.3.1.rbi
147
- - sorbet/rbi/gems/rexml@3.2.5.rbi
148
- - sorbet/rbi/gems/rubocop-ast@1.18.0.rbi
149
- - sorbet/rbi/gems/rubocop-minitest@0.20.0.rbi
150
- - sorbet/rbi/gems/rubocop-rake@0.6.0.rbi
151
- - sorbet/rbi/gems/rubocop-shopify@2.6.0.rbi
152
- - sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi
153
- - sorbet/rbi/gems/rubocop@1.30.0.rbi
154
- - sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi
155
- - sorbet/rbi/gems/spoom@1.1.11.rbi
156
- - sorbet/rbi/gems/syntax_tree@2.7.1.rbi
157
- - sorbet/rbi/gems/tapioca@0.8.1.rbi
158
- - sorbet/rbi/gems/thor@1.2.1.rbi
159
- - sorbet/rbi/gems/unicode-display_width@2.1.0.rbi
160
- - sorbet/rbi/gems/unparser@0.6.5.rbi
161
- - sorbet/rbi/gems/webrick@1.7.0.rbi
162
- - sorbet/rbi/gems/yard-sorbet@0.6.1.rbi
163
- - sorbet/rbi/gems/yard@0.9.27.rbi
164
- - sorbet/rbi/shims/fiddle.rbi
165
- - sorbet/rbi/shims/hash.rbi
166
- - sorbet/rbi/shims/rdoc.rbi
167
- - sorbet/tapioca/config.yml
168
- - sorbet/tapioca/require.rb
169
92
  homepage: https://github.com/Shopify/ruby-lsp
170
93
  licenses:
171
94
  - MIT
@@ -179,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
102
  requirements:
180
103
  - - ">="
181
104
  - !ruby/object:Gem::Version
182
- version: '0'
105
+ version: 2.7.3
183
106
  required_rubygems_version: !ruby/object:Gem::Requirement
184
107
  requirements:
185
108
  - - ">="
@@ -189,5 +112,5 @@ requirements: []
189
112
  rubygems_version: 3.3.3
190
113
  signing_key:
191
114
  specification_version: 4
192
- summary: A simple language server for ruby
115
+ summary: An opinionated language server for Ruby
193
116
  test_files: []
@@ -1,11 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "bundler"
4
- directory: "/"
5
- schedule:
6
- interval: "weekly"
7
- reviewers:
8
- - "Shopify/sorbet"
9
- labels:
10
- - "dependencies"
11
- - "ruby"
data/.github/probots.yml DELETED
@@ -1,2 +0,0 @@
1
- enabled:
2
- - cla
@@ -1,15 +0,0 @@
1
- ### Motivation
2
-
3
- <!-- Explain why you are making this change. Include links to issues or describe the problem being solved, not the solution. -->
4
-
5
- ### Implementation
6
-
7
- <!-- How did you implement your changes? Explain your solution, design decisions, things reviewers should watch out for. -->
8
-
9
- ### Automated Tests
10
-
11
- <!-- We hope you added unit tests as part of your changes, just state that you have. If you haven't, state why. -->
12
-
13
- ### Manual Tests
14
-
15
- <!-- Explain how we can test these changes in our own instance of VS Code. Provide the step by step instructions. -->
@@ -1,31 +0,0 @@
1
- name: CI
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- strategy:
9
- fail-fast: false
10
- matrix:
11
- ruby: [ "2.7", "3.0", "3.1" ]
12
- name: Ruby ${{ matrix.ruby }}
13
- steps:
14
- - uses: actions/checkout@v2
15
- - name: Set up Ruby
16
- uses: ruby/setup-ruby@v1
17
- with:
18
- ruby-version: ${{ matrix.ruby }}
19
- bundler-cache: true
20
-
21
- - name: Check if documentation is up to date
22
- run: bundle exec rake check_docs
23
-
24
- - name: Typecheck
25
- run: bundle exec srb tc
26
-
27
- - name: Lint Ruby files
28
- run: bin/rubocop
29
-
30
- - name: Run tests
31
- run: bin/test
@@ -1,32 +0,0 @@
1
- name: Publish docs
2
-
3
- on:
4
- push:
5
- branches: [main]
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- name: Publish documentation website
11
- steps:
12
- - uses: actions/checkout@v3
13
-
14
- - name: Set up Ruby
15
- uses: ruby/setup-ruby@v1
16
- with:
17
- ruby-version: 3.1.1
18
- bundler-cache: true
19
-
20
- - name: Configure git
21
- run: |
22
- git config user.name github-actions
23
- git config user.email github-actions@github.com
24
-
25
- - name: Generate documentation
26
- run: bundle exec rake yard
27
-
28
- - name: Commit to gh-pages
29
- run: |
30
- git add docs
31
- git commit -m "Publish website $(git log --format=format:%h -1)"
32
- git push --force origin main:gh-pages
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /**/.bundle/
2
- /**/.yardoc
3
- /**/_yardoc/
4
- /**/coverage/
5
- /**/doc/
6
- /**/pkg/
7
- /**/spec/reports/
8
- /**/tmp/
9
- /**/.dev/
data/.rubocop.yml DELETED
@@ -1,39 +0,0 @@
1
- inherit_gem:
2
- rubocop-shopify: rubocop.yml
3
-
4
- require:
5
- - rubocop-sorbet
6
- - rubocop-minitest
7
- - rubocop-rake
8
-
9
- AllCops:
10
- NewCops: disable
11
- SuggestExtensions: false
12
- TargetRubyVersion: 2.7
13
- Exclude:
14
- - "vendor/**/*"
15
- - "features/**/*"
16
- - "test/fixtures/**/*"
17
-
18
- Naming/FileName:
19
- Exclude:
20
- - "lib/ruby-lsp.rb"
21
-
22
- Sorbet/FalseSigil:
23
- Enabled: false
24
-
25
- Sorbet/TrueSigil:
26
- Enabled: true
27
- Include:
28
- - "test/**/*.rb"
29
- Exclude:
30
- - "**/*.rake"
31
- - "lib/**/*.rb"
32
-
33
- Sorbet/StrictSigil:
34
- Enabled: true
35
- Include:
36
- - "lib/**/*.rb"
37
- Exclude:
38
- - "**/*.rake"
39
- - "test/**/*.rb"
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "rebornix.ruby"
4
- ]
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- // Set this value to `verbose` to see the full JSON content of LSP requests and responses
3
- "ruby lsp.trace.server": "messages",
4
- "editor.defaultFormatter": "Shopify.ruby-lsp",
5
- }
data/.vscode/tasks.json DELETED
@@ -1,25 +0,0 @@
1
- // See https://go.microsoft.com/fwlink/?LinkId=733558
2
- // for the documentation about the tasks.json format
3
- {
4
- "version": "2.0.0",
5
- "tasks": [
6
- {
7
- "type": "rake",
8
- "task": "test",
9
- "group": {
10
- "kind": "test",
11
- "isDefault": true
12
- },
13
- "problemMatcher": [],
14
- "label": "rake: test",
15
- "presentation": {
16
- "echo": true,
17
- "reveal": "always",
18
- "focus": true,
19
- "panel": "shared",
20
- "showReuseMessage": true,
21
- "clear": false
22
- }
23
- }
24
- ]
25
- }
data/CODE_OF_CONDUCT.md DELETED
@@ -1,78 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to make participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, sex characteristics, gender identity and expression,
9
- level of experience, education, socio-economic status, nationality, personal
10
- appearance, race, religion, or sexual identity and orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies within all project spaces, and it also applies when
49
- an individual is representing the project or its community in public spaces.
50
- Examples of representing a project or community include using an official
51
- project e-mail address, posting via an official social media account, or acting
52
- as an appointed representative at an online or offline event. Representation of
53
- a project may be further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at opensource@shopify.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
-
73
- [homepage]: https://www.contributor-covenant.org
74
-
75
- For answers to common questions about this code of conduct, see
76
- https://www.contributor-covenant.org/faq
77
-
78
-
data/Gemfile DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
6
-
7
- gem "debug", "~> 1.5", require: false
8
- gem "minitest", "~> 5.15"
9
- gem "minitest-reporters", "~> 1.5"
10
- gem "rake", "~> 13.0"
11
- gem "rubocop-shopify", "~> 2.7", require: false
12
- gem "rubocop-minitest", "~> 0.20.1", require: false
13
- gem "rubocop-rake", "~> 0.6.0", require: false
14
- gem "rubocop-sorbet", "~> 0.6", require: false
15
- gem "sorbet-static-and-runtime"
16
- gem "tapioca", "~> 0.8", require: false
17
- gem "yard", "~> 0.9", require: false