Skip to content

Baseline completions and signature help #43049

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

Merged
merged 11 commits into from
Mar 3, 2021

Conversation

sandersn
Copy link
Member

@sandersn sandersn commented Mar 2, 2021

Background: I need to update a lot of jsdoc tests since #41877 makes the jsdoc parse tree much more complete. This leads to a lot of painstaking, repetitive work updating fourslash tests.

In this PR, I add baselining to completions and signature help, to match the baselining for quick info. I also changed the filename, which should really be the containing filename.

Limitations

  • I only changed the tests that I care about for Editor support for link tag #41877 because I wanted to have time to inspect the baselines for this change. And I haven't planned out a way to update the tests. Ideas are welcome.
  • Quick info, signature help, smart selection and completions all use the same filename and are thus mutually exclusive in one test. Fourslash tests are mostly divided this way already, so I thought it was an acceptable limit. I had to split five or six existing, gigantic, horrible tests as a result.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Mar 2, 2021
@sandersn sandersn requested review from andrewbranch and orta March 2, 2021 19:02
@sheetalkamat
Copy link
Member

One suggestion is that the baseline is appended so that you can add multiple commands baseline to same file .. I think it would be useful if you want to edit a file and see completions or quick info after the edit

@sandersn
Copy link
Member Author

sandersn commented Mar 2, 2021

Or it might be good to add a baselineAll variant that takes a list of baselines to produce.

Another problem I thought of is that the completions baselines are large, so asking for completions at every marker is unneeded.

{
"marker": {
"fileName": "/tests/cases/fourslash/completionsCommentsClass.ts",
"position": 599
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to have marker name or line and coloumn info as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Name is quite easy to add, so I did that. I don't know of an easy way to convert positions back to line/columns, though.

@sandersn sandersn merged commit 5dbb110 into master Mar 3, 2021
@sandersn sandersn deleted the baseline-completions-and-signaturehelp branch March 3, 2021 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants