Stillat / vscode-antlers-language-server

Provides rich language features for Statamic's Antlers templating language, including code completions, syntax highlighting, and more.
https://antlers.dev
MIT License
36 stars 3 forks source link

Takes over formatting in Vue SFC #63

Closed daronspence closed 1 year ago

daronspence commented 1 year ago

Describe the bug When enabled in VScode, the Antlers comment syntax takes over for Vue SFC templates.

Impacted Products Which Antlers Toolbox products does this bug apply to?

Versions and Other Plugins/Extensions VS code extension 2.4.7

To Reproduce Enable the extension and try to toggle comments in <template> code in a Vue SFC. I am using the CMD+/ shortcut key to toggle the comment for the current/selected line(s).

Expected behavior That Vue's native comments would work.

CleanShot 2023-03-07 at 00 21 55

Additional context N/A

JohnathonKoster commented 1 year ago

Thanks for the report!

You can toggle this setting to disable this behavior (enabled by default):

image

If it at first it doesn't appear to do anything, just load a file with the .antlers.html file extension to ensure the extension context has loaded and toggle it again. Thanks!

jasonvarga commented 1 year ago

Sorry to comment on an older closed issue. This seems to still happen, even with the setting disabled. I'm using 2.6.1 and the Volar extension for Vue stuff.

JohnathonKoster commented 1 year ago

Sorry to comment on an older closed issue. This seems to still happen, even with the setting disabled. I'm using 2.6.1 and the Volar extension for Vue stuff.

No worries - I'll do some more investigating later this evening and see what's going on. Possible that I may remove/change that feature entirely since its historically been a pain point in one way or the other.

JohnathonKoster commented 1 year ago

@jasonvarga Can you give v2.6.2 a try and let me know how things go for you?

jasonvarga commented 1 year ago

That fixed it in Vue files, but now (as you probably expect?) only HTML comments are used in Antlers files instead of Antlers comments.

JohnathonKoster commented 1 year ago

That fixed it in Vue files, but now (as you probably expect?) only HTML comments are used in Antlers files instead of Antlers comments.

Can you try enabling the Override HTML comments option for that? That should tell the language server to handle that config instead of the built in stuff. I've tested locally and with the setting enable (on v2.6.2) I can toggle Antlers comments in my Antlers files, and .vue files are left alone, etc.

jasonvarga commented 1 year ago

When I enable that, it uses Antlers comments in Vue files.

To clarify, we're talking about in single file .vue component files. It's within the template part which contains HTML.

<template>
  <div>
    This part of the file contains html.
    Since it's not antlers, it shouldn't use antlers comments.
  </div>
</template>

<script>
  export default {
    // This part of the file contains javascript.
    // Comments were always the double slash JS comments. This part is fine.
  }
</script>
JohnathonKoster commented 1 year ago

k. Will do some thinking.

JohnathonKoster commented 1 year ago

Closing this as the behavior as been improved in v2.6.3