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 highlighting #178

Open
Leon99 opened this issue Aug 9, 2021 · 8 comments
Open

Syntax highlighting #178

Leon99 opened this issue Aug 9, 2021 · 8 comments
Labels

Comments

@Leon99
Copy link

Leon99 commented Aug 9, 2021

Installing this plugin disables all syntax highlighting in a .cake file. Is that by design?

@nils-a
Copy link
Member

nils-a commented Aug 9, 2021

@Leon99 well, the answer is yes, that is currently by design.

Rider, in it's default, somehow assumes some language for Cake files. (I've not found out which, currently.)
When installing Cake for Rider, we define a language for Cake files (this is needed for most of the things the plugin does) and this definition in it's current state does not include syntax highlighting, sadly.

@Leon99
Copy link
Author

Leon99 commented Aug 10, 2021

Sad indeed, editing C# code without syntax highlighting is not nice at all.

@nils-a
Copy link
Member

nils-a commented Aug 10, 2021

Agreed. Sadly "extending" on existing languages is not possible in Rider. So we can't re-use what's available for c# and have to re-implement everything. Currently the only IDE supporting auto-complete and highlighting is the Cake extension for VS Code.
(There, that's done via OmniSharp which sadly is not an option for Rider)

@nils-a nils-a added the Feature label Aug 12, 2021
@js6pak
Copy link
Contributor

js6pak commented Aug 9, 2022

So we can't re-use what's available for c# and have to re-implement everything

That completely defeats the point of a rider plugin imo. If you want to use omnisharp, just use vscode.

Sadly "extending" on existing languages is not possible in Rider

Are you sure? Don't know hacky it will be yet, but I'm pretty sure all we have to do is to just "fake" our own C# project to resharper.

@nils-a
Copy link
Member

nils-a commented Aug 9, 2022

Are you sure? Don't know hacky it will be yet, but I'm pretty sure all we have to do is to just "fake" our own C# project to resharper.

This is, in essence, what O# does when processing Cake. I've never tried it that way.. You're very welcome to give it a try.

@garywoodfine
Copy link

@nils-a Do you know of any resources I could use to learn how to do Syntax Highlighting?
I use the plugin almost everyday and really appreciate it. but the lack of syntax highlighting does frustrate me.
I'd love to contribute to help start implementing it but unfortunately my skills in Plugin Development and Kotlin are limited so I would need to learn.

@nils-a
Copy link
Member

nils-a commented Mar 17, 2023

@garywoodfine The best resource I know is the Custom Language part of the SDK. You'd best start with Implementing a lexer and then continue over the following two chapters.

However, there is also (a bit undocumented, though) the Embedded Language feature. I've always wanted to test if that could be utilized to "overlay" the cake features over any existing language.

On a sidenote: Learning Kotlin was very straight forward for me. In part it's very similar to C# and Java and it is simply a brilliant language. (You can use the IntelliJ in the community edition to work on the plugin.)

@garywoodfine
Copy link

Thanks I will take a look and set myself onto a new learning adventure!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants