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

More language support #30

Closed
arnav56745 opened this issue Jul 20, 2023 · 19 comments
Closed

More language support #30

arnav56745 opened this issue Jul 20, 2023 · 19 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@arnav56745
Copy link

I want more language support but only C++ and Plain text is supported. I also want Python support.

@tomlin7 tomlin7 added enhancement New feature or request good first issue Good for newcomers labels Jul 20, 2023
@tomlin7 tomlin7 pinned this issue Jul 20, 2023
@tomlin7 tomlin7 self-assigned this Jul 20, 2023
@tomlin7
Copy link
Owner

tomlin7 commented Jul 20, 2023

@arnav56745 thanks for opening the issue on this! ❤ The features have already been added to the editor, haven't updated this repo yet. Cupcake is basically extracted from the main project to work as a standalone thing. I will work on updating the source code!

You can check the main project here: https://github.com/billyeatcookies/biscuit

@Moosems
Copy link

Moosems commented Jul 20, 2023

If it would be possible for the end user to add custom languages that aren't commonly used that would also be pretty useful.

@tomlin7
Copy link
Owner

tomlin7 commented Jul 20, 2023

@Moosems to make the process simple, using treesitter or textmate grammar files would be great! although I have tried to integrate treesitter before, I failed to get it working right

@Moosems
Copy link

Moosems commented Jul 20, 2023

I personally don't see the major advantage of using tree sitter. It doesn't support that many languages and if performance is a concern then only highlighting visible areas and reducing what you lex is much better overall.

@tomlin7
Copy link
Owner

tomlin7 commented Jul 20, 2023

@Moosems apart from the highlights done by pygments, I'm also working on LSP client to do semantic syntax highlights.

Also, yet another issue occurs when I tried to highlight the visible areas. For example, following python code

"""
imagine this docstring is a too long, and the user scrolled up to a point where the quote group is not visible anymore.
...


the lexer would take in the lines from here, and it would parse the rest as docstring!
"""

@arnav56745
Copy link
Author

arnav56745 commented Jul 20, 2023

@billyeatcookies Where will the cupcake editor be in "https://github.com/billyeatcookies/Biscuit/"? Please also give link to folder.

@tomlin7
Copy link
Owner

tomlin7 commented Jul 20, 2023

@arnav56745 You won't be able to use the code directly without some minor modifications :) I would also love to receive any help with updating cupcake repo! ❤️
https://github.com/billyeatcookies/Biscuit/tree/main/biscuit/core/components/editors/texteditor

@Moosems
Copy link

Moosems commented Jul 20, 2023

Ahh the multi line docstring/comment (MLCDS as I call it in my personal project). Yes, those absolutely pose an issue. The way I am planning to solve them is highlight the visible area once and, if the tag is found anywhere (keep a persistent memory to look at unhighlighted areas), figure out what created it and if it appears anywhere else in the file. If there are no other that means the end is either in the visible area and is working properly or it is past the visible area and is also working properly. The issue is when the start and end are the same so make pairs and if there's an odd number in the visible area add an end/start tag in the proper place to where the other end of the pair is such that you get the proper highlighting. If that didn't make sense, yeah, there's a lot of stuff going on 😅.

@Moosems
Copy link

Moosems commented Jul 20, 2023

There's not really any good way to handle them.

@tomlin7
Copy link
Owner

tomlin7 commented Jul 20, 2023

@Moosems I'm thinking the project you mentioned is chlorophyll? I have checked it before, the issue I faced with using the lib directly was that I was not able to modify the proxy set up within chlorophyll 😅

and yes, that's a lot of logic to comprehend, but I've somewhat got the idea xd

@Moosems
Copy link

Moosems commented Jul 20, 2023

Yeah I have been working with chlorophyll for some time now and enjoy using it.

@tomlin7
Copy link
Owner

tomlin7 commented Jul 20, 2023

@Moosems I have found and I'm currently going through your pr on this! :) rdbende/chlorophyll#35

@Moosems
Copy link

Moosems commented Jul 20, 2023

Yeah, I've started by first just getting it to highlight what's visible and now will work on adding MLCDS.

@arnav56745
Copy link
Author

@billyeatcookies Are you currently working? I am waiting for new update

@tomlin7
Copy link
Owner

tomlin7 commented Jul 21, 2023

@arnav56745 yes, see pr #31

@tomlin7
Copy link
Owner

tomlin7 commented Jul 21, 2023

@arnav56745 this issue has been considered in new release https://github.com/billyeatcookies/cupcake/releases/tag/v0.25.5

@arnav56745
Copy link
Author

Thanks! ❤🙂

@tomlin7
Copy link
Owner

tomlin7 commented Jul 22, 2023

@arnav56745 the readme has been updated to include further good docs on integrating the editor!

@arnav56745
Copy link
Author

@billyeatcookies I know!

@tomlin7 tomlin7 unpinned this issue Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants