olrtg / emmet-language-server

A language server for emmet.io
https://www.npmjs.com/package/@olrtg/emmet-language-server
MIT License
268 stars 8 forks source link

syntaxProfile not working with jsx files #15

Closed MarkimGarito closed 12 months ago

MarkimGarito commented 12 months ago

With html and js files the settings work, but with jsx they don't

require("lspconfig").emmet_language_server.setup({
  filetypes = { "css", "eruby", "html", "javascript", "javascriptreact", "less", "sass", "scss", "svelte", "pug", "typescriptreact", "vue" },
  init_options = {
    --- @type table<string, any> https://docs.emmet.io/customization/preferences/
    preferences = {
    },
    --- @type "always" | "never" defaults to `"always"`
    showexpandedabbreviation = "always",
    --- @type boolean defaults to `true`
    showabbreviationsuggestions = true,
    --- @type boolean defaults to `false`
    showsuggestionsassnippets = false,
    --- @type table<string, any> https://docs.emmet.io/customization/syntax-profiles/
    syntaxProfiles = {
      html = {
        tag_nl = "decide",
        tag_nl_leaf = true,
        inline_break = 1
      },
    },
    --- @type table<string, string> https://docs.emmet.io/customization/snippets/#variables
    variables = {
    },
    --- @type string[]
    excludelanguages = {},
  },
})
olrtg commented 12 months ago

Hey! can you try with:

lspconfig.emmet_language_server.setup({
  filetypes = { "css", "eruby", "html", "javascript", "javascriptreact", "less", "sass", "scss", "svelte", "pug", "typescriptreact", "vue" },
  init_options = {
    --- @type table<string, any> https://docs.emmet.io/customization/preferences/
    preferences = {},
    --- @type "always" | "never" Defaults to `"always"`
    showExpandedAbbreviation = "always",
    --- @type boolean Defaults to `true`
    showAbbreviationSuggestions = true,
    --- @type boolean Defaults to `false`
    showSuggestionsAsSnippets = false,
    --- @type table<string, any> https://docs.emmet.io/customization/syntax-profiles/
    syntaxProfiles = {
      html = { tag_nl = "decide", tag_nl_leaf = true, inline_break = 1 },
      jsx = { tag_nl = "decide", tag_nl_leaf = true, inline_break = 1 },
    },
    --- @type table<string, string> https://docs.emmet.io/customization/snippets/#variables
    variables = {},
    --- @type string[]
    excludeLanguages = {},
  },
})

Let me know if that helps.

MarkimGarito commented 12 months ago

Yes, it worked

Thanks