Cudatext: Svelte syntax highlight

Created on 22 May 2021  路  14Comments  路  Source: Alexey-T/CudaText

Implement syntax highlighting support, please. Perhaps it will not be trivial, because there can be several languages at once in one file. In particular, with the help of the svelte-preprocess plugin, support for TypeScript, Less, Sass, CoffeeScript and so on is added. Sublime Text implements syntax highlighting using this plugin: https://github.com/corneliusio/svelte-sublime.

Code examples can be found here: https://svelte.dev/docs.

lexer

Most helpful comment

fixed that bug, lexer updated. you can be 'critical' here, it's OK. welcome more bugreports.

All 14 comments

I will consider it.
as a 'thank you' I welcome some youtube-video about app.

as a 'thank you' I welcome some youtube-video about app.

I am not blogging, but I can donate.

@Katarn No need this yet - but I guess that @halfbrained needs a donation for his hard work on Cud plugins. his plugins-- https://github.com/halfbrained

No problem, I can probably make a donation via PayPal. But I need requisites, of course.

Thanks for consideration, but my country does not accept PayPal payments

It's funny, PayPal doesn't allow sending money from Russia to Russia. In this case, I can make a transfer by credit card.

Please write me empty message to support (at) uvviewsoft.com , I will send the credit card num

I just made the lexer, first version, pls give the feedback. I have only few test files and didn't check all the docs of the lang.
code-tree shows nodes only from JS and CSS parts.
folding must work for {#if} and other svelte blocks, and for HTML tags.

I didn't have the full keyword list to highlite, so give the link to full list (bold black words).

sve1

Lexer was just updated. keyword list updated. added red underlines for unknown tags (except for ClassNames).

It seems that at the moment the support for pure Svelte already looks sufficient. The only thing missing is less/scss/typescript and so on, everything that is supported by the svelte-preprocess.

Updated the lexer: it requires/supports: LESS SCSS TypeScript. (requirements are solved by AddonManager)

What to do with other include-langs, like Pug, CofeeScript...? I can add them but then lexer will auto-install all these lexers, not nice to auto-install 5+ lexers.

IMHO, you can do nothing, this is not the mainstream in this area of development.

I'm not critical, but noticed a small bug: syntax highlighting is turned on for lang="ts", but not turned on for lang="typescript".

fixed that bug, lexer updated. you can be 'critical' here, it's OK. welcome more bugreports.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EchedeyLR picture EchedeyLR  路  3Comments

junguler picture junguler  路  5Comments

charliewales picture charliewales  路  4Comments

rhinolophus picture rhinolophus  路  5Comments

Alexey-T picture Alexey-T  路  5Comments