Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement inlay hints #259

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

Conversation

entropitor
Copy link
Contributor

Fixes #258

Support inlay hints feature from Typescript 4.4

@rchl
Copy link
Member

rchl commented Sep 23, 2021

I have fixed the crash in test-utils on master so if you merge latest version, it should work better.

That said, I would like to ask you to add some tests for the feature, if possible.

@entropitor
Copy link
Contributor Author

@rchl What kind of test do you expect? What should it test? That we call tsserver with the correct arguments?

@rchl
Copy link
Member

rchl commented Sep 23, 2021

Make a new InlayHints request on a certain document and verify that the expected inline hints are returned.

Something simple similar to

it('references', async () => {
const f = filePath('module2.ts');
server.notify(CommandTypes.Open, {
file: f,
fileContent: readContents(f)
});
const references = await server.request(CommandTypes.References, {
file: f,
line: 8,
offset: 16
});
assert.isDefined(references.body);
assert.equal(references.body!.symbolName, 'doStuff');
}).timeout(10000);

@entropitor
Copy link
Contributor Author

@rchl I've pushed a test

@entropitor entropitor force-pushed the implement-inlay-hints branch from 61af30d to f5cbc8c Compare September 24, 2021 10:17
@entropitor
Copy link
Contributor Author

@rchl I've pushed some changes

@entropitor
Copy link
Contributor Author

@rchl Once more, I think I addressed all comments :)

@rchl
Copy link
Member

rchl commented Sep 26, 2021

Let me know if you are fine with my minor changes.

@entropitor
Copy link
Contributor Author

@rchl Looks good to me

@rchl rchl merged commit 75a30d7 into typescript-language-server:master Sep 27, 2021
@rchl
Copy link
Member

rchl commented Sep 27, 2021

Thanks!

@entropitor entropitor deleted the implement-inlay-hints branch September 27, 2021 11:32
@entropitor
Copy link
Contributor Author

@rchl can we get this released on npm? Or would we need more PRs to be merged for that?

@rchl
Copy link
Member

rchl commented Sep 27, 2021

Done.

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.

Support inlay hints
2 participants