Jump to page: 1 2
Thread overview
Sublime Text Syntax Definition Rewrite
Feb 28, 2019
Benjamin Schaaf
Feb 28, 2019
TheGag96
Feb 28, 2019
Dmitry
Feb 28, 2019
Benjamin Schaaf
Feb 28, 2019
Daniel N
Feb 28, 2019
Dmitry
Mar 01, 2019
Benjamin Schaaf
Mar 01, 2019
Dmitry
Feb 28, 2019
Guillaume Piolat
Feb 28, 2019
Andre Pany
Feb 28, 2019
JN
Feb 28, 2019
Andre Pany
Mar 01, 2019
Benjamin Schaaf
Feb 28, 2019
Andrea Fontana
Mar 01, 2019
Benjamin Schaaf
Mar 13, 2019
Benjamin Schaaf
Mar 13, 2019
Andrea Fontana
Mar 14, 2019
Dmitry
February 28, 2019
Hello all,

I've recently gotten a massive rewrite of the D syntax highlighting merged into the Sublime Text default packages. This has since been deployed in the most recent development version 3192 (license required) and will be shipping with the next stable.

Anyone trying Sublime Text has probably noticed the poor D support. Here's a very incomplete list of everything that's been fixed/improved:

* Functions, classes, interfaces, enums, structs, unions, templates and aliases are now properly indexed, making GoTo Definition work properly
* Function/Template calls are properly marked, making GoTo Reference work properly
* Nested comments now work as expected
* Shebangs are properly highlighted
* Ligatures are now properly supported
* `..` no longer highlights as a floating point
* Strings are now properly highlighted, including postfixes and delimited strings
* Token strings actually highlight tokens now
* Attributes, including UDAs, are highlighted properly
* Automatic indentation is no longer broken (Typing `} catch...` would re-indent the line)
* Arguments are highlighted as actual arguments
* Contracts are properly highlighted now

You can find the pr here: https://github.com/sublimehq/Packages/pull/1850

If you do find a bug with the syntax highlighting or just something that could be done better please leave a bug report on the repository, I'll be maintaining it for the foreseeable future:
https://github.com/sublimehq/Packages/issues

If you don't have a license you can still use the new syntax highlighting before the next stable build by cloning the repository and symlinking the `D` folder into your Sublime Text "Packages" directory (Details in the README).
You can download Sublime Text here: https://www.sublimetext.com/3

Hope you enjoy!
---------------

Full disclosure: I work for Sublime HQ. Though I'd love to, we don't use D internally for anything.
February 28, 2019
On Thursday, 28 February 2019 at 00:30:24 UTC, Benjamin Schaaf wrote:
> snip

Thank you so much for doing this!! Sublime is my all time favorite editor, and I was always unhappy with the wonky syntax support. I'll be grabbing this update ASAP.

February 28, 2019
On Thursday, 28 February 2019 at 00:30:24 UTC, Benjamin Schaaf wrote:
> I've recently gotten a massive rewrite of the D syntax
...
> Hope you enjoy!
> ---------------
Thank you! Looking forward to try it (right now it shows 'no update available', build 3176)

> Though I'd love to, we don't use D internally for anything.
Is this the reason why it works extremely slow with big files? :D

February 28, 2019
On Thursday, 28 February 2019 at 05:37:42 UTC, Dmitry wrote:
> On Thursday, 28 February 2019 at 00:30:24 UTC, Benjamin Schaaf wrote:
>> I've recently gotten a massive rewrite of the D syntax
> ...
>> Hope you enjoy!
>> ---------------
> Thank you! Looking forward to try it (right now it shows 'no update available', build 3176)

3176 was the latest stable build, you'd need to change to the development versions (requires a license) to get more recent updates or you can install the Packages manually.

> Is this the reason why it works extremely slow with big files? :D

I know you're just taking a fun jab but from personal experience its behaved pretty well with multi-GB files. All the corner cases we're aware of where it does become slow are algorithmic problems where a change in language really wouldn't help :)
February 28, 2019
On Thursday, 28 February 2019 at 06:54:32 UTC, Benjamin Schaaf wrote:
> On Thursday, 28 February 2019 at 05:37:42 UTC, Dmitry wrote:
>> On Thursday, 28 February 2019 at 00:30:24 UTC, Benjamin Schaaf wrote:
>>> I've recently gotten a massive rewrite of the D syntax
>> ...

Cool, thank you so much, much appreciated!


February 28, 2019
On Thursday, 28 February 2019 at 00:30:24 UTC, Benjamin Schaaf wrote:
>
> Anyone trying Sublime Text has probably noticed the poor D support. Here's a very incomplete list of everything that's been fixed/improved:
>


Very much appreciated! Using Sublime everyday.
February 28, 2019
On Thursday, 28 February 2019 at 00:30:24 UTC, Benjamin Schaaf wrote:
> Hello all,
>
> I've recently gotten a massive rewrite of the D syntax highlighting merged into the Sublime Text default packages. This has since been deployed in the most recent development version 3192 (license required) and will be shipping with the next stable.
>
> [...]

Great work! There is also the "D Language Server" available (https://github.com/d-language-server/dls) which can be used to add code completion, linting and formatting.
You may check whether you can make direct use of DLS in your plugin without usage
of the generic LSP plugin (https://github.com/tomv564/LSP).

Kind regards
André
February 28, 2019
On Thursday, 28 February 2019 at 10:11:23 UTC, Andre Pany wrote:
> Great work! There is also the "D Language Server" available (https://github.com/d-language-server/dls) which can be used to add code completion, linting and formatting.
> You may check whether you can make direct use of DLS in your plugin without usage
> of the generic LSP plugin (https://github.com/tomv564/LSP).

Bit off-topic, but:

"Tested against language servers for javascript, typescript, python, php, java, go, c/c++ (clangd), scala (dotty), julia, rust, reason."

This is something I see very often nowadays. Most cross-language projects are including things like julia, rust, go, but D never seems on the radar for people. Many new open-source projects are thinking "should we use C/C++ or go for Go/Rust" rather than "should we use C/C++ or go for Go/Rust/D". This is unfortunate, and I don't know full reason for that, but it's something that's starting to be noticeable.
February 28, 2019
On Thursday, 28 February 2019 at 06:54:32 UTC, Benjamin Schaaf wrote:
> I know you're just taking a fun jab but from personal experience its behaved pretty well with multi-GB files. All the corner cases we're aware of where it does become slow are algorithmic problems where a change in language really wouldn't help :)
I was kidding, but not for 100%.

If I open 3-10 GB file (log) and then try to find something, it's almost unusable. For example, I pressed Ctrl+F and entered first char. After it, Sublime may become frozen for (just for example, it depends) 40 seconds. Then second char — same. Etc. So, just to open file and find first required record (like '2019-02-28, 08:05:') may take 5 minutes (and again, it depends). As I understand, it's because Sublime tries to find and highlight all same sequences. Any old editor (without such highlighting) works faster.

Tried just now. File 6.1 GB. I pressed Ctrl+F and it showed search panel in 26 seconds. I entered '2'. Took 33 seconds. Then second char — '0', 27 seconds. '1' — about 26 seconds. '9' - 26 seconds. So, just to find first '2019' took about 140 seconds.
Would be better if it instantly find first record and then 'in background' search all other records.

Another example. File 1.5GB. Notepad++ opens it about 8-9 seconds, Sublime opens it about 29-30 seconds. Tried to find '2019', and it took less than a second in N++. Tried to find another record (placed almost of the end of the file). Sublime took about 40 seconds, N++ about 10 seconds.

For example, my usercase was like:
1. Open file
2. Find first record of required date
3. Delete all records before
4. Find last record of required date
5. Delete all records after
6. Make actions (usually with 'Filter Lines' plugin, etc).
and such things took a lot of time.

P.S. 32GB RAM, i9-9900K, GTX1080, Windows 10
P.P.S. Also there are some problems when opened many tabs (6-7 windows, 100+ tabs). Then I can't drag the window to second display. It changes size to minimal possible and I can't catch it (there are only sublime icon + window's icons)
P.P.P.S. Sublime is my main/favourite editor and I use both 2 and 3 verisons at the same time (3 is a lot faster than 2).
February 28, 2019
On Thursday, 28 February 2019 at 00:30:24 UTC, Benjamin Schaaf wrote:
> Hello all,
>
> I've recently gotten a massive rewrite of the D syntax highlighting merged into the Sublime Text default packages. This has since been deployed in the most recent development version 3192 (license required) and will be shipping with the next stable.

When the next stable will be released?

Andrea
« First   ‹ Prev
1 2