Sublime Forum

Dev Build 3086

#11

This should be available in all languages. I’d love this in PHP and JavaScript for example.

0 Likes

#12

Hi guys! I downloaded latest ST3 dev build and it said that I need to enter license. Is there any topic about this? I just want to test it and submit bug request if I’ll find something. Thanks

0 Likes

#13

From the sublimetext.com/3dev page (that you should have read) where you downloaded ST:

[quote]These are the in-progress versions of Sublime Text 3, and they are updated more frequently. Feel free to use them, but keep in mind you will be running less tested code, and you’ll be seeing many more update notification prompts.
The current Sublime Text 3 dev build is 3086. Details on new dev build releases are posted on the forum
Sublime Text 3 dev builds are currently available to registered users only.[/quote]

So buy a license or wait for the next beta.

0 Likes

#14

It’s possible to mess up the sidebar view using the API. It can lead to data loss when deleting using context menu in the sidebar. Wrong file can get deleted.
It’s an old problem and it is reported here github.com/bizoo/SortTabs/issues/11 but without very specific details.

I think the root problem is that it’s possible to move ‘temporary’ (single clicked from the sidebar - one without an entry created in open files sidebar group) views using the API.

High level repro steps:

  1. Install github.com/bizoo/SortTabs/
  2. Add some folder to the project with a couple of files, lets say with files ‘1’ and ‘2’
  3. Double click file ‘2’ (order matters because we will be sorting by file name)
  4. Single-click file ‘1’ (to show the preview)
  5. Invoke Ctrl+shift+p -> Sort Tabs Menu -> Sort by file name
  6. Close previewed file ‘1’
  7. Preview file ‘1’ again (step 4)
  8. Again sort by file name (step 5)

Now you will see that sidebar view of open files is broken. The ‘Open files’ header is gone, everything moves up.

0 Likes

#15

JS (ES6) is what I’m doing presently – though I can see how the example screenie doesn’t make that obvious :smile:

0 Likes

#16

Bathos - is your work up on github?

I can’t say how excited I am for your ES6 work!

0 Likes

#17

Seems like variables’ lookup always happens in current syntax, even when variable is defined in embedded one.

There are also some weirdness with backreference. This will end with error saying backref number is wrong:

strings:
- match: '("''])'
  push:
  - meta_scope: string.quoted
  - match: '\1'
    pop: true
  - match: (?<!\\)\n
    pop: true

Though if you remove second match it will work.

0 Likes

#18

Really impressed with the parsing speedups in the recent few builds, Jon. Great job, keep it up!

0 Likes

#19

Where can we detect these new scopes to update our themes to take advantage of this?

I just tried ScopeHunter and it doesn’t seem to work anymore.

0 Likes

#20

It works. Try restarting or re-install it.

0 Likes

#21

I recommend ScopeAlways, personally. But I wonder from the way you phrased the question if you’re expecting these scopes to simply be available with the new build? If so, no, this isn’t the case. That screenshot is from me working on a new syntax definition. Presumably others are already doing the same thing for other languages, so in the near future there will probably be a lot of new syntax definitions to choose from that do provide these refinements.

FWIW, the scopes I used for braces there follow this pattern:

punctuation.definition.block.conditional.begin
punctuation.definition.block.conditional.end
punctuation.definition.expression.conditional.begin
punctuation.definition.expression.conditional.end
punctuation.definition.block.loop.begin
punctuation.definition.block.loop.end
(etc)

The “punctuation.definition.xxx.[begin|end]” pattern is already common in tmLanguage so I figured it made sense this way, but I’m open to other (existing?) ideas for naming these newly “disambiguatable” sorts of things.

0 Likes

#22

OK, thanks. At want point will this yield benefits for those of us who simply write themes?

0 Likes

#23

Thanks for the report, will fix in the next build.

[quote=“lastsecondsave”]
There are also some weirdness with backreference. This will end with error saying backref number is wrong:

strings:
- match: '("''])'
  push:
  - meta_scope: string.quoted
  - match: '\1'
    pop: true
  - match: (?<!\\)\n
    pop: true

Though if you remove second match it will work.[/quote]

Currently backref substitution is only performed for the last pop rule in a context. There’s no fundamental reason for this, it’s just a legacy of the tmLanguage support, which only ever allowed for a single pop rule. I’m not currently planning on addressing this until sregex handles backrefs itself.

0 Likes

#24

Well, I have no idea about anyone else, but if you’re interested in theming Javascript / Ecmascript, feel free to take a look at what I have so far:

github.com/bathos/Ecmascript-Sublime

Quite close to done with the definition itself now actually, though I’m sure there will be a lot of fixes and refinements to make once I get deeper into testing it.

EDIT

The syntax itself is done, save for the ongoing bug screening and refinements.

Here’s a horrific example of what it can do using randomized colors:

0 Likes

#25

bathos - I am not using Javascript or Ecmascript myself, but your documentation on github was very educational! Thanks a ton for taking the time to write it :smile:

0 Likes

#26

bathos -
thanks for your work.

I have a question for you: how much did you stick to the old annotations for javascript ?
Did you rename things ? And how does your syntax looks like with an existing color scheme ?

I’m myself working on a sublime-syntax for scala:
https://github.com/gwenzek/scalaSublimeSyntax
Still in progress but it’s looking good.

I’d like my syntax to work with most of coloring scheme out there, so I tried to stick to the documentation of TextMate: https://manual.macromates.com/en/language_grammars
But I have difficulties to put everything inside the proposed category or it gets quite verbose.

For reference TextMate recommend using the following scopes:

  • comment.(line|block)

  • constant.(numeric|character|language|other)

  • entity.name.(function|type|tag|section)

  • entity.other.(inherited-class|attribute-name)

  • invalid.(illegal|deprecated)

  • keyword.(control|operator|other)

  • markup.(…)

  • meta.anything_you_want

  • storage.(type|modifier)

  • string.(…)

  • support.(function|class|types)

  • variable.(parameter|language|other)

0 Likes

#27

And a bit of advertising for my Scala sublime.syntax:

Default Scala syntax

My Scala syntax

0 Likes

#28

Welcome! That’s what I was hoping actually, that some of those details at the bottom might be useful to other syntax writers.

[quote=“gwenzek”]I have a question for you: how much did you stick to the old annotations for javascript ?
Did you rename things ? And how does your syntax looks like with an existing color scheme ?[/quote]

I actually got into some depth on the first two questions in the final part of the readme – the bit niklas was referring to (well I think). Summary though: I used the three existing syntax definitions as a reference for scope names, which I then expanded on. But I also took a great deal of liberty, especially at the more specific end of the scope hierarchy. It was hard not to because the original JS syntax def (which the other two stayed true to) always smelled a bit off to me. I was more interested in consistency with the semi-standard tmLanguage scope conventions than the precedents set for this specific language.

It works pretty well with existing themes. Although the majority of the punctuation.definition space is unique to Ecmascript Sublime, the rest is mostly standard fare except branched into more specific child scopes; it all exists within the core tmLanguage parent scopes though. There are a few ways it could be made better though. In certain cases where I opted for the more tmLanguage-y choice over a precendent from Babel Sublime etc, what I’d like to do is – by way of extra capture groups – apply the alternative name as well so long as it doesn’t interfere with other stuff.

EDIT: The Scala improvements look fantastic btw.

0 Likes

#29

One more shot, now from my first attempt at actually theming it properly. I’m not exactly a genius with color but hopefully it’s better than the randomized one :smile:

I would start a thread in plugin announcements instead of continuing here but the spam mountain there is unbelievable and I’m afraid it would disappear immediately.

0 Likes

#30

Cool thing I just realized was trivial to implement with sublime syntax – coloring nested capture groups in regex:

0 Likes

Nested application of color scheme styles?