Skip to content

SyntaxTree::Parser::ParseError crash in vscode #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
masterkain opened this issue Aug 17, 2022 · 1 comment
Closed

SyntaxTree::Parser::ParseError crash in vscode #138

masterkain opened this issue Aug 17, 2022 · 1 comment

Comments

@masterkain
Copy link

I just noticed syntax_tree having an argument with the contents of this file and crashing:

if ::ActiveRecord.respond_to?(:use_yaml_unsafe_load)
  ::ActiveRecord.use_yaml_unsafe_load = false
  ::ActiveRecord.yaml_column_permitted_classes = [
    ::ActionController::Parameters
    ::ActiveRecord::Type::Time::Value,
    ::ActiveSupport::HashWithIndifferentAccess
    ::ActiveSupport::TimeWithZone,
    ::ActiveSupport::TimeZone,
    ::BigDecimal,
    ::Date,
    ::Symbol,
    ::Time,
  ]
end

it crashes even if stripped down of ::, not sure what's going on.

/Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/lib/syntax_tree/parser.rb:2474:in `on_parse_error': syntax error, unexpected :: at EXPR_BEG, expecting ']' (SyntaxTree::Parser::ParseError)
	from /Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/lib/syntax_tree.rb:46:in `parse'
	from /Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/lib/syntax_tree.rb:46:in `parse'
	from /Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/lib/syntax_tree.rb:53:in `format'
	from /Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/lib/syntax_tree/language_server.rb:101:in `format'
	from /Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/lib/syntax_tree/language_server.rb:59:in `run'
	from /Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/lib/syntax_tree/cli.rb:310:in `run'
	from /Users/kain/.rvm/gems/ruby-3.0.0/gems/syntax_tree-3.3.0/exe/stree:9:in `<top (required)>'
	from /Users/kain/.rvm/gems/ruby-3.0.0/bin/stree:23:in `load'
	from /Users/kain/.rvm/gems/ruby-3.0.0/bin/stree:23:in `<main>'
[Info  - 8:43:17 PM] Connection to server got closed. Server will restart.
@masterkain
Copy link
Author

ops, my bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant