-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Toggle comments broken on v10.0.0-beta2 #390
Comments
I don't know much about syntax highlighting in SublimeText but for those maintaining this project there is a really good package called Scope Hunter that could be useful |
Is this a regression compared to previous versions? This is definitely something I'd like to find a way to improve either way. |
I've submitted a PR upstream to improve commenting behavior in JSX (sublimehq/Packages#2787). |
I have the exact same problem, and am looking for a solution. On my other development environment, Sublime Text 3 still uses So my question is: Does anybody know how to force Sublime Text to use a specific version of a package? |
I don't think Package Control supports pinning a package version. If this is breaking your workflow, you could uninstall via Package Control and check out the previous tag via git. Either way, if this is a regression from the previous version, I intend to fix it. I know you said you had exactly the same problem as @brupelo, but just to be sure, can you post a code example? I tried @brupelo's example in both the current release and the previous release, and neither of them does the right thing. |
Okay, thanks for the info about the package version. Here's an example and what happens when I try to comment/uncomment using the keyboard shortcut: SublimeText3ReactSyntaxHighlightingComment.mp4 |
Yeah, this is definitely a bug. This case was also broken on the old version, so it's not a regression, but it still deserves a fix. I've already submitted a fix for the ST4 JSX package. That particular fix will end up in babel-sublime when:
Depending on how things look over the next few days, it may make sense to backport something to v10. |
@skizzo I've released version 10.0.2 with a fix for that specific case. It's monkeypatched onto the compiled syntax definition, which is not great, but when v11 comes around everything should be in accord. The fix does not address the issue @brupelo reports; that part of the upstream fix can't easily be backported for ST3. |
Thank you a lot @Thom1729 I can indeed confirm that the case I posted above is solved now with version I have only one more issue with the SublimeText3ReactSyntaxHighlightingComment2.mp4Is there any chance you could fix this as well? Thanks! |
This should be fixed in v10.0.3. |
Thank you for the update, but it's behaving the exact same way as before, tested on 2 machines. |
That would be because I forgot to push the commits before releasing. Try 10.0.4. |
Thanks, but I just updated to 10.0.4, restarted Sublime, but it's still the same.. |
I typed out the example from your image and ran some tests. The behavior varies between the new and old versions of Babel, but also depending on whether you have the ST4 JavaScript package, the ST3 JavaScript package, or whether the JavaScript package is disabled. The only case in which it works correctly is with the old babel-sublime and the ST3 JavaScript package enabled. The root cause of the issue is sublimehq/sublime_text#2152. When Sublime tests the scope It may be possible to hack the comment rules to produce better results in your example. But I'm thinking that the best solution might be to write an alternate commenting command that handles these cases in a more robust manner. (See, for example, the |
The v11 beta is out, which should slightly improve JSX commenting. |
Thanks a lot for your work mate, it's getting better and better! |
v11 is out. Commenting should work correctly, except for nested situations due to sublimehq/sublime_text#2152. Any other commenting bugs should be reported in a new issue. |
Version: v10.0.0-beta2
Consider this little snippet:
And now try to comment/uncomment an inner block of code, ie:
You can see 2 examples of comment/uncomment not working:
The text was updated successfully, but these errors were encountered: