theme-check 1.10.3 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. data/.github/workflows/cla.yml +22 -0
  5. data/.github/workflows/theme-check.yml +1 -1
  6. data/.gitignore +3 -0
  7. data/CHANGELOG.md +48 -0
  8. data/CONTRIBUTING.md +82 -0
  9. data/README.md +11 -8
  10. data/Rakefile +7 -0
  11. data/TROUBLESHOOTING.md +65 -0
  12. data/config/default.yml +4 -0
  13. data/data/shopify_liquid/built_in_liquid_objects.json +60 -0
  14. data/data/shopify_liquid/documentation/filters.json +5528 -0
  15. data/data/shopify_liquid/documentation/latest.json +1 -0
  16. data/data/shopify_liquid/documentation/objects.json +19272 -0
  17. data/data/shopify_liquid/documentation/tags.json +1252 -0
  18. data/data/shopify_liquid/filters.yml +18 -0
  19. data/dev.yml +1 -1
  20. data/docs/checks/asset_preload.md +60 -0
  21. data/docs/checks/asset_size_javascript.md +2 -2
  22. data/docs/checks/missing_enable_comment.md +3 -3
  23. data/docs/checks/nested_snippet.md +8 -8
  24. data/docs/checks/translation_key_exists.md +4 -4
  25. data/docs/checks/valid_html_translation.md +1 -1
  26. data/lib/theme_check/analyzer.rb +18 -3
  27. data/lib/theme_check/check.rb +6 -1
  28. data/lib/theme_check/checks/asset_preload.rb +20 -0
  29. data/lib/theme_check/checks/deprecated_filter.rb +29 -5
  30. data/lib/theme_check/checks/missing_enable_comment.rb +4 -0
  31. data/lib/theme_check/checks/missing_required_template_files.rb +5 -1
  32. data/lib/theme_check/checks/missing_template.rb +5 -1
  33. data/lib/theme_check/checks/undefined_object.rb +4 -0
  34. data/lib/theme_check/checks/unused_assign.rb +6 -1
  35. data/lib/theme_check/checks/unused_snippet.rb +50 -2
  36. data/lib/theme_check/config.rb +2 -2
  37. data/lib/theme_check/disabled_checks.rb +11 -4
  38. data/lib/theme_check/file_system_storage.rb +2 -0
  39. data/lib/theme_check/in_memory_storage.rb +1 -1
  40. data/lib/theme_check/language_server/bridge.rb +31 -6
  41. data/lib/theme_check/language_server/completion_context.rb +52 -0
  42. data/lib/theme_check/language_server/completion_engine.rb +15 -21
  43. data/lib/theme_check/language_server/completion_provider.rb +16 -1
  44. data/lib/theme_check/language_server/completion_providers/assignments_completion_provider.rb +36 -0
  45. data/lib/theme_check/language_server/completion_providers/filter_completion_provider.rb +49 -6
  46. data/lib/theme_check/language_server/completion_providers/object_attribute_completion_provider.rb +47 -0
  47. data/lib/theme_check/language_server/completion_providers/object_completion_provider.rb +10 -7
  48. data/lib/theme_check/language_server/completion_providers/render_snippet_completion_provider.rb +5 -1
  49. data/lib/theme_check/language_server/completion_providers/tag_completion_provider.rb +8 -1
  50. data/lib/theme_check/language_server/diagnostics_engine.rb +80 -34
  51. data/lib/theme_check/language_server/diagnostics_manager.rb +27 -6
  52. data/lib/theme_check/language_server/execute_command_providers/run_checks_execute_command_provider.rb +7 -6
  53. data/lib/theme_check/language_server/handler.rb +93 -9
  54. data/lib/theme_check/language_server/protocol.rb +9 -0
  55. data/lib/theme_check/language_server/server.rb +42 -14
  56. data/lib/theme_check/language_server/type_helper.rb +22 -0
  57. data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder/node_handler.rb +63 -0
  58. data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb +57 -0
  59. data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb +42 -0
  60. data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder.rb +76 -0
  61. data/lib/theme_check/language_server/variable_lookup_finder/constants.rb +43 -0
  62. data/lib/theme_check/language_server/variable_lookup_finder/liquid_fixer.rb +103 -0
  63. data/lib/theme_check/language_server/variable_lookup_finder/potential_lookup.rb +10 -0
  64. data/lib/theme_check/language_server/variable_lookup_finder/tolerant_parser.rb +94 -0
  65. data/lib/theme_check/language_server/variable_lookup_finder.rb +60 -100
  66. data/lib/theme_check/language_server/variable_lookup_traverser.rb +70 -0
  67. data/lib/theme_check/language_server/versioned_in_memory_storage.rb +17 -2
  68. data/lib/theme_check/language_server.rb +12 -0
  69. data/lib/theme_check/liquid_file.rb +22 -1
  70. data/lib/theme_check/liquid_node.rb +33 -1
  71. data/lib/theme_check/liquid_visitor.rb +1 -1
  72. data/lib/theme_check/remote_asset_file.rb +13 -7
  73. data/lib/theme_check/schema_helper.rb +1 -1
  74. data/lib/theme_check/shopify_liquid/documentation/markdown_template.rb +51 -0
  75. data/lib/theme_check/shopify_liquid/documentation.rb +44 -0
  76. data/lib/theme_check/shopify_liquid/filter.rb +4 -0
  77. data/lib/theme_check/shopify_liquid/object.rb +4 -0
  78. data/lib/theme_check/shopify_liquid/source_index/base_entry.rb +60 -0
  79. data/lib/theme_check/shopify_liquid/source_index/base_state.rb +23 -0
  80. data/lib/theme_check/shopify_liquid/source_index/filter_entry.rb +18 -0
  81. data/lib/theme_check/shopify_liquid/source_index/filter_state.rb +11 -0
  82. data/lib/theme_check/shopify_liquid/source_index/object_entry.rb +14 -0
  83. data/lib/theme_check/shopify_liquid/source_index/object_state.rb +11 -0
  84. data/lib/theme_check/shopify_liquid/source_index/parameter_entry.rb +21 -0
  85. data/lib/theme_check/shopify_liquid/source_index/property_entry.rb +9 -0
  86. data/lib/theme_check/shopify_liquid/source_index/return_type_entry.rb +37 -0
  87. data/lib/theme_check/shopify_liquid/source_index/tag_entry.rb +20 -0
  88. data/lib/theme_check/shopify_liquid/source_index/tag_state.rb +11 -0
  89. data/lib/theme_check/shopify_liquid/source_index.rb +56 -0
  90. data/lib/theme_check/shopify_liquid/source_manager.rb +111 -0
  91. data/lib/theme_check/shopify_liquid/tag.rb +4 -0
  92. data/lib/theme_check/shopify_liquid.rb +17 -1
  93. data/lib/theme_check/tags.rb +2 -1
  94. data/lib/theme_check/version.rb +1 -1
  95. data/shipit.rubygems.yml +3 -0
  96. data/theme-check.gemspec +5 -3
  97. metadata +45 -6
  98. data/.github/probots.yml +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2774c1d3e2e9b8fa7dab0fdd4174dbfd3e625c608af349c30f526f00a6b9123
4
- data.tar.gz: 69bdb078be8aa938b2dec75a62206840586ae1a015620ec3c9ce727e49fc2e07
3
+ metadata.gz: 81371af549f2572360879747bb2e4a05ccddc52e564180d6ae7d0b8e73026e3f
4
+ data.tar.gz: 586263191e54240240110853f7a4973413bb5aa1c1e2412c2ac293876a25fc1f
5
5
  SHA512:
6
- metadata.gz: aa83efd1994e95fd12defc06b13567fac6e80fd830fb870f7a50b650424b8ed339848271ac35c608b6bc40a3e884665a3136c1f75e150be937be8b78e74df9fc
7
- data.tar.gz: 848e2752ecc6e6bb4b0954663dac298f869a191d0b4b146fd488b8a9a442a5573a1c716c84658b2654431f96db1572309c70991a2e29e37c1bf82bd337c79edd
6
+ metadata.gz: b050fff19499529cc00a4382ddc2b525002cfb3058bb4f292d0a2181093d4a4854e62f1cf0736397f0eee40aca8d2f1ec073a3a6093b1e50106fd66600938e90
7
+ data.tar.gz: '09f65761f31e53c11c3e723d1651426a6787b5360a67bf8c9c833cd51ab2352b32b18b69580c143193f45ce9438e09a22c95dda66a98c344e4eaee5d3293ce9b'
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ <!--A clear and concise description of what the bug is.-->
12
+
13
+ **Expected**
14
+ <!-- Include what you expect should happen here -->
15
+
16
+ **Actual**
17
+ <!-- Include a description of what actually happens here -->
18
+
19
+ **Stack trace**
20
+ ```
21
+ <!-- When provided, please include the entire error message in here -->
22
+ ```
23
+
24
+ **Debugging information**
25
+ - OS [e.g. Windows, Mac, Linux]
26
+ - Version (output of `theme-check --version` in a terminal)
27
+
28
+ **Additional context**
29
+ <!-- Add any other context or screenshots about the problem here. -->
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12
+
13
+ **Describe the solution you'd like**
14
+ <!-- A clear and concise description of what you want to happen. -->
15
+
16
+ **Describe alternatives you've considered**
17
+ <!-- A clear and concise description of any alternative solutions or features you've considered. -->
18
+
19
+ **Additional context**
20
+ <!-- Add any other context or screenshots about the feature request here. -->
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
@@ -13,7 +13,7 @@ jobs:
13
13
  - windows-latest
14
14
  version:
15
15
  - 3.0.0
16
- - 2.6.6
16
+ - 2.7.6
17
17
  theme:
18
18
  - Shopify/dawn
19
19
 
data/.gitignore CHANGED
@@ -14,3 +14,6 @@ Gemfile.lock
14
14
  packaging/builds
15
15
  .vscode
16
16
  *.DS_Store
17
+
18
+ # Theme Liquid docs live at git@github.com:Shopify/theme-liquid-docs.git,
19
+ /data/shopify_liquid/documentation/
data/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ v1.12.0 / 2022-12-12
2
+ ==================
3
+
4
+ * Introduce Intelligent Code Completion ([#672](https://github.com/Shopify/theme-check/issues/672))
5
+ * Update TROUBLESHOOTING.md to include language server stopping guide ([#664](https://github.com/Shopify/theme-check/issues/664))
6
+ * Create troubleshooting doc, update contributing and readme with links ([#630](https://github.com/Shopify/theme-check/issues/630))
7
+ * robots Object in robots.txt file ([#644](https://github.com/Shopify/theme-check/issues/644)). Thanks @we5!
8
+
9
+ v1.11.0 / 2022-08-22
10
+ ====================
11
+
12
+ ## TL;DR
13
+
14
+ * New check, overdue fixes and dropped support for ruby 2.6.
15
+
16
+ ## Features
17
+
18
+ * :new: [AssetPreload](https://github.com/Shopify/theme-check/blob/main/docs/checks/asset_preload.md) check ([#605](https://github.com/shopify/theme-check/issues/605)). Thanks @krzksz!
19
+ * Encourages the use of the new platform features for some sweet 103 Early Hints gains powered by the `preload_tag` and `preload: true` media filter argument.
20
+
21
+ ## Fixes:
22
+
23
+ ### General
24
+
25
+ * Add support for new comment syntax `{% # this is an inline comment %}` ([#533](https://github.com/shopify/theme-check/issues/533))
26
+ * Fix UnusedAssign false positives from `{% render ... with|for var %}` ([#608](https://github.com/shopify/theme-check/issues/608))
27
+ * Update list of platform filters ([#626](https://github.com/shopify/theme-check/issues/626))
28
+
29
+ ### Language Server
30
+
31
+ * Make `runChecks` command respect `onlySingleFileChecks` LSP config ([#624](https://github.com/shopify/theme-check/issues/624))
32
+ * Handle file delete|rename ([#611](https://github.com/shopify/theme-check/issues/611))
33
+ * Prevent server from hanging on error ([#623](https://github.com/shopify/theme-check/issues/623))
34
+
35
+ ### Linter
36
+
37
+ * Help migrate named sizes (master|pico|etc.) in `img_url` with `DeprecatedFilter` corrector ([#619](https://github.com/shopify/theme-check/issues/619))
38
+ * Fix MissingTemplate `ignore` config interactions (#613)
39
+ * Fix MissingRequiredTemplateFiles JSON file corrector ([#616](https://github.com/shopify/theme-check/issues/616))
40
+ * Fixes theme-check-disable when disable comment is followed by another (#617)
41
+ * Fix handling of `{% render block %}` in UnusedSnippet ([#615](https://github.com/shopify/theme-check/issues/615))
42
+ * Fix IndexError: string not matched in matching translation keys fixer ([#602](https://github.com/shopify/theme-check/issues/602))
43
+ * Handle variable lookup as names in UnusedAssign ([#612](https://github.com/shopify/theme-check/issues/612))
44
+
45
+ ## Breaking change (maybe)
46
+
47
+ * Bump min version of ruby to 2.7 ([#609](https://github.com/shopify/theme-check/issues/609))
48
+ * Upstream change from Shopify/liquid as ruby 2.6 is now EOL.
1
49
 
2
50
  v1.10.3 / 2022-06-16
3
51
  ==================
data/CONTRIBUTING.md CHANGED
@@ -21,6 +21,84 @@ For your contribution to be accepted you will need to sign the [Shopify Contribu
21
21
  4. Push to the branch (`git push origin my-new-feature`)
22
22
  5. Create a new Pull Request
23
23
 
24
+ ## Run Language Server
25
+ If you're making changes to the language server and you want to debug, you can run the repo's version of `theme-check-language-server`.
26
+
27
+ ### Setup
28
+
29
+ Before configuring your IDE, run the following commands in a terminal:
30
+
31
+ * Make sure you have a `$HOME/bin`
32
+ ```bash
33
+ mkdir -p $HOME/bin
34
+ ```
35
+ * Paste this script to create an executable wrapper in `$HOME/bin/theme-check-language-server` for language server
36
+ ```bash
37
+ cat <<-'EOF' > $HOME/bin/theme-check-language-server
38
+ #!/usr/bin/env bash
39
+ cd "$HOME/src/github.com/Shopify/theme-check" &> /dev/null
40
+ chruby () {
41
+ source '/opt/dev/sh/chruby/chruby.sh'
42
+ chruby "$@"
43
+ }
44
+ export THEME_CHECK_DEBUG=true
45
+ export THEME_CHECK_DEBUG_LOG_FILE="/tmp/theme-check-debug.log"
46
+ touch "$THEME_CHECK_DEBUG_LOG_FILE"
47
+ chruby 2.7 &>/dev/null
48
+ gem env &>/dev/null
49
+ bin/theme-check-language-server
50
+ EOF
51
+ ```
52
+ * Make the script executable
53
+ ```bash
54
+ chmod u+x $HOME/bin/theme-check-language-server
55
+ ```
56
+
57
+ #### Configure VS Code
58
+
59
+ * Install the [Shopify Liquid](https://github.com/shopify/theme-check-vscode) plugin
60
+
61
+ * Add the following to `settings.json`:
62
+
63
+ ```json
64
+ "shopifyLiquid.formatterDevPreview": true,
65
+ "shopifyLiquid.languageServerPath": "/Users/<YOUR_USERNAME>/bin/theme-check-language-server",
66
+ ```
67
+
68
+ #### Configure Vim
69
+
70
+ If you use `coc.nvim` as your completion engine, add this to your CocConfig:
71
+
72
+ ```json
73
+ "languageserver": {
74
+ "theme-check": {
75
+ "command": "/Users/<YOUR_USERNAME>/bin/theme-check-language-server",
76
+ "trace.server": "verbose",
77
+ "filetypes": ["liquid", "liquid.html"],
78
+ "rootPatterns": [".theme-check.yml", "snippets/*"],
79
+ "settings": {
80
+ "themeCheck": {
81
+ "checkOnSave": true,
82
+ "checkOnEnter": true,
83
+ "checkOnChange": false
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ ### Confirm Setup
90
+
91
+ * In another terminal from the root of theme check run `tail -f /tmp/theme-check-debug.log` to watch the server logs
92
+ * Restart your IDE, confirm the response for initialize in the logs is pointing to the language server in the `$HOME/bin` directory (the version will be different)
93
+
94
+ ```json
95
+ "serverInfo": {
96
+ "name": "/Users/johndoe/bin/theme-check-language-server",
97
+ "version": "1.10.3"
98
+ }
99
+ ```
100
+
101
+
24
102
  ## Running Tests
25
103
 
26
104
  ```
@@ -123,3 +201,7 @@ chrome /tmp/fg.svg
123
201
  What you'll see is an interactive version of the following image:
124
202
 
125
203
  ![flamegraph](docs/flamegraph.svg)
204
+
205
+ ## Troubleshooting
206
+
207
+ If you run into issues during development, see the [troubleshooting guide](/TROUBLESHOOTING.md)
data/README.md CHANGED
@@ -115,32 +115,31 @@ See [config/default.yml](config/default.yml) for available options & defaults.
115
115
  Use Liquid comments to disable and re-enable all checks for a section of your template:
116
116
 
117
117
  ```liquid
118
- {% comment %}theme-check-disable{% endcomment %}
118
+ {% # theme-check-disable %}
119
119
  {% assign x = 1 %}
120
- {% comment %}theme-check-enable{% endcomment %}
120
+ {% # theme-check-enable %}
121
121
  ```
122
122
 
123
123
  Disable a specific check by including it in the comment:
124
124
 
125
125
  ```liquid
126
- {% comment %}theme-check-disable UnusedAssign{% endcomment %}
126
+ {% # theme-check-disable UnusedAssign %}
127
127
  {% assign x = 1 %}
128
- {% comment %}theme-check-enable UnusedAssign{% endcomment %}
128
+ {% # theme-check-enable UnusedAssign %}
129
129
  ```
130
130
 
131
131
  Disable multiple checks by including them as a comma-separated list:
132
132
 
133
133
  ```liquid
134
- {% comment %}theme-check-disable UnusedAssign,SpaceInsideBraces{% endcomment %}
134
+ {% # theme-check-disable UnusedAssign,SpaceInsideBraces %}
135
135
  {%assign x = 1%}
136
- {% comment %}theme-check-enable UnusedAssign,SpaceInsideBraces{% endcomment %}
136
+ {% # theme-check-enable UnusedAssign,SpaceInsideBraces %}
137
137
  ```
138
138
 
139
139
  Disable checks for the _entire document_ by placing the comment on the first line:
140
140
 
141
141
  ```liquid
142
- {% comment %}theme-check-disable SpaceInsideBraces{% endcomment %}
143
-
142
+ {% # theme-check-disable SpaceInsideBraces %}
144
143
  {%assign x = 1%}
145
144
  ```
146
145
 
@@ -191,3 +190,7 @@ DeprecateLazysizes:
191
190
  ⚠️ **Note:** Quickfixes only work on a freshly checked file. If any of those configurations are turned off, you will need to rerun theme-check in order to apply quickfixes.
192
191
 
193
192
  In VS Code, these can be set directly in your `settings.json`.
193
+
194
+ ## Contributing
195
+
196
+ For guidance on contributing, refer to this [doc](/CONTRIBUTING)
data/Rakefile CHANGED
@@ -53,6 +53,13 @@ task :prerelease, [:version] do |_t, args|
53
53
  ThemeCheck::Releaser.new.release(args.version)
54
54
  end
55
55
 
56
+ desc("Download theme-liquid-docs")
57
+ task :download_theme_liquid_docs do
58
+ require 'theme_check/shopify_liquid/source_manager'
59
+
60
+ ThemeCheck::ShopifyLiquid::SourceManager.download
61
+ end
62
+
56
63
  desc "Create a new check"
57
64
  task :new_check, [:name] do |_t, args|
58
65
  require "theme_check/string_helpers"
@@ -0,0 +1,65 @@
1
+ # Troubleshooting
2
+
3
+ ## Issues with Language Server
4
+
5
+ ### Language server erroring out on startup
6
+
7
+ The following error can cause language server to crash:
8
+ ```bash
9
+ Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
10
+ /Users/johndoe/.gem/ruby/3.1.2/gems/bundler-2.2.22/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find ruby-prof-0.18.0 in any of the sources (Bundler::GemNotFound)
11
+ ```
12
+
13
+ Confirm the version of theme-check matches the version in the wrapper in `~/bin/theme-language-server`. If it doesn't match the ruby version, run the following from the theme-check directory:
14
+
15
+ ```bash
16
+ chruby 3.1.2 #your `~/bin/theme-language-server` ruby version
17
+ bundle install
18
+ ```
19
+
20
+ ### Language server changes not propogating to your IDE
21
+
22
+ Look at logs for language server and check the response for initialize. If it looks like this, you're pointing to the Shopify CLI and not the language server in the repo:
23
+
24
+ ```json
25
+ "serverInfo": {
26
+ "name": "/opt/homebrew/bin/shopify",
27
+ "version": "1.10.3"
28
+ }
29
+ ```
30
+
31
+ Check the config for your IDE/completion engine and confirm the Shopify CLI path isn't present (this by default overrides theme-check pointing to the repo's language server). If you're using VS Code this would be in your `settings.json`.
32
+
33
+ The response for initialize should look like this:
34
+
35
+ ```json
36
+ "serverInfo": {
37
+ "name": "/Users/johndoe/src/github.com/Shopify/theme-check/bin/theme-check-language-server",
38
+ "version": "1.10.3"
39
+ }
40
+ ```
41
+
42
+ If this isn't an issue, confirm the theme check repo's version of ruby matches the ruby version of your theme. If it doesn't, from the theme-check repo run:
43
+
44
+ ```bash
45
+ chruby 3.1.2 #your theme ruby version
46
+ bundle install
47
+ ```
48
+
49
+ ### Language server sends an `initialize()` request to the client and stops
50
+
51
+ To debug, confirm these steps are included in your local language server startup script:
52
+
53
+ ```bash
54
+ export THEME_CHECK_DEBUG=true
55
+ export THEME_CHECK_DEBUG_LOG_FILE="/tmp/theme-check-debug.log"
56
+ touch "$THEME_CHECK_DEBUG_LOG_FILE"
57
+ ```
58
+
59
+ An example script can be found [here](/CONTRIBUTING.md#run-language-server).
60
+
61
+ Open `/tmp/theme-check-debug.log` in your IDE. Check if there are any exceptions being raised by language server.
62
+
63
+ If there are no exceptions, check if there are any logs that aren't in jsonrpc. The language server and client use stdin and stdout to communicate using jsonrpc. Debugging statements that aren't in a jsonrpc format might trigger unexpected behavior (this includes any logs from language server or echo statements in your language server script).
64
+
65
+
data/config/default.yml CHANGED
@@ -131,6 +131,10 @@ ParserBlockingScriptTag:
131
131
  enabled: true
132
132
  ignore: []
133
133
 
134
+ AssetPreload:
135
+ enabled: true
136
+ ignore: []
137
+
134
138
  AssetSizeJavaScript:
135
139
  enabled: false
136
140
  threshold_in_bytes: 10_000
@@ -0,0 +1,60 @@
1
+ [
2
+ {
3
+ "properties": [
4
+ {
5
+ "name": "first",
6
+ "return_type": [
7
+ {
8
+ "type": "generic"
9
+ }
10
+ ],
11
+ "description": "Returns the first item of an array."
12
+ },
13
+ {
14
+ "name": "size",
15
+ "description": "Returns the number of items in an array."
16
+ },
17
+ {
18
+ "name": "last",
19
+ "return_type": [
20
+ {
21
+ "type": "generic"
22
+ }
23
+ ],
24
+ "description": "Returns the last item of an array."
25
+ }
26
+ ],
27
+ "name": "array",
28
+ "description": "Arrays hold lists of variables of any type."
29
+ },
30
+ {
31
+ "properties": [
32
+ {
33
+ "name": "size",
34
+ "description": "Returns the number of characters in a string."
35
+ }
36
+ ],
37
+ "name": "string",
38
+ "description": "Strings are sequences of characters wrapped in single or double quotes."
39
+ },
40
+ {
41
+ "properties": [],
42
+ "name": "number",
43
+ "description": "Numeric values, including floats and integers."
44
+ },
45
+ {
46
+ "properties": [],
47
+ "name": "boolean",
48
+ "description": "A binary value, either true or false."
49
+ },
50
+ {
51
+ "properties": [],
52
+ "name": "nil",
53
+ "description": "An undefined value. Tags or outputs that return nil don't print anything to the page. They are also treated as false."
54
+ },
55
+ {
56
+ "properties": [],
57
+ "name": "empty",
58
+ "description": "An empty object is returned if you try to access an object that is defined, but has no value. For example a page or product that’s been deleted, or a setting with no value. You can compare an object with empty to check whether an object exists before you access any of its attributes."
59
+ }
60
+ ]