Scope Tailwind in JS/TS to within string

In some situations outside JSX elements Tailwind will never
respond to a completion request, holding up the tsserver completions.

Only submit the request to Tailwind when we wouldn't get tsserver
completions anyway and don't submit to Tailwind when we know we won't
get Tailwind completions

Co-Authored-By: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
Julia 2023-08-30 21:14:39 -04:00
parent 7e5735c8f1
commit 529adb95a1
4 changed files with 46 additions and 2 deletions

View file

@ -13,6 +13,7 @@ brackets = [
{ start = "`", end = "`", close = true, newline = false, not_in = ["comment", "string"] },
{ start = "/*", end = " */", close = true, newline = false, not_in = ["comment", "string"] },
]
scope_opt_in_language_servers = ["tailwindcss-language-server"]
[overrides.element]
line_comment = { remove = true }
@ -20,3 +21,4 @@ block_comment = ["{/* ", " */}"]
[overrides.string]
word_characters = ["-"]
opt_into_language_servers = ["tailwindcss-language-server"]

View file

@ -12,6 +12,7 @@ brackets = [
{ start = "`", end = "`", close = true, newline = false, not_in = ["string"] },
{ start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
]
scope_opt_in_language_servers = ["tailwindcss-language-server"]
[overrides.element]
line_comment = { remove = true }
@ -19,3 +20,4 @@ block_comment = ["{/* ", " */}"]
[overrides.string]
word_characters = ["-"]
opt_into_language_servers = ["tailwindcss-language-server"]