Skip to content

Commit

Permalink
Upgrade to Prism v0.19 (#1253)
Browse files Browse the repository at this point in the history
* Upgrade Prism dependency to v0.19

* Re-generate Prism RBI

* Exclude Prism submodule from VS Code search

* Fix breaking changes
  • Loading branch information
vinistock authored Dec 15, 2023
1 parent 90ee251 commit 01dc028
Show file tree
Hide file tree
Showing 7 changed files with 5,025 additions and 3,838 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp",
},
"search.exclude": {
"**/test/fixtures/prism": true
},
"cSpell.languageSettings": [
{
"languageId": "*",
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
ruby-lsp (0.13.1)
language_server-protocol (~> 3.17.0)
prism (>= 0.18.0, < 0.19)
prism (>= 0.19.0, < 0.20)
sorbet-runtime (>= 0.5.5685)

GEM
Expand Down Expand Up @@ -36,14 +36,14 @@ GEM
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (0.18.0)
prism (0.19.0)
psych (5.1.1.1)
stringio
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rbi (0.1.5)
prism (>= 0.18.0, < 0.19)
rbi (0.1.6)
prism (>= 0.18.0, < 0.20)
sorbet-runtime (>= 0.5.9204)
rdoc (6.6.1)
psych (>= 4.0.0)
Expand Down
4 changes: 3 additions & 1 deletion lib/ruby_indexer/lib/ruby_indexer/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def list_params(parameters_node)

rest = parameters_node.rest

if rest
if rest.is_a?(Prism::RestParameterNode)
rest_name = rest.name || RestParameter::DEFAULT_NAME
parameters << RestParameter.new(name: rest_name)
end
Expand Down Expand Up @@ -288,6 +288,8 @@ def parameter_name(node)
names << (rest.operator == "*" ? "*#{name}".to_sym : name&.to_sym)
end

names << nil if rest.is_a?(Prism::ImplicitRestNode)

names.concat(node.rights.map { |parameter_node| parameter_name(parameter_node) })

names_with_commas = names.join(", ")
Expand Down
2 changes: 1 addition & 1 deletion ruby-lsp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency("language_server-protocol", "~> 3.17.0")
s.add_dependency("prism", ">= 0.18.0", "< 0.19")
s.add_dependency("prism", ">= 0.19.0", "< 0.20")
s.add_dependency("sorbet-runtime", ">= 0.5.5685")

s.required_ruby_version = ">= 3.0"
Expand Down
Loading

0 comments on commit 01dc028

Please sign in to comment.