Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Languageserver Crashes - VSCode WSL2 Win11 #721

Closed
ChristopherCapito opened this issue Mar 4, 2023 · 3 comments
Closed

Languageserver Crashes - VSCode WSL2 Win11 #721

ChristopherCapito opened this issue Mar 4, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ChristopherCapito
Copy link

ChristopherCapito commented Mar 4, 2023

Describe the bug
The language server crashes after going through the theme files.

Expected
I expecte the check to suceed or fail, but not to crash without a result.

Actual
The languagserver goes through all files, on the last one (locales/en.default.json) it crashes.

Stack trace

Checking . ...
Exception while running `NestedSnippet#on_end`:
Timeout::Error: execution expired
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/offense.rb:33:in `initialize'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/check.rb:96:in `new'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/check.rb:96:in `add_offense'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:42:in `block (2 levels) in on_end'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block (2 levels) in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block (2 levels) in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block (2 levels) in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:13:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:17:in `block in with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each_key'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/set.rb:511:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:11:in `with_deep_nested'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:41:in `block in on_end'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:40:in `each_pair'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks/nested_snippet.rb:40:in `on_end'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:42:in `block in call_check_method'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:189:in `block in timeout'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:36:in `block in catch'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:36:in `catch'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:36:in `catch'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/3.2.0/timeout.rb:198:in `timeout'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:41:in `call_check_method'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:11:in `block in call'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:10:in `each'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/checks.rb:10:in `call'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/analyzer.rb:170:in `finish'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/analyzer.rb:64:in `analyze_theme'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:191:in `check'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:123:in `run!'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:127:in `run'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/lib/theme_check/cli.rb:149:in `parse_and_run'
  /home/cdev/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/theme-check-1.14.0/exe/theme-check:6:in `<top (required)>'
  /home/cdev/.rbenv/versions/3.2.1/bin/theme-check:25:in `load'
  /home/cdev/.rbenv/versions/3.2.1/bin/theme-check:25:in `<main>'

Theme File: ?
Node: ?
Markup:


Line number: ?
Check options: {:max_nesting_level=>3}
Theme Check Version: 1.14.0
Ruby Version: 3.2.1
Platform: x86_64-linux
Muffin mode: activated


**Debugging information**
- OS [Windows 11, WSL2]
- Version 1.14.0

**Additional context**
The same error occurs with the VSCode Shopify Liquid extension.
@ChristopherCapito ChristopherCapito added the bug Something isn't working label Mar 4, 2023
@Taichi-S
Copy link

I'm also encountering the same issue

@Taichi-S
Copy link

@ChristopherCapito
I'm not sure how it works, but I was able to run it without any bugs

Here is what I did:

  1. init .theme-check.yml
theme-check --init
  1. change mac_nesting_level of NestedSnippet to 1 in .theme-check.yml (default value was 3. when it is 2, other warning happened)
NestedSnippet:
  enabled: true
  ignore: []
  max_nesting_level: 1
  1. run theme-check using the .theme-check.yml
theme-check -C .theme-check.yml

@lukeh-shopify
Copy link
Contributor

👋🏻 Hi @ChristopherCapito! Thanks for reporting this. Unfortunately the Ruby version of theme check has been deprecated for some time. Would you be able to confirm you are still having issues when using our maintained version of theme check? This is done using either the latest version of the Shopify CLI, or via the Shopify Liquid Visual Studio Code extension.

If you are still having issues, please raise an issue over in the CLI or theme tools repositories. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants