Skip to content
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

Toggling TailwindCSS Extension On & Off Across Different Languages (PHP Ruby ...etc) #24

Merged
merged 4 commits into from
Feb 28, 2022

Conversation

EmranMR
Copy link
Contributor

@EmranMR EmranMR commented Feb 2, 2022

Hi Jason, the extension still suggests tailwind autocompletion in the php context, this should hopefully fix it. I believe there was an issue raised as well with regards to this (#20)

@jasonplatts
Copy link
Owner

Hi @EmranMR. Thank you very much for spending the time to submit this pull request.

The newest version of the extension does a much better job preventing completion suggestions outside of HTML class attributes in PHP files. However, it will still offer completions in single and double-quoted PHP strings. The reason for this is to help when dynamically assigning Tailwind classes.

I can see how it may be frustrating to have Tailwind suggestions inside every PHP string, so perhaps this can be added in a future release as an option in the extension preferences, rather than completely preventing them altogether. Thoughts?

Thanks again for the input.

Jason

@EmranMR
Copy link
Contributor Author

EmranMR commented Feb 5, 2022

Hi @jasonplatts,

Absolutely, sounds very reasonable! to be fair you are right, it is always better to give users options than sacrifice a feature! especially nowadays that any syntaxes that we can ever imagine can get mixed up in a single file!

Do you think maybe a command palette to toggle it on and off would be handy? I could maybe try to make another pull request when I get a chance for it, if that helps. Are there any other languages that might have the same issue? just not sure if the command should be specific to PHP or all languages?

@jasonplatts
Copy link
Owner

Hi @EmranMR,

Sorry for not getting back to you sooner.

I think an option that can be toggled from the command palette and menu bar would work well. There are definitely other languages that would have the same issue. Ruby, for one. So, maybe the option could be called "HTML Specific Autocompletions" or something like that?

It sounds like a great feature addition. If you have the time and would like to make another pull request, i'd be happy to add it to the extension.

@EmranMR
Copy link
Contributor Author

EmranMR commented Feb 16, 2022

Hi @jasonplatts I just added a command in the command palette, so that the users can toggle the extension on and off on the fly. Sorry for the triplicate commits, git and programming are not my forte as you can see haha. I messed up the merges locally, then once I pushed I broke the extension. The final commit should be working like a charm now. 😊

usage
Basically all they have to do is to bring up the command palette (cmd-shift-p) and either type "toggle TailwindCSS" or as I like it, just write "tt" and that would toggle the extension on and off.

@EmranMR EmranMR changed the title Preventing Autocompletion in PHP context Toggling TailwindCSS extension on the fly across different languages (PHP Ruby ...etc) Feb 16, 2022
@EmranMR EmranMR changed the title Toggling TailwindCSS extension on the fly across different languages (PHP Ruby ...etc) Toggling TailwindCSS On & Off extension on the fly across different languages (PHP Ruby ...etc) Feb 16, 2022
@EmranMR EmranMR changed the title Toggling TailwindCSS On & Off extension on the fly across different languages (PHP Ruby ...etc) Toggling TailwindCSS Extension On & Off on the fly across different languages (PHP Ruby ...etc) Feb 16, 2022
@EmranMR EmranMR changed the title Toggling TailwindCSS Extension On & Off on the fly across different languages (PHP Ruby ...etc) Toggling TailwindCSS Extension On & Off Across Different Languages (PHP Ruby ...etc) Feb 16, 2022
Copy link
Owner

@jasonplatts jasonplatts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution Emran. Looks good to me! I'll release an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants