<p dir="auto"><em>From <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/saneyuki/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/saneyuki">@saneyuki</a> on February 2, 2016 3:34</em></p>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>VSCode, Version 0.10.7-insider (0.10.7-insider), 6c2d51a4b7b81753a3a4c46f9de9a15179e20304
<ul dir="auto">
<li>with enabling Salsa preview</li>
</ul>
</li>
<li>typescript@1.9.0-dev.20160201
<ul dir="auto">
<li>which is specified with <code class="notranslate">typescript.tsdk</code></li>
</ul>
</li>
</ul>
<h2 dir="auto">Description</h2>
<p dir="auto">The closure compiler style JSDoc <a href="https://developers.google.com/closure/compiler/docs/js-for-compiler" rel="nofollow">allows the generics like <code class="notranslate">Array&lt;T&gt;</code></a>, not only <code class="notranslate">Array.&lt;T&gt;</code>.<br>
But the above environment shows the argument styled with its style as <code class="notranslate">any</code> in the intellisense.</p>
<h3 dir="auto">problem case</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/**
 * @params {Array&lt;string&gt;} v
 * @return {string}
 */
function bar(v) { // 
  return v.join();
}

var b = bar([&quot;1&quot;, &quot;2&quot;]); // Intellisense shows this signature as `bar(v: any)`;"><pre class="notranslate"><span class="pl-c">/**</span>
<span class="pl-c"> * <span class="pl-k">@params</span> {Array&lt;string&gt;} v</span>
<span class="pl-c"> * <span class="pl-k">@return</span> {<span class="pl-smi">string</span>}</span>
<span class="pl-c"> */</span>
<span class="pl-k">function</span> <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-s1">v</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// </span>
  <span class="pl-k">return</span> <span class="pl-s1">v</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">"1"</span><span class="pl-kos">,</span> <span class="pl-s">"2"</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Intellisense shows this signature as `bar(v: any)`;</span></pre></div>
<h3 dir="auto">non-problem case</h3>
<p dir="auto">It's ok <code class="notranslate">Array.&lt;T&gt;</code> or <code class="notranslate">T[]</code>which is allowed in <a href="http://usejsdoc.org/tags-type.html" rel="nofollow">http://usejsdoc.org/tags-type.html</a></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/**
 * @params {Array.&lt;string&gt;} v
 * @return {string}
 */
function foo(v) {
  return v.join();
}

var b = foo([&quot;1&quot;, &quot;2&quot;]); // Intellisense shows this signature as `foo(v: any)`;"><pre class="notranslate"><span class="pl-c">/**</span>
<span class="pl-c"> * <span class="pl-k">@params</span> {Array.&lt;string&gt;} v</span>
<span class="pl-c"> * <span class="pl-k">@return</span> {<span class="pl-smi">string</span>}</span>
<span class="pl-c"> */</span>
<span class="pl-k">function</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s1">v</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">return</span> <span class="pl-s1">v</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">"1"</span><span class="pl-kos">,</span> <span class="pl-s">"2"</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Intellisense shows this signature as `foo(v: any)`;</span></pre></div>
<h3 dir="auto">What I expect</h3>
<p dir="auto">I want Salsa interprets the closure compiler style's generics annotation.<br>
By any chance, I should report this to <a href="https://github.com/Microsoft/TypeScript">https://github.com/Microsoft/TypeScript</a>?</p>
<p dir="auto"><em>Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="130562245" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/2629" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/2629/hovercard" href="https://github.com/microsoft/vscode/issues/2629">microsoft/vscode#2629</a></em></p>
<p dir="auto">Generic types may not be specified for variable, param, or return types currently. For example, both of the below just show up as 'any's.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/** @type {PromiseLike&lt;string&gt;} */
var a9;

/**
 * @return {PromiseLike&lt;string&gt;}
 */
function f9(){}"><pre class="notranslate"><span class="pl-c">/** <span class="pl-k">@type</span> {PromiseLike&lt;string&gt;} */</span>
<span class="pl-k">var</span> <span class="pl-s1">a9</span><span class="pl-kos">;</span>

<span class="pl-c">/**</span>
<span class="pl-c"> * <span class="pl-k">@return</span> {<span class="pl-smi">PromiseLike&lt;string&gt;</span>}</span>
<span class="pl-c"> */</span>
<span class="pl-k">function</span> <span class="pl-en">f9</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">We should support this using a syntax like that show above, which closely matches TypeScript's and is covered in the Closure Compiler docs also (<a href="https://developers.google.com/closure/compiler/docs/js-for-compiler#instantiating-a-generic-type" rel="nofollow">https://developers.google.com/closure/compiler/docs/js-for-compiler#instantiating-a-generic-type</a>)</p>