Sublime Text 4121 #17

Closed
opened 2021-10-26 21:21:46 +00:00 by cyberquito · 12 comments
cyberquito commented 2021-10-26 21:21:46 +00:00 (Migrated from github.com)

Hello,

I just upgrade sublime text to version 4121. The highlighting on html is not working properly anymore. The error starts on the first closing bracket. From there on, every tag is off. The script section works fine.

I'm on a Linux Ubuntu 21.04.

Screenshot from 2021-10-26 14-19-43

Hello, I just upgrade sublime text to version 4121. The highlighting on html is not working properly anymore. The error starts on the first closing bracket. From there on, every tag is off. The script section works fine. I'm on a Linux Ubuntu 21.04. ![Screenshot from 2021-10-26 14-19-43](https://user-images.githubusercontent.com/16375284/138962807-43d230b7-2afe-4d1e-8938-57e589a004a1.png)
ghost commented 2021-10-26 23:58:49 +00:00 (Migrated from github.com)

I'm on Windows, this started happening after the update as well.
Looks like HTML that contains JS is not highlighting correctly:
svelteJs

I'm on Windows, this started happening after the update as well. Looks like HTML that contains JS is not highlighting correctly: ![svelteJs](https://user-images.githubusercontent.com/26565276/138977570-ec42231f-6837-4f83-9028-fa401b62ce9f.png)
jrappen commented 2021-10-27 04:15:03 +00:00 (Migrated from github.com)

To fix this fix the embeds for:

  • TypeScript
  • CSS

as https://github.com/sublimehq/Packages has changed recently.

To fix this fix the embeds for: - TypeScript - CSS as <https://github.com/sublimehq/Packages> has changed recently.
corneliusio commented 2021-10-27 17:01:27 +00:00 (Migrated from github.com)

@cyberquito @teaguehannam @jrappen Thanks for reporting, I also just updated to Sublime Text 4 and discovered this issue. I've been busy with my full-time job the last couple of months and have fallen behind on my personal work. Will get this fixed ASAP.

@cyberquito @teaguehannam @jrappen Thanks for reporting, I also just updated to Sublime Text 4 and discovered this issue. I've been busy with my full-time job the last couple of months and have fallen behind on my personal work. Will get this fixed ASAP.
jrappen commented 2021-10-27 17:03:38 +00:00 (Migrated from github.com)

In case you need help there is a SublimeHQ Discord

In case you need help there is a [![SublimeHQ Discord](https://img.shields.io/discord/280102180189634562?label=SublimeHQ%20Discord&logo=discord&style=flat-square)](https://discord.gg/D43Pecu)
ilokhov commented 2021-10-27 19:23:31 +00:00 (Migrated from github.com)

Thanks so much for looking into this @corneliusio! I believe this references the same issue.

Thanks so much for looking into this @corneliusio! I believe [this](https://github.com/corneliusio/svelte-sublime/issues/16) references the same issue.
ccampbell commented 2021-10-29 05:21:52 +00:00 (Migrated from github.com)

@corneliusio I just opened a PR (#18) with a fix. Feel free to use it or modify it if you have a better fix in mind!

@corneliusio I just opened a PR (#18) with a fix. Feel free to use it or modify it if you have a better fix in mind!
burlesona commented 2021-10-29 15:10:30 +00:00 (Migrated from github.com)

Sorry to pile on, just wanted to confirm I see the same issue with the same cause, after the first closing } the highlighting breaks. Caused by the recent Sublime Text update. What a bummer, @corneliusio sorry the Sublime Team broke your package :(

Sorry to pile on, just wanted to confirm I see the same issue with the same cause, after the first closing `}` the highlighting breaks. Caused by the recent Sublime Text update. What a bummer, @corneliusio sorry the Sublime Team broke your package :(
corneliusio commented 2021-10-30 15:43:25 +00:00 (Migrated from github.com)

@burlesona Ha, is what is, nature of a package/plugin based ecosystem.

Noting here, I've started working on some fixes that are in the https://github.com/corneliusio/svelte-sublime/tree/v4 branch. There are still some issues, but it's far less broken than the current release. Feel free to manually install while I finish up some of the smaller fixes.

@burlesona Ha, is what is, nature of a package/plugin based ecosystem. Noting here, I've started working on some fixes that are in the https://github.com/corneliusio/svelte-sublime/tree/v4 branch. There are still some issues, but it's far less broken than the current release. Feel free to manually install while I finish up some of the smaller fixes.
deathaxe commented 2021-10-30 15:46:22 +00:00 (Migrated from github.com)

The root cause for this issue is JavaScript supporting shebang now, which causes the main context to be pushed away from.

see: github.com/sublimehq/Packages@b19745cf3e/JavaScript/JavaScript.sublime-syntax (L118-L121)

Hence you need to change the following line

github.com/corneliusio/svelte-sublime@c71f1290b0/Svelte.sublime-syntax.yaml-macros (L139)

to:

  embed-scope:
    - meta_scope: meta.embedded.block.svelte
    - meta_content_scope: source.js.svelte
    - match: \}
      scope: punctuation.section.embedded.end.svelte
      pop: true
    - include: Packages/JavaScript/JavaScript.sublime-syntax#script   # <- directly include scripts.
The root cause for this issue is JavaScript supporting shebang now, which causes the main context to be pushed away from. see: https://github.com/sublimehq/Packages/blob/b19745cf3edd8b19f3b09e207e8a854b3aa424b3/JavaScript/JavaScript.sublime-syntax#L118-L121 Hence you need to change the following line https://github.com/corneliusio/svelte-sublime/blob/c71f1290b061c79c027b5eb002ed06aa6d874ffe/Svelte.sublime-syntax.yaml-macros#L139 to: ``` embed-scope: - meta_scope: meta.embedded.block.svelte - meta_content_scope: source.js.svelte - match: \} scope: punctuation.section.embedded.end.svelte pop: true - include: Packages/JavaScript/JavaScript.sublime-syntax#script # <- directly include scripts. ```
ccampbell commented 2021-10-30 16:16:46 +00:00 (Migrated from github.com)

Thanks @deathaxe, that is certainly much simpler than my fix. Didn’t know about that change.

Thanks @deathaxe, that is certainly much simpler than my fix. Didn’t know about that change.
corneliusio commented 2021-10-30 16:42:11 +00:00 (Migrated from github.com)

Heyo, thanks @deathaxe for zeroing in on that! That adjustment seems to have fixed everything I can find. I'll be tagging a release for this fix but if anyone wants to snag the updated syntax definitions waiting for the release to propagate, it's in https://github.com/corneliusio/svelte-sublime/tree/v4.

Heyo, thanks @deathaxe for zeroing in on that! That adjustment seems to have fixed everything I can find. I'll be tagging a release for this fix but if anyone wants to snag the updated syntax definitions waiting for the release to propagate, it's in https://github.com/corneliusio/svelte-sublime/tree/v4.
corneliusio commented 2021-10-30 16:56:45 +00:00 (Migrated from github.com)

Closing this out now as the fix should be available to everyone soon via Package Control update.

Closing this out now as the fix should be available to everyone soon via Package Control update.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
repos/svelte-sublime#17
No description provided.