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

[FEATURE] Make an LSP for yuck #1232

Open
Fejiberglibstein opened this issue Nov 21, 2024 · 8 comments · May be fixed by #1241
Open

[FEATURE] Make an LSP for yuck #1232

Fejiberglibstein opened this issue Nov 21, 2024 · 8 comments · May be fixed by #1241
Labels
enhancement New feature or request

Comments

@Fejiberglibstein
Copy link

Fejiberglibstein commented Nov 21, 2024

Description of the requested feature

Create a lsp for the yuck language. This lsp could have features such as

  • autocomplete for widgets and widget's variables
  • hover documentation for builtin widgets
  • diagnostic messages for any errors
  • goto definition for user-made widgets
  • auto formatting

Proposed configuration syntax

No response

Additional context

I have made LSPs before in rust, so I would be willing to implement the lsp. I am just wondering if this is could be useful and something that people would be interested in.

@Fejiberglibstein Fejiberglibstein added the enhancement New feature or request label Nov 21, 2024
@DOD-101
Copy link

DOD-101 commented Nov 29, 2024

I am currently looking into creating a formatter for yuck. This could, if I manage to get something decent production ready, be used in conjunction with the LSP. Then you wouldn't need to implement formatting in the LSP itself.

@elkowar
Copy link
Owner

elkowar commented Dec 5, 2024

A good LSP would definitely be a HUGE thing! If you wanna go for it, do it!

@Fejiberglibstein
Copy link
Author

Fejiberglibstein commented Dec 8, 2024

Sounds good, we'll see how far I get. I'll be finishing exams in 2 weeks so I won't get much done aside from using this to procrastinate until then.

Would the LSP be made as a separate executable run with something like eww-lsp, or would it be packaged along with the eww executable and run with something like eww start-lsp?

@Fejiberglibstein Fejiberglibstein linked a pull request Dec 9, 2024 that will close this issue
4 tasks
@Eugenenoble2005
Copy link

I've actually been hacking together something like that over the past few days.

2024-12-11.21-51-55.mp4

It's very basic and I've only managed to get simple context aware completions working. The problem is that it does not have any connection to the core rust code base so types are hard-coded and stuff according to the docs which is probably not the best way to achieve this.

@Fejiberglibstein
Copy link
Author

Ah, very cool! My goal with this is to integrate it seamlessly into eww so that we could get stuff like diagnostics and go to definition without too much effort on my part. If you wanna help out with my implementation you can read everything I've mentioned so far in #1241. I'm still waiting on some feedback from @elkowar on how i should continue on my implementation.

@Eugenenoble2005
Copy link

Yh I have been reading your stuff. And it seems like a much better approach, I don't know rust(my impl is in c#) neither do I understand eww's codebase so I don't know how possible it is, but without some type of communication with eww, to achieve any form of reasonable diagnostics and code navigation I'd have to reimplement a yuck parser as closely as I can to @elkowar's implemetion which I imagine would be very difficult. Hopeful to see what you can come up with.

@Fejiberglibstein
Copy link
Author

Fejiberglibstein commented Dec 12, 2024

I don't know rust(my impl is in c#)

ah, well in that case I'd be welcome to any of your feedback/suggestions you might have.

I'd have to re-implement a yuck parser as closely as I can

yea doing that in a diff language and re-implementing it all yourself would be rather difficult

@Eugenenoble2005
Copy link

I don't know rust(my impl is in c#)

ah, well in that case I'd be welcome to any of your feedback/suggestions you might have.

I'd have to re-implement a yuck parser as closely as I can

yea doing that in a diff language and re-implementing it all yourself would be rather difficult

Yes it will be tricky.
My current implementation is located here in case you want to look at it.:
https://github.com/Eugenenoble2005/YuckLS/

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

Successfully merging a pull request may close this issue.

4 participants