-
-
Notifications
You must be signed in to change notification settings - Fork 41
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 for code in comments #209
Comments
I will have to think about this a bit but off the top of my head my thoughts are:
|
Yes, that sounds hard... I haven't looked at the Rust-analyzer code (nor would I be competent to do that) so I can't be completely sure, but the feeling I get is that what they do is quite minimal just to get some reasonable coloring. I had a closer look at how Rust-analyzer is behaving and made some interesting observations:
|
@plevold I have a "working" (tests pass but code style is hot garbage) version of the markdown LSP response. I need to do some splitting and reparsing of the docs and add a option for the deprecated style of requests i.e. where the entire hover message was put into a |
@gnikit wow, that was quick! Feel free to ping me if you want any beta testing. |
Splitting the documentation from within the procedure hover message is a bit of a nightmare. I'll ping you when I have something that can deploy. |
Is your feature request related to a problem? Please describe.
Note: I'm not sure whether fortls or the Modern Fortran VSCode extension is the right place for this suggestion. Feel free to let me know if it should be moved. Also, it is somewhat related to #208, but I think it belongs in a separate issue.
The Rust VSCode extension / Rust-analyzer has some interesting features when it comes to comments which I think could fit nicely into Modren Fortran / fortls as well. Take the following example from the PyO3 crate:
In VSCode, this renders as follows:
Hovering the struct (type) gives this:
Describe the solution you'd like
There's two nice things with the Rust-analyzer way which I think could be considered for fortls as well:
Additional context
This is probably not a trivial task even if it's technically reasonable to implement. The Fortran community at large should probably agree on a way of writing documentation comments which fortls then can pick up. Rust seems to use markdown syntax for this. Another option is to use Doxygen commands like \code. Personally I like the markdown approach, but there are many considerations to be made here.
The text was updated successfully, but these errors were encountered: