Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax coloring for .kt files #1228

Merged
merged 6 commits into from May 3, 2019

Conversation

@JaroslavTulach
Copy link
Contributor

commented May 2, 2019

Last week I had a presentation in Ostrava. The second speaker, Leoš, was talking about Kotlin. Hence I decided to demonstrate native image with the sieve of Eratosthenes written in Kotlin.

I had to write a NetBeans module that provides syntax coloring for the .kt files. Here is the code that I have. If OK, I'd like to push it to master branch.

@GeertjanWielenga

This comment has been minimized.

Copy link

commented May 2, 2019

Excellent.

@JaroslavTulach

This comment has been minimized.

Copy link
Contributor Author

commented May 2, 2019

This PR can serve as an example how to integrate syntax coloring for any language into NetBeans:

  1. find the TextMate grammar somewhere (mine is from kotlin-sublime-package project, ASF 2.0 licensed, so OK, right @matthiasblaesing?)
  2. use the FileType wizard to generate DataObject representing the file in editor
  3. use @GrammarRegistration annotation to connect the two
  4. prepare a new file template processed by freemarker
@geertjanw
Copy link
Member

left a comment

Great.

@Chris2011

This comment has been minimized.

Copy link
Contributor

commented May 2, 2019

Cool. I did it similar in my repo: https://github.com/Chris2011/TextmateBeans. Didn't know that a @GrammarRegistratrion exists, but I see, only for the NetBeans core, not usable for 3rd-party-plugins.

I had a look into the code and it looks straight forward :)

@jtulach

This comment has been minimized.

Copy link
Contributor

commented May 2, 2019

Re. TextMateBeans - wouldn't it be better to donate all of that to Apache? Then I wouldn't have to bother with Kotlin (only Kotlin) myself!

@Chris2011

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

Yes but first, I had an other intention to create such plugin, for this we can talk in private :) and second not all of that languages are working as expected. I created 4 tickets in case of problem with the textmate lexer. But also another topic.

@JaroslavTulach

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2019

... I had an other intention to create such plugin...

OK, I'll integrate my changes then. If you even consider contributing to Apache NetBeans, you can modify my commits.

@JaroslavTulach JaroslavTulach merged commit e9ecefd into apache:master May 3, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@JaroslavTulach JaroslavTulach deleted the JaroslavTulach:jtulach/KotlinColoring branch May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.