Closed resolritter closed 2 years ago
It's not possible to add inline virtual text on both vim and neovim, so send your feature request to vim/neovim fist.
It could work with virtual text at the end of the line in Neovim, like coc-rust-analyzer
I'll take a look on this after TS 4.4 released. There're several works:
Test code:
// enumMemberValues
enum E1 {
A,
B,
}
enum E2 {
A = 0,
B = 1,
}
// functionLikeReturnTypes
function foo() {
return Date.now()
}
function bar(): number {
return Date.now()
}
// parameterNames
parseInt('123', 8)
// parameterTypes
document.addEventListener('click', e => {
console.log(e)
})
// propertyDeclarationTypes
class Bar {
prop = Date.now;
}
// variableTypes
const xxf = Date.now()
In VSCode:
In coc, only enumMemberValues
, functionLikeReturnTypes
and variableTypes
are enabled.
Because we can't set inline virtual text, parameterNames
, parameterTypes
and propertyDeclarationTypes
are disabled.
@chemzqm any thoughts on this? Do we need to add this in coc-tsserver?
The variableTypes
hints should be disabled too.
How is this going, guys? Any updates? When can we use this feature?
Announcement: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta/#inlay-hints Linked PR: https://github.com/microsoft/TypeScript/pull/42089 (was already merged)
I believe this has not yet landed on a stable release although 4.4 is scheduled for next month already