ember-tooling / tree-sitter-glimmer

A TreeSitter grammar for Glimmer (HBS) templates
https://ember-tooling.github.io/tree-sitter-glimmer/
24 stars 3 forks source link

Block comments should use `{{!-- -}}` (long form) by default and let a linter decide if characters can be removed. #125

Open NullVoxPopuli opened 9 months ago

NullVoxPopuli commented 9 months ago

I've found myself using this config for having an easier time commenting code:

  use { 'b3nj5m1n/kommentary', config = function()
    local config = require('kommentary.config')

    config.configure_language('default', {
      single_line_comment_string = 'auto',
      multi_line_comment_strings = 'auto',
      hook_function = function()
        require('ts_context_commentstring').update_commentstring()
      end,
    })

    config.configure_language("typescript.glimmer", {
      multi_line_comment_strings = { "{{!--", "--}}" },
    })
    config.configure_language("javascript.glimmer", {
      multi_line_comment_strings = { "{{!--", "--}}" },
    })
    config.configure_language("glimmer", {
      multi_line_comment_strings = { "{{!--", "--}}" },
    })
    config.configure_language("handlebars", {
      multi_line_comment_strings = { "{{!--", "--}}" },
    })
  end }

the default comment, {{! }} is insufficient for most cases, especially if what you want comment contains a double-curlie