-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: Change hover to use MarkupContent #213
Conversation
MarkedString[] has been deprecated so we switch to full Markdown syntax for hover messages Fixes #45
@plevold might want to have a look on this. I still need to fix the Doxygen parsing of docstrings |
8a19001
to
2d5ff5d
Compare
Codecov Report
@@ Coverage Diff @@
## master #213 +/- ##
==========================================
+ Coverage 86.03% 86.31% +0.28%
==========================================
Files 12 12
Lines 4439 4451 +12
==========================================
+ Hits 3819 3842 +23
+ Misses 620 609 -11
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
2aa05d7
to
5b02cdf
Compare
for more information, see https://pre-commit.ci
66aa56e
to
ae9d947
Compare
Fixes bug(parser): multiline scope registration assigns end of line not start of line as scope start #217
updates: - [github.com/asottile/pyupgrade: v3.0.0 → v3.1.0](asottile/pyupgrade@v3.0.0...v3.1.0)
e031a10
to
c3f805a
Compare
@gnikit looks very nice indeed! I've noticed two issues that would make it even better:
!> Generate an error report with the given message as root cause.
!! Use this to create general application errors which don't need to be
!! identified programatically. See
!!
!! ### Example:
!! ```fortran
!! subroutine ask_hal_9000(error)
!! use error_handling, only: error_t, fail
!! class(error_t), intent(out) :: error
!!
!! error = fail("I'm sorry Dave, I can't do that")
!! end subroutine
!! ```
pure module function fail_message(message) result(error)
!> Message to fail with
character(len=*), intent(in) :: message
type(error_report_t) :: error
end function I checked and this behaviour is present in the current fortls release as well, but I'm not sure where the trimming takes place. |
Even though I too agree that this is a more intuitive way to display documentation (having had my start with C++ where docs are on top), you will see that both the Python, C++, JS and TS extension display hover messages the same way. Not sure what the justification for this is but I would aim to keep it consistent.
We actually strip all code lines in a few places. It makes easier to parse if you don't have to worry about white spaces. Then to create new lines in hover Markdown we use a combination of spaces and newline characters, else the docstring would be too spaced out. In theory what you're saying should be relatively easy to fix only because it's the leading whitespace and not the trailing ones. Although reality might be a bit different, I'll have a look. |
I had not noticed that! I agree that consistency is a good idea. Also, if somebody really want an argument list at the top they could just include it in the main docstring instead so I don't think it needs to be changed. |
The hover response included a snippet for a signature request which is not how signature help requests are dealt.
Now the documentation of the procedure will be interpreted as Markdown similar to hover
MarkedString[] has been deprecated so we switch
to full Markdown syntax for hover messages
Changes:
Fixes #45
Fixes #70 if client permits it (vs code does not allow mathjax in markdown)
Fixes #214
Fixes #217
TODO:
@param[in|out]
as -->arg
-- desc'fortran90
in objects.py to "{langid}" and then string.from(langid=self.hover_language)