panoply / vscode-liquid

💧Liquid language support for VS Code
https://marketplace.visualstudio.com/items?itemName=sissel.shopify-liquid
Other
171 stars 23 forks source link

causing saves to take forever #169

Closed jamschutz closed 9 months ago

jamschutz commented 10 months ago

Type: Bug

extension is causing saves to take an extremely long time

Extension version: 3.2.2 VS Code version: Code 1.82.0 (8b617bd08fd9e3fc94d14adb8d358b56e3f72314, 2023-09-06T22:07:07.438Z) OS version: Windows_NT x64 10.0.22621 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 6900HS with Radeon Graphics (16 x 3294)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.23GB (2.76GB free)| |Process Argv|F:\\The Videogame Archive --crash-reporter-id 5684212c-4bb7-4759-b1a7-619d4abe95bb| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263:30792226 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30803845 282f8724:30602487 f6dab269:30613381 showlangstatbar:30737416 a2ce3375:30757347 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30805730 pythonnoceb:30805159 dsvsc013:30795093 dsvsc014:30804076 diffeditorv2:30821572 dsvsc015cf:30829746 ```
panoply commented 10 months ago

Hey @jamschutz,

Migrate to v4 the pre-release is stable enough.

I have not yet rolled it out to users, just so you are aware. I will notify you once the final release is made available.

Step 1 - Download the VSIX

Visit this link: https://github.com/panoply/vscode-liquid/blob/next/shopify-liquid-4.0.0.vsix and download the VSIX file. Follow what I have done in the below screener:

https://github.com/panoply/liquify/assets/7041324/9350ab0e-0e13-4edf-bf3d-bfec08386a67

Step 2 - Install the VSIX

Next, you need to install the VSIX file you've just downloaded. You can do this via the extensions tab in vscode. Follow what I have down in the below screener. After you've installed it, restart vscode and move onto step 3.

https://github.com/panoply/liquify/assets/7041324/07603416-c958-419e-9be9-0324017aa99a

Step 3 - Upgrading to v4.0

As aforementioned, I have not rolled this version out to users, as such in order for you to leverage it you will need to align with the next configuration options and also get familiar with the new features. Let's start with the .liquidrc file configuration. This has changed, so the first step is to update it. Remove all the configuration and add the following.

{
  "engine": "shopify",
  "files": {
    "settings": "", // OPTIONAL - you can provide a path to your settings_schema.json file to get completions
    "locales": "", // OPTIONAL - you can provide a path to your en.default.json file to get locale completions
    "sections": [], // OPTIONAL  - you can provide paths to you sections to get completions in section tags
    "snippets": [] // OPTIONAL  - You can provide paths to your snippet files to get completions in render tags
  },
  "format": {} // You can add formatting rules here if you want, but in your case you don't have too.
}

Secondly, the readme file in the next branch will inform on all the new the features available etc. Start with Workspace Settings portion.

Step 4 - Ensuring Format on Save is disabled

This one is easy in v4. Basically, we simply control formatting via workspace settings as follows.

In you .vscode/settings.json file, add the following:

{
  "[liquid]": {
    "editor.defaultFormatter": "sissel.shopify-liquid",
    "editor.formatOnSave": false // Make sure this is false
  }
}

It is important to note that you can enable/disable formatting by clicking the 💧emoji in your vscode activity bar. Below is a small screener to help which shows steps 3 and 4. In the below video, I show how you can enable and disable formatting. Based on what you need, you can just keep formatting disabled, but if you do wish to enable it, just click the emoji. When you do this, then the extension will change the "editor.formatOnSave": false option to true

https://github.com/panoply/liquify/assets/7041324/508603ad-e696-4d04-a8bc-a5a08f515e07

I hope this helps you. Please let me know how you go.

panoply commented 9 months ago

fixed in 4.0