Add syntax support for Crystal Programming Language
AbandonedPublic

Authored by cullmann on Sep 21 2017, 10:22 AM.

Details

Summary

This add syntax support the Crystal Programming Language.

Crystal is a compiled language, allowing it to run fast with a very low memory footprint.

Crystal syntax is heavily inspired on Ruby, so it feels natural to read and easy to write.

Crystal official page

Test Plan

Review and add crystal.xml and hightlight.cr.* to current syntax-highlighting support.

Diff Detail

Repository
R40 Kate
Lint
Lint Skipped
Unit
Unit Tests Skipped
faguilar created this revision.Sep 21 2017, 10:22 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 21 2017, 10:22 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript

I'm user of Manjaro KDE and I love coding using Kate. Currently I'm focused in Crystal learning using Ruby syntax, however Ruby syntax doesn't support all Crystal features.

faguilar updated this revision to Diff 19732.Sep 21 2017, 11:18 AM

Add Crystal input for autotests

faguilar edited the test plan for this revision. (Show Details)Sep 21 2017, 11:22 AM
faguilar added a subscriber: Kate.
dhaumann requested changes to this revision.Feb 2 2018, 8:27 AM

Sorry for the late reply.

Please do the following changes:

  • remove hard-coded colors from itemDatas. This way, your highlighting will look good in all color themes.

Also, is this language similar to other languages ? It seems it was copied from some other language, since it contains many authors.

This revision now requires changes to proceed.Feb 2 2018, 8:27 AM

Sorry for the late reply.

Please do the following changes:

  • remove hard-coded colors from itemDatas. This way, your highlighting will look good in all color themes.

    Also, is this language similar to other languages ? It seems it was copied from some other language, since it contains many authors.

Hi @dhaumann, I'm not an expert on kate editor, so this crystal syntax highlighting is based on ruby highlighting :-)

I'll remove hard-coded colors from itemDatas, What other change would you recommend?

faguilar updated this revision to Diff 26743.Feb 8 2018, 5:06 AM

Remove colors from itemData (suggested by @dhaumann)

Restricted Application added a project: Kate. · View Herald TranscriptFeb 8 2018, 5:06 AM
faguilar added inline comments.Mar 10 2018, 1:11 PM
data/syntax/crystal.xml
160

@dhaumann Crystal language supports macros. This macro syntax is a bit different from ruby

mwolff accepted this revision as: mwolff.Apr 3 2018, 7:42 PM
mwolff added subscribers: cullmann, mwolff.

we got a test file, and it seems to work for a user of the Crystal language, so +1 from my side. @dhaumann, @cullmann ?

cullmann accepted this revision.Apr 8 2018, 9:12 AM

The hard-coded colors got removed, test is there, all fine.
Thanks for the contribution!
If you can't push youself, tell me, I will push for you.

The hard-coded colors got removed, test is there, all fine.
Thanks for the contribution!
If you can't push youself, tell me, I will push for you.

Great!, This is my first contribution to The KDE project, I'm very happy you accepted it! :)

Great!, This is my first contribution to The KDE project, I'm very happy you accepted it! :)

I assume that means I shall push?
:=)

cullmann requested changes to this revision.Apr 8 2018, 9:57 AM

Ah, I let just the build run once more locally, the current static check says:

"/local/cullmann/kf5/src/frameworks/syntax-highlighting/data/syntax/crystal.xml" Unused itemData: QSet("Region Marker", "Error", "Expression")
"/local/cullmann/kf5/src/frameworks/syntax-highlighting/data/syntax/crystal.xml" Unused contexts: QSet("Comment Line")

Could you take a short look why that is? Perhaps just some left-over parts?

This revision now requires changes to proceed.Apr 8 2018, 9:57 AM

And the auto-test does have diffs like:

-<span style="font-weight:bold;">class</span> <span style="color:#0057ae;">Markdown</span><span style="color:#ff9fec;">::</span><span style="color:#0057ae;">Parser</span>

  • <span style="color:#000080;">record</span> <span style="color:#0057ae;">PrefixHeader</span>, count : <span style="color:#0057ae;">Int32</span>
  • <span style="color:#000080;">record</span> <span style="color:#0057ae;">UnorderedList</span>, char : <span style="color:#0057ae;">Char</span>

+<span style="font-weight:bold;">class</span> <span style="color:#0057ae;">Markdown</span>::<span style="color:#0057ae;">Parser</span>
+ record <span style="color:#0057ae;">PrefixHeader</span>, count : <span style="color:#0057ae;">Int32</span>
+ record <span style="color:#0057ae;">UnorderedList</span>, char : <span style="color:#0057ae;">Char</span>

Ah, I let just the build run once more locally, the current static check says:

"/local/cullmann/kf5/src/frameworks/syntax-highlighting/data/syntax/crystal.xml" Unused itemData: QSet("Region Marker", "Error", "Expression")
"/local/cullmann/kf5/src/frameworks/syntax-highlighting/data/syntax/crystal.xml" Unused contexts: QSet("Comment Line")

Could you take a short look why that is? Perhaps just some left-over parts?

Ok, let me fix that :)

oprypin added inline comments.
data/syntax/crystal.xml
37

Section should be "Sources"

Hi, did you get some time to look at the remaining issues?
If they are fixed, I am happy to merge that.

Restricted Application added a subscriber: kwrite-devel. · View Herald TranscriptAug 13 2018, 8:44 AM

Hi, did you get some time to look at the remaining issues?
If they are fixed, I am happy to merge that.

Hi, I haven't fixed the issues yet. I'm working on that, I will reply you again when the changes are ready :)

Hi, any update on this?

Hi, any update on this?

Not yet! :)

Ping? ;=)

Hi, I'm still here, I need some more time to get it working well. :)

;=) Any updates?

cullmann commandeered this revision.Jul 8 2019, 5:22 PM
cullmann edited reviewers, added: faguilar; removed: cullmann.

Please re-submit if you have time again, thanks!

cullmann abandoned this revision.Jul 8 2019, 5:22 PM