Skip to content

Commit

Permalink
Upgrade Prism requirement to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Aug 28, 2024
1 parent a4612cf commit 8a69488
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ group :development do
gem "rubocop", "~> 1.64"
gem "simplecov", require: false
gem "syntax_tree", ">= 6.1.1", "< 7"
gem "rbi", github: "Shopify/rbi", branch: "vs-bump-prism-requirement"

platforms :ruby do # C Ruby (MRI), Rubinius or TruffleRuby, but NOT Windows
# sorbet-static is not available on Windows. We also skip Tapioca since it depends on sorbet-static-and-runtime
Expand Down
17 changes: 12 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
GIT
remote: https://github.com/Shopify/rbi.git
revision: 24d85bee0e3664565ad66d14b3987bb3ca960e9b
branch: vs-bump-prism-requirement
specs:
rbi (0.1.14)
prism (>= 1.0.0, < 2.0.0)
sorbet-runtime (>= 0.5.9204)

GIT
remote: https://github.com/Shopify/rdoc.git
revision: 92a6b4fcf8b72dd6776c9aa6714abe6f90d4a99e
Expand All @@ -11,7 +20,7 @@ PATH
specs:
ruby-lsp (0.17.17)
language_server-protocol (~> 3.17.0)
prism (>= 0.29.0, < 0.31)
prism (>= 1.0.0, < 2.0.0)
rbs (>= 3, < 4)
sorbet-runtime (>= 0.5.10782)

Expand Down Expand Up @@ -47,15 +56,12 @@ GEM
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (0.30.0)
prism (1.0.0)
psych (5.1.2)
stringio
racc (1.8.0)
rainbow (3.1.1)
rake (13.2.1)
rbi (0.1.13)
prism (>= 0.18.0, < 1.0.0)
sorbet-runtime (>= 0.5.9204)
rbs (3.5.1)
logger
regexp_parser (2.9.2)
Expand Down Expand Up @@ -143,6 +149,7 @@ DEPENDENCIES
mocha (~> 2.3)
psych (~> 5.1)
rake (~> 13.2)
rbi!
rdoc!
rubocop (~> 1.64)
rubocop-md (~> 1.2.0)
Expand Down
2 changes: 1 addition & 1 deletion ruby-lsp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]

s.add_dependency("language_server-protocol", "~> 3.17.0")
s.add_dependency("prism", ">= 0.29.0", "< 0.31")
s.add_dependency("prism", ">= 1.0.0", "< 2.0.0")
s.add_dependency("rbs", ">= 3", "< 4")
s.add_dependency("sorbet-runtime", ">= 0.5.10782")

Expand Down
18 changes: 14 additions & 4 deletions test/requests/show_syntax_tree_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ def test_returns_partial_tree_if_document_has_syntax_error

assert_equal(<<~AST, server.pop_response.response[:ast])
@ ProgramNode (location: (1,0)-(1,6))
├── flags: ∅
├── locals: []
└── statements:
@ StatementsNode (location: (1,0)-(1,6))
├── flags: ∅
└── body: (length: 1)
└── @ CallNode (location: (1,0)-(1,6))
├── flags: ignore_visibility
├── flags: newline, ignore_visibility
├── receiver: ∅
├── call_operator_loc: ∅
├── name: :foo
Expand All @@ -29,12 +31,15 @@ def test_returns_partial_tree_if_document_has_syntax_error
├── closing_loc: ∅
└── block:
@ BlockNode (location: (1,4)-(1,6))
├── flags: ∅
├── locals: []
├── parameters: ∅
├── body:
│ @ StatementsNode (location: (1,4)-(1,6))
│ ├── flags: ∅
│ └── body: (length: 1)
│ └── @ MissingNode (location: (1,4)-(1,6))
│ └── flags: newline
├── opening_loc: (1,4)-(1,6) = "do"
└── closing_loc: (1,6)-(1,6) = ""
AST
Expand All @@ -51,17 +56,20 @@ def test_returns_ast_if_document_is_parsed

assert_equal(<<~AST, server.pop_response.response[:ast])
@ ProgramNode (location: (1,0)-(1,9))
├── flags: ∅
├── locals: [:foo]
└── statements:
@ StatementsNode (location: (1,0)-(1,9))
├── flags: ∅
└── body: (length: 1)
└── @ LocalVariableWriteNode (location: (1,0)-(1,9))
├── flags: newline
├── name: :foo
├── depth: 0
├── name_loc: (1,0)-(1,3) = "foo"
├── value:
│ @ IntegerNode (location: (1,6)-(1,9))
│ ├── flags: decimal
│ ├── flags: static_literal, decimal
│ └── value: 123
└── operator_loc: (1,4)-(1,5) = "="
AST
Expand All @@ -87,22 +95,24 @@ def test_returns_ast_for_a_selection

assert_equal(<<~AST, server.pop_response.response[:ast])
@ LocalVariableWriteNode (location: (1,0)-(1,9))
├── flags: newline
├── name: :foo
├── depth: 0
├── name_loc: (1,0)-(1,3) = "foo"
├── value:
│ @ IntegerNode (location: (1,6)-(1,9))
│ ├── flags: decimal
│ ├── flags: static_literal, decimal
│ └── value: 123
└── operator_loc: (1,4)-(1,5) = "="
@ LocalVariableWriteNode (location: (2,0)-(2,9))
├── flags: newline
├── name: :bar
├── depth: 0
├── name_loc: (2,0)-(2,3) = "bar"
├── value:
│ @ IntegerNode (location: (2,6)-(2,9))
│ ├── flags: decimal
│ ├── flags: static_literal, decimal
│ └── value: 456
└── operator_loc: (2,4)-(2,5) = "="
AST
Expand Down

0 comments on commit 8a69488

Please sign in to comment.