diff --git a/Gemfile b/Gemfile index 7f2eca03b3..c5c610b884 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 4b5c0778aa..80e0cc5993 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 @@ -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) @@ -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) @@ -143,6 +149,7 @@ DEPENDENCIES mocha (~> 2.3) psych (~> 5.1) rake (~> 13.2) + rbi! rdoc! rubocop (~> 1.64) rubocop-md (~> 1.2.0) diff --git a/ruby-lsp.gemspec b/ruby-lsp.gemspec index f746380152..dbc15e1f16 100644 --- a/ruby-lsp.gemspec +++ b/ruby-lsp.gemspec @@ -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") diff --git a/test/requests/show_syntax_tree_test.rb b/test/requests/show_syntax_tree_test.rb index cbf0d902c0..9e77bcd8c7 100644 --- a/test/requests/show_syntax_tree_test.rb +++ b/test/requests/show_syntax_tree_test.rb @@ -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 @@ -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 @@ -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 @@ -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