Sublime Forum

Dev Build 3153

#54

When using “Hashed Syntax Highlighting”, shouldn’t the yellow marked “maintime” variable always have the same color? Also the purple marked “lastlooptime” variable:

0 Likes

#55

It should - I’ll fix that for the next build

1 Like

#56

please can escape be updated to support variables? :slight_smile:

1 Like

#57

I got the same error, and the result is syntax highlighting in my PHP files is gone. It doesn’t feel like I should have to manually modify packages to make something work that was working fine one build ago, but I’m also not entirely sure where to report this as an issue…

0 Likes

#58

you can report it at https://github.com/y0ssar1an/CSS3/issues

0 Likes

#59

The issue is that you have disabled the CSS package, per the instructions of the CSS3 author. Unfortunately, disabling the CSS package breaks the HTML syntax. The style attributes need to reference a specific context of the CSS syntax. When you disable the CSS package, it makes that context unavailable. With this build we moved the CSS and JavaScript code in the HTML syntax use the new embed syntax. When it tries to resolve the embedded context, it isn’t able to find it.

Honestly, if the CSS3 package is going to tells users to disable the CSS syntax, it will likely need to include it’s own HTML syntax that embeds CSS3 instead of CSS. Alternatively, if the CSS3 syntax can create a context named rule-list-body and I will make sure that the HTML syntax references scope:source.css#rule-list-body for the next build.

Edit: the HTML syntax now references CSS via scope name, so all the CSS3 author needs to do is create a context named rule-list-body that will properly highlight the contexts of a style="" attribute.

7 Likes

Color theme aren't working
#60

Yes, I will get that added.

3 Likes

#62

Yes, after remove CSS3 package and enable CSS native package the problem is solved.

0 Likes

#63

Question: if we wmbed: X and then within X we set Y, will X’s escape regex still be checked or not?

0 Likes

#64

If you pop out of an embedded context (via pop or set) it should discard the escape pattern and continue on as the action you specified requested.

1 Like

#65

There shouldn’t be. I will have to dig into it some.

You will probably want your escape to be ^(?=\1) so that it is anchored to the beginning of the line. The backreferences will capture literal text, but not assertions like ^.

2 Likes

#66

Further question about embed: I know we can capture a group in the match that embeds and abckreference to it in the escape regex, but can we also bacreference to said capture group in the regexes defined within the embedded context? Because that would be really handy.

0 Likes

#67

I’m not sure if this is related to this report:

but I’ve noticed that ST’s hashed syntax highlighting treats each “token” as a separate entity, even when scoped the same (with the same match pattern even) as the adjacent text. i.e. a match pattern for . instead of .+. This can be most clearly seen with the example .sublime-color-scheme you provided with the find panel, typing a literal like testing123:

on a related note, it would be great if plugins that query for scope information could find out the extent of a scope that was applied from one match pattern, for example to distinguish that .. in regex syntax is actually two tokens of . and not one token of .., or that \s\w is one token of \s and one of \w, and not one of \s\w which is what view.find_by_selector('keyword.control.character-class.regexp') or view.extract_scope would have you believe - I guess a separate API would be needed for this for backwards compatibility reasons.

0 Likes

#68

No, unfortunately that would require dynamic regex patterns for a context, which would have a drastic impact on performance.

0 Likes

#69

so colorocoder is core now. well we had a good run. just sad i didnt get a shoutout

0 Likes

#70

I’ve posted some new *.sublime-color-scheme files to:

https://github.com/jrappen/sublime-color-schemes

which should be available in the package SublimeColorSchemes as soon as my PR on the Package Control channel is merged.

2 Likes

#71

Also, if you need to convert one of your favorite schemes (or all of them), you can use this gist:

It has two commands. One that converts the scheme in your current view, or the other that scans packages (excluding User) and converts them all.

It dumps them all into User/sublime_color_scheme_format. If two packages have schemes with the same name, it will overwrite the last written one in the folder, but you are free to modify the script to create subfolders or even unique names if required.

4 Likes

#72

Currently, we can only embed a single pattern at a time. Do you plan to expand it so we can embed a lists of contexts, like we can currently push a list of contexts? That would really help when we have to deal with both nesting and sequential contexts. e.g. an elsif or else context that is only legal immetialy after and at the same level of indentation as th previous if context could be dealth with by `embed: [ else, elif, if]. Probably would need some extra syntax if the escapes and escapes captures are going to be different for the different embedded contexts in the list though.

0 Likes

#73

That seems like a weird usage of embed. Sounds like a case for pushing an anonymous context that includes else, elif and if respectively, imo.

The reason why embed is not correct here is that you need an escape pattern to exit the embed, which may or may not be endif in this case. However, if endif occurs within a comment or a string in that block, the embed will still be exited because escape doesn’t have a concept of context nesting. The escape pattern is matched first, then the text inbetween is passed to the embed context.

Also, it doesn’t make sense to embed multiple contexts at once. If you want to allow multiple "embed"s at the same time, it should be possible to embed an anonymous context and include the two other contexts there instead. I’m not actually sure whether you can embed anonymous contexts though.

3 Likes

#74

all recent build seems to revolve around the aesthetics & rendering of the editor more than any other areas. is there any other new features in the pipeline? i certainly would like have native debugging interface in the core editor. i know same can be achieved by splitting panes etc, but certainly would love to have standard ui build inside the editor. else would love to have enhanced side bar/console api, so plugins can be developed to build ide like debugging interface. i know its still a text editor, having an ui for this certainly helps people like who rely on it. actual debugging functionalities can be provided through LSP and certainly wont “bloat” the editor having an optional debugging interface built in…

0 Likes