TypeScript/tests/cases/fourslash/inlayHintsShouldWork30.ts

17 lines
397 B
TypeScript
Raw Normal View History

Add inlay hints support (#42089) * Add signature arguments label support * Support rest parameters and destruction * make lint * Fix tuple rest parameters * Adjust name styles * Rename to inline hints * Partition inline hints * Adjust range pred * Add function expression like hints * Support configure inline hints * Display hints in single line * Add test suits and tests * Add range tests * Support more hints * Add more options * Fix logical * Add more cases * Support call chains * Rename options * Match lastest protocol * Update protocol changes * Support context value and hover message * Revert "Support context value and hover message" This reverts commit 37a70896337ddd6dd5360d20e7001ed2338a2595. * Revert "Update protocol changes" This reverts commit e5ca31bc30362144c52c1c2512abc553f0c6b869. * Add hover message * Accept baseline * Update src/services/inlineHints.ts Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> * Update src/services/inlineHints.ts Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> * Cache across the program * Fix possible undefined * Update protocol changes * Fix missing property * Make lint happy * Avoid call chain hints * I'm bad * Add whitespace before type * Add more tests * Should care about jsdoc * Support complex rest parameter * Avoid module symbol hints * Care about leading comments * Fix CR issues * Avoid changes * Simplify comments contains * Fix CR issues * Accept baseline * Check parameter name before create regex * Rename option * Avoid makers * Skip parens for argument * Fix CR issues * Fix enums * Accept baseline Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-06-25 08:06:34 +02:00
/// <reference path="fourslash.ts" />
//// function f<T>(v: T, a: (v: T) => void) {}
//// f(1, a/*a*/ => { })
const markers = test.markers();
verify.getInlayHints([
{
text: ': number',
position: markers[0].position,
kind: ts.InlayHintKind.Type,
whitespaceBefore: true
}
], undefined, {
includeInlayFunctionParameterTypeHints: true
});