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

Rework textDocument/signatureHelp #1513

Merged
merged 3 commits into from
Dec 6, 2020
Merged

Conversation

rwols
Copy link
Member

@rwols rwols commented Dec 6, 2020

  • Proper handling of markdown parameter docs.
  • Don't assume that function signatures have an ( and ).
  • Put the active parameter docs at the top, font-size 1rem.
  • Put the signature docs under that, font-size 0.9rem.
  • Use 0.9rem font-size for the intro message.
  • KISS.

close #1001

@rwols rwols requested a review from rchl December 6, 2020 14:20
- Proper handling of markdown parameter docs.
- Don't assume that function signatures have an `(` and `)`.
- Put the *active parameter docs* at the top, font-size 1rem.
- Put the *signature docs* under that, font-size 0.9rem.
- Use 0.9rem font-size for the intro message.
- KISS.
@rchl
Copy link
Member

rchl commented Dec 6, 2020

When I've triggered signature help manually and gotten this response from the server:

{
  "activeParameter": null,
  "activeSignature": null,
  "signatures": []
}

it opened a very tiny, empty popup.

Copy link
Member

@rchl rchl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work as well as before on few basic tests so I'll not dig too much into the code :)

Are you planning some further improvements to signature help in the near future? I think it works poorly in the sense that it disappears way too easily on writing the code or moving the cursor around. So if you are not planning work then I might look into it eventually.

@rwols
Copy link
Member Author

rwols commented Dec 6, 2020

{
  "activeParameter": null,
  "activeSignature": null,
  "signatures": []
}

this is actually invalid. "activeParameter" and "activeSignature" are supposed to be an integer. The spec also states that if there are no signatures the server should return null. But we have to protect against these kinds of malformed responses anyway I suppose :)

@rwols rwols merged commit 3b33cc6 into st4000-exploration Dec 6, 2020
@rwols rwols deleted the feat/sighelp-context branch December 6, 2020 20:22
@rwols
Copy link
Member Author

rwols commented Dec 6, 2020

Are you planning some further improvements to signature help in the near future?

No. Feel free to improve it. Though I feel that you'd be swimming against the ST API stream. There is no natural way to keep a popup open when typing.

@predragnikolic
Copy link
Member

is no natural way to keep a popup open when typing.

Could COOPERATE_WITH_AUTO_COMPLETE help?

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

Successfully merging this pull request may close these issues.

The signature help "parentheses" detection needs more work
3 participants