Skip to content
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

Formatting issues #33

Closed
davidpanzarella opened this issue Sep 9, 2019 · 20 comments
Closed

Formatting issues #33

davidpanzarella opened this issue Sep 9, 2019 · 20 comments

Comments

@davidpanzarella
Copy link

Is this normal behavior?

shopify_ffol-1568046253555
shopify_ffol-1568046282171

If I change the Language Mode to Liquid instead of HTML it does no formatting at all.

I have the following in my .liquidrc

{
  "ignore": [
    {
      "type": "liquid",
      "begin": "comment",
      "end": "endcomment"
    },
    {
      "type": "html",
      "begin": "script",
      "end": "script"
    },
    {
      "type": "html",
      "begin": "style",
      "end": "style"
    }
  ],
  "html": {
    "correct": true,
    "force_attribute": true,
    "braces": true,
    "brace_block": true,
    "wrap": 2,
    "preserve": 0,
    "unformatted": false
  },
  "js": {
    "preserve": 1,
    "method_chain": 0,
    "quote_convert": "none",
    "format_array": "indent",
    "format_object": "indent",
    "braces": false,
    "no_semicolon": false,
    "brace_block": true
  },
  "scss": {
    "css_insert_lines": true,
    "preserve": 2,
    "braces": false,
    "brace_block": true
  },
  "css": {
    "css_insert_lines": true,
    "preserve": 2,
    "braces": false,
    "brace_block": false
  },
  "json": {
    "preserve": 0,
    "braces": false,
    "brace_block": true,
    "no_semicolon": true
  }
}

Am I missing something? Thanks in advance!

@panoply
Copy link
Owner

panoply commented Sep 9, 2019

By default the extension will only be initialized when the Language mode is HTML, so this is expected behavior for the current version (2.3.0^) – The upcoming release (2.4.0) will support this type of thing as formatting will be applied according to file extension.

The way the extension works is by injecting Liquid syntaxes into HTML, so you shouldn't need to switch Language modes as Liquid files (.liquid) are just regular HTML files.

@panoply panoply added the 💧Liquify Features shipping in Liquify label Sep 10, 2019
@davidpanzarella
Copy link
Author

@panoply thanks for the response! Any eta on 2.4?

@panoply
Copy link
Owner

panoply commented Sep 11, 2019

Last of the updates are being applied tonight (12 months ago, I was apparently optimistic) . You will need to make changes to the rules file which will be documented in version release.

@davidpanzarella
Copy link
Author

@panoply are you going to merge that branch soon?

@panoply
Copy link
Owner

panoply commented Sep 17, 2019

Hey @davidpanzarella, apologies on the delay for this. Might be a little longer as I will ship Intellisense features with 2.4.0 which took a longer than expected to implement and has delayed the merge. If you can hold out a little longer it will be well worth the wait.

dd

@davidpanzarella
Copy link
Author

No worries at all, just checking in. That looks dope! Good stuff @panoply!

@davidpanzarella
Copy link
Author

Hey @panoply, just following up. I see you're making some good progress on your 2.4 branch. Are you in any state to merge soon?

@panoply
Copy link
Owner

panoply commented Sep 26, 2019

Hey @davidpanzarella thanks for keeping engaged. Yes! almost done with this release. Liquid will have it's own Language mode (no longer uses HTML injection) and will have all the intellisense features too. Completions etc etc. I'm looking at a complete and final merge for the weekend.

@davidpanzarella
Copy link
Author

Just checking in again. Think it'll be out soon? Looks like you're nearly there! I'm tempted to pull down this branch, and try it out on my own! 😉

@panoply
Copy link
Owner

panoply commented Oct 3, 2019

Yo Davey. I feel terrible for subjecting you and other users to the constant delay for this release and I want to thank you for your patience. I keep adding in features to this version which is why we are not live. To keep you in the loop:

Version 2.4.0 now implements its own Liquid Language Server whereas previous versions apply features programmatically this version applies features using LSP. It's been difficult (or rather time consuming) to achieve this in combination with my job, girlfriend and constant partying (I live in Amsterdam). Additionally I've had to manually add in support for completions (intellisense) for the Shopify, Jekyll and Standard Liquid variation engines (which has been a whole lot of copy paste) so as to provide users with awesome and helpful code auto-completions/hovers.

I wouldn't pull down the branch just yet, as a lot of work still sits on my computer and still needs to be pushed but we a lot closer now then we were a week or so ago. I hope you can forgive me 🙏


If you like, I will ship you the beta version when it's ready?

@davidpanzarella
Copy link
Author

Hey @panoply, don't feel terrible! This is pretty awesome of you to put an extension out there into the world for all of us to use!

Glad to hear it's coming along well, and yes, I'd be very much interested in Beta. I'll even do some QA for you! Just let me know when it's ready to test, and I'll rebase a copy locally to check out.

Thanks again for the work and update!

@panoply
Copy link
Owner

panoply commented Oct 11, 2019

Hey @davidpanzarella, keeping you in the loop. I will be sifting through all my local additions, changes and updates tonight/tomorrow and pushing them the 2.4 branch. Some real progress made and it would be great to have you test.

I will provide a VSIX file within that branch once its ready which you can install. There are breaking changes as mentioned in previous communications so it will be good to get your feedback on how you handle dealing with them.

@davidpanzarella
Copy link
Author

@panoply, that's awesome to hear! Just let me know when you're ready for me to test and i'll give you the run down.

@davidpanzarella
Copy link
Author

@panoply think you're ready for me to test?

@davidpanzarella
Copy link
Author

@panoply ... at a place for me to test yet?

@davidpanzarella
Copy link
Author

@panoply bump... any updates?

@panoply
Copy link
Owner

panoply commented Oct 27, 2019

Hey @davidpanzarella, sorry I've been busy with my other job recently I still haven't had the time to wrap up this version or respond, again my apologies.

There are only a few aspects left to complete before you can test. I think I mentioned this but 2.4 is a complete overhaul of the extension and most if not all the current features are now provided over LSP. This means that other editors like Atom can leverage the Liquid Language Server I've developed and provide its functionality to not only VS Code but any editor which uses the LSP specification.

The new features I want to deliver are mostly listed here and you will notice there are some very helpful integrations coming but it's been extremely time consuming to architect everything in a correct manner. Because the extension aims to provide support for all Liquid engines (variations) not only will Shopify and Jekyll developers reap the benefits but other Liquid variations used in projects can extend upon it too.

Providing these features and delivering the extension via LSP required a lexer to be developed that parses documents and applies functionality on a per-tag basis. This means that tags like the shopify {% schema %} tag will now use JSON intellisense features and from what I have seen this (for example) is the first implementation of embedded JSON being leveraged and applied in the VS Code ecosystem.

What originally was a few changes has turned into something much larger. I hope you can hold out a bit longer my digital friend.

@davidpanzarella
Copy link
Author

Thanks for the follow-up @panoply! Those features look pretty awesome! Keep me posted when you're ready to test. I'll keep waiting in the meantime. 👍

@WhiteR4bbitt
Copy link

WhiteR4bbitt commented Nov 30, 2019

Hey, I just wanted to stop by and mention I was having this issue too, but noticed it was only when using my default Format shortcut (Ctrl + K, Ctrl + L ), I then tried the one that gets added with the extension (Im assuming) which is Ctrl + Shift + L and my file formatted beautifully!

So if anyone is looking this may also help you quickly format the files without any configuring.

@panoply panoply added this to the Liquify milestone Aug 9, 2020
@panoply panoply added v3.0.0 and removed 💧Liquify Features shipping in Liquify labels Sep 25, 2022
@panoply panoply removed this from the Liquify milestone Sep 25, 2022
@panoply
Copy link
Owner

panoply commented Sep 28, 2022

🚢 Shipped v3.0.0

Note

The language is no longer associated to HTML - Instead it is now recognized as Liquid.

@panoply panoply closed this as completed Sep 28, 2022
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

3 participants