-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completion not working inside of template strings #465
Comments
On an other note, supporting string concatenation would also be helpful e.g. for conditional styles: let classes = "smth"
if true {
classes += "hi"
} (Adding this here since I feel like it is a very similar issue (Extending places where intellisense is triggered) |
I tried this in vscode with v0.7.5 and have the same issue. |
Hey @ModProg. What is the exact situation where you expect completions but are not getting them? A code example would be great! |
Hey @ModProg. By default the extension only triggers class completions for HTML/JSX attributes (i.e. |
I understand that reasoning, but this wont really add unexpected completions IMO (as they are already there without the I added the regex so anyone having this issue can use the escape hatch in the current implementation. |
What do you think about supporting template literals/strings? This trick is being used with many other extensions, i.e.: const query = sql`SELECT * FROM users;`; // Syntax highlighting const query = gql`
query Query {
users {
id
name
email
}
}`; // Syntax highlighting And with TailwindCSS it could be: const className = tw`p-2 w-full border rounded`;
// or
const className = twc`p-2 w-full border rounded`; |
You need to use a custom regex:
See tailwindlabs/tailwindcss#7553
You can use this, replace
classes|class
with your preferred variable names:What version of Tailwind CSS IntelliSense are you using?
v0.7.3-1
What version of Tailwind CSS are you using?
v3.0.1
What package manager are you using?
yarn
What operating system are you using?
Linux
Describe your issue
When inside a template string
`
(I use these to allow for multiline class definitions) I cannot use auto-complete. It works flawlessly in normal strings ("
&'
)The text was updated successfully, but these errors were encountered: