<p dir="auto">The Deno LSP gets confused by dynamic imports in weird ways it's easiest to demonstrate with screenshots...</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1754873/135978469-6b89e6bd-b2bf-4ac7-ba91-186e23822733.png"><img width="861" alt="Screen Shot 2021-10-05 at 6 24 20 pm" src="https://user-images.githubusercontent.com/1754873/135978469-6b89e6bd-b2bf-4ac7-ba91-186e23822733.png" style="max-width: 100%;"></a></p>
<p dir="auto">Notice that the type error is invalid (perhaps related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="941573895" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/11362" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/11362/hovercard?comment_id=933269561&amp;comment_type=issue_comment" href="https://github.com/denoland/deno/issues/11362#issuecomment-933269561">#11362 (comment)</a>), and Deno seems to incorrectly think the type is scoped to the file of the first dynamic import later on in the function. Another weird thing is the <code class="notranslate">file://</code> path Deno is displaying in the error omits the <code class="notranslate">.js</code> file extension.</p>
<p dir="auto">Later in the same module, you can see that Deno incorrectly thinks each dynamic import is actually the next dynamic import:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1754873/135979234-57f1ada5-6ae5-4920-a319-4585bbfc6503.png"><img width="904" alt="Screen Shot 2021-10-05 at 6 29 25 pm" src="https://user-images.githubusercontent.com/1754873/135979234-57f1ada5-6ae5-4920-a319-4585bbfc6503.png" style="max-width: 100%;"></a></p>
<p dir="auto">The last dynamic import incorrectly has no intellisense when the path is hovered:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1754873/135979557-b67d3c6d-a722-4804-8cc9-4fe462e1ed25.png"><img width="736" alt="Screen Shot 2021-10-05 at 6 31 41 pm" src="https://user-images.githubusercontent.com/1754873/135979557-b67d3c6d-a722-4804-8cc9-4fe462e1ed25.png" style="max-width: 100%;"></a></p>
<p dir="auto">I've tried restarting the Deno LSP via the VS Code Deno extension command, and it doesn't help.</p>
<p dir="auto"><strong>Describe the bug</strong><br>
When the deno extension is enabled, typed imports via <code class="notranslate">/** @type {import("...</code> stop working.</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<ol dir="auto">
<li>Create <code class="notranslate">Bar.js</code>:</li>
</ol>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export class Bar {}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">Bar</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<ol start="2" dir="auto">
<li>Create <code class="notranslate">Foo.js</code>:</li>
</ol>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/** @type {import(&quot;./Bar.js&quot;).Bar} */
const foo = null;"><pre class="notranslate"><span class="pl-c">/** <span class="pl-k">@type</span> {import("./Bar.js").Bar} */</span>
<span class="pl-k">const</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span><span class="pl-kos">;</span></pre></div>
<ol start="3" dir="auto">
<li>Hover over <code class="notranslate">foo</code> and note it's type is set to <code class="notranslate">Bar</code>.</li>
<li>Enable deno with <code class="notranslate">Deno: Initialize Workspace Configuration</code></li>
<li>Hover over <code class="notranslate">foo</code> again.</li>
</ol>
<p dir="auto"><strong>Expected behavior</strong><br>
The type remains set to <code class="notranslate">Bar</code>, rather than <code class="notranslate">any</code>.</p>
<p dir="auto"><strong>Screenshots</strong></p>
<p dir="auto">If applicable, add screenshots to help explain your problem.</p>
<p dir="auto"><strong>Versions</strong></p>
<p dir="auto">vscode: 1.62.3 deno: 1.16.3 extension: 3.9.2</p>