* Accept change * Accept the huge set of ever so slightly changed baselines * Update return type logic to only reuse nodes if original nodes share scope with current node, like property types, only reuse nodes if symbols referened are acessible, reuse nodes for property signatures, too * Only reuse nodes when a context is provided (otherwise identifier printback may fail) * Only track symbol if symbol is found and no error is recorded * Fix type parameter reuse lookup * Forbid cjs module.exports references in retained nodes * Adjust check for cjs export references to not include bad module type in output * Add symbol to all identifiers we see in existing nodes for quickinfo * Accept fourslash baseline updates * Accept slightly updated baseline post-merge * Do not copy original nodes for error types, replace empty type references with any
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
/// <reference path="../fourslash.ts"/>
|
|
|
|
// @allowNonTsExtensions: true
|
|
// @Filename: jsdocCallbackTag.js
|
|
//// /**
|
|
//// * @callback FooHandler - A kind of magic
|
|
//// * @param {string} eventName - So many words
|
|
//// * @param eventName2 {number | string} - Silence is golden
|
|
//// * @param eventName3 - Osterreich mos def
|
|
//// * @return {number} - DIVEKICK
|
|
//// */
|
|
//// /**
|
|
//// * @type {FooHa/*8*/ndler} callback
|
|
//// */
|
|
//// var t/*1*/;
|
|
////
|
|
//// /**
|
|
//// * @callback FooHandler2 - What, another one?
|
|
//// * @param {string=} eventName - it keeps happening
|
|
//// * @param {string} [eventName2] - i WARNED you dog
|
|
//// */
|
|
//// /**
|
|
//// * @type {FooH/*3*/andler2} callback
|
|
//// */
|
|
//// var t2/*2*/;
|
|
//// t(/*4*/"!", /*5*/12, /*6*/false);
|
|
|
|
goTo.marker("1");
|
|
verify.quickInfoIs("var t: FooHandler");
|
|
goTo.marker("2");
|
|
verify.quickInfoIs("var t2: FooHandler2");
|
|
goTo.marker("3");
|
|
verify.quickInfoIs("type FooHandler2 = (eventName?: string | undefined, eventName2?: string) => any", "- What, another one?");
|
|
goTo.marker("8");
|
|
verify.quickInfoIs("type FooHandler = (eventName: string, eventName2: number | string, eventName3: any) => number", "- A kind of magic");
|
|
verify.signatureHelp({
|
|
marker: '4',
|
|
text: "t(eventName: string, eventName2: string | number, eventName3: any): number",
|
|
parameterDocComment: "- So many words",
|
|
tags: [{ name: "type", text: "{FooHandler} callback" }]
|
|
});
|
|
verify.signatureHelp({
|
|
marker: '5',
|
|
parameterDocComment: "- Silence is golden",
|
|
tags: [{ name: "type", text: "{FooHandler} callback" }]
|
|
});
|
|
verify.signatureHelp({
|
|
marker: '6',
|
|
parameterDocComment: "- Osterreich mos def",
|
|
tags: [{ name: "type", text: "{FooHandler} callback" }]
|
|
});
|