emmet: Support more languages (#10779)

Hey guys! `emmet-language-server` author here. Thank you so much for the
amazing editor!

This PR adds more languages to the list for the `emmet-language-server`
to attach to.

I have a question though, I saw that you guys don't differentiate yet
between `JavaScript` and `JSX` files. I know that the tree-sitter parser
for `js` comes with the ability to parse both but we still need to make
that difference. Is that part of the plan? or do you have a reason for
doing that?

Aside from that, I've still added support for `JavaScript` files since
is important to have emmet completions in `JSX` files, but I would like
to know what are your thoughts on that since doing this may pollute the
completions in `.js` files.

And one last thing, the emmet language server accepts more filetypes
such as `pug`, `sass`, `scss` and `less` files, which are not currently
supported by zed. Should I create some extensions to add grammar support
to those files later? Should those extensions be part of the zed repo?
I'm just thinking that those are sort of core languages.

Aside from that, let me know if there's anything left to do on my side.
Greetings!

Fixes #10654.

Release Notes:

- N/A
This commit is contained in:
José Olórtegui 2024-05-06 06:09:19 -04:00 committed by GitHub
parent cf6c2daaa2
commit 6e2be283dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View file

@ -16,12 +16,13 @@ brackets = [
]
word_characters = ["$", "#"]
tab_size = 2
scope_opt_in_language_servers = ["tailwindcss-language-server"]
scope_opt_in_language_servers = ["tailwindcss-language-server", "emmet-language-server"]
prettier_parser_name = "babel"
[overrides.element]
line_comments = { remove = true }
block_comment = ["{/* ", " */}"]
opt_into_language_servers = ["emmet-language-server"]
[overrides.string]
word_characters = ["-"]

View file

@ -14,13 +14,14 @@ brackets = [
{ start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
]
word_characters = ["#", "$"]
scope_opt_in_language_servers = ["tailwindcss-language-server"]
scope_opt_in_language_servers = ["tailwindcss-language-server", "emmet-language-server"]
prettier_parser_name = "typescript"
tab_size = 2
[overrides.element]
line_comments = { remove = true }
block_comment = ["{/* ", " */}"]
opt_into_language_servers = ["emmet-language-server"]
[overrides.string]
word_characters = ["-"]

View file

@ -9,4 +9,12 @@ repository = "https://github.com/zed-industries/zed"
[language_servers.emmet-language-server]
name = "Emmet Language Server"
language = "HTML"
languages = ["HTML", "PHP", "ERB"]
languages = ["HTML", "PHP", "ERB", "JavaScript", "TSX", "CSS"]
[language_servers.emmet-language-server.language_ids]
"HTML" = "html"
"PHP" = "php"
"ERB" = "eruby"
"JavaScript" = "javascriptreact"
"TSX" = "typescriptreact"
"CSS" = "css"