Skip to content

(v2) Triggering intellisense in VS Code crashes the Tailwind extension when working on gluestack components #2382

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

Closed
6 tasks
resticker opened this issue Aug 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@resticker
Copy link

resticker commented Aug 14, 2024

Description

Showing intellisense options via the "Trigger Suggest" in the Command Palette (I use a keyboard shortcut like most of us probably do) causes the Tailwind extension to go to 100% CPU usage and become unresponsive

CodeSandbox/Snack link

N/A

Steps to reproduce

  1. Go to <directory with gluestack components>/button/index.tsx
  2. Put the cursor anywhere in the file
  3. Select Trigger Suggest from the Command Palette
  4. Notice that suggestions gets stuck on Loading... (see screenshot)
  5. Open Developer: Open Process Explorer from the Command Palette and see electron-nodejs (tailwindServer.js) at 99 (% CPU)

Showing intellisense just gets stuck "Loading..."
Screenshot 2024-08-13 at 8 50 59 PM

Process Explorer:
tailwind usage

gluestack-ui Version

Latest

Platform

  • Expo
  • React Native CLI
  • Next
  • Web
  • Android
  • iOS

Other Platform

No response

Additional Information

The extension needs to be manually restarted to get intellisense working again. No intellisense of any kind works in any file (even my personal files) while the extension is unresponsive

I'm using v0.12.6 of the official Tailwind CSS IntelliSense extension.
Visual Studio Code Version: 1.92.1

I'm posting this issue here because it seems to be more of a gluestack issue than an extension issue.

@resticker resticker added the bug Something isn't working label Aug 14, 2024
@Viraj-10
Copy link
Collaborator

Hey @resticker,

Regarding the VS Code crashing issue, it seems to be related to the Tailwind plugin or a system issue. We don’t manipulate anything concerning VS Code extensions, and we have followed all the standards while creating a Tailwind config for gluestack.

  • Please remove gluestack-ui, then try running the Tailwind plugin and check the CPU usage during the process.

@Viraj-10 Viraj-10 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
@resticker
Copy link
Author

resticker commented Aug 14, 2024

@Viraj-10 I think the issue stems from the gluestack tooling setup for intellisense.

If I remove this regex from my settings.json file. The issue goes away.

Since this code is related to tailwind variants, I figured that there are likely issues over on that project. And, yep, here's a "intellisense in tv config hangs" issue

If you scroll through those comments, you'll see that Tailwind Variants updated the regex (pull request), and it's been updated in the Tailwind Variants docs

You can also comb through the Tailwind extension issue related to Tailwind Variants here

Basically, regex is the issue.

We might want to consider changing the gluestack intellisense setup docs to match the new Tailwind Variants regex:

["([\"'`][^\"'`]*.*?[\"'`])", "[\"'`]([^\"'`]*).*?[\"'`]"]

instead of the current regex:

["tva\\((([^()]*|\\([^()]*\\))*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]

I just tried it, and I'm getting intellisense in gluestack components, and no hanging. (A con to this, is that it looks like if you activate intellisense in any string, it offers tailwind class suggestions 😂.. but that's not all bad)

@luiz504
Copy link

luiz504 commented Oct 19, 2024

@Viraj-10 I think the issue stems from the gluestack tooling setup for intellisense.

If I remove this regex from my settings.json file. The issue goes away.

Since this code is related to tailwind variants, I figured that there are likely issues over on that project. And, yep, here's a "intellisense in tv config hangs" issue

If you scroll through those comments, you'll see that Tailwind Variants updated the regex (pull request), and it's been updated in the Tailwind Variants docs

You can also comb through the Tailwind extension issue related to Tailwind Variants here

Basically, regex is the issue.

We might want to consider changing the gluestack intellisense setup docs to match the new Tailwind Variants regex:

["([\"'`][^\"'`]*.*?[\"'`])", "[\"'`]([^\"'`]*).*?[\"'`]"]

instead of the current regex:

["tva\\((([^()]*|\\([^()]*\\))*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]

I just tried it, and I'm getting intellisense in gluestack components, and no hanging. (A con to this, is that it looks like if you activate intellisense in any string, it offers tailwind class suggestions 😂.. but that's not all bad)

I was facing the same issue, found the same solution but, doing another fresh research on TV issues, I found this #903 (comment)
Doing some basic tests, its working without my CPU dying in the process of saving the file :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants