<p dir="auto">Currently, downloaded dependencies seem to be stored with the scheme <code class="notranslate">$DENO_DIR/deps/$PROTOCOL/$ORIGIN/$CHECKSUM</code>. I use neovim and <a href="https://github.com/fannheyward/coc-deno/issues">coc-deno</a>, and when I jump to definition, I’m sent to these cached files. My current problem is that I don’t get syntax highlighting because for my editor, this works based off file extension. I could probably fix this problem myself with editor configuration but it would be nice if DENO added file extensions so that the cached path was something like <code class="notranslate">$DENO_DIR/deps/$PROTOCOL/$ORIGIN/$CHECKSUM.$EXTENSION</code>.</p>
<p dir="auto">The big thing I’m thinking about is what the file extension should be. If Deno only intends to store javascript/typescript files in the cache, then maybe <code class="notranslate">.jsx?</code> or <code class="notranslate">.tsx?</code> would suffice? Or maybe Deno could use an algorithm like: check if the URL path has an extension and use that, otherwise, check if the response has a Content-Type header and use the related canonical file extension, otherwise don’t use a file extension.</p>
<p dir="auto">The current cache filenames and layout is unfortunate.</p>
<ol dir="auto">
<li>It breaks code navigation. Code for the Deno runtime can only be written in editors that implement the workarounds to locate the files.</li>
<li>The workarounds required are non-trivial for editors like vim.</li>
<li>Files are extension-less which breaks a lot of editors (no syntax highlighting, etc) such as VSCode.</li>
<li>Editor tab bars are rendered useless. Open these files for viewing in an editor and you have tabs with names like "b7953a2fe90b56defc2c4cbba3f7f8b963cf2a38e587d20c3ffcd11e95f4fb64"</li>
</ol>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="573271390" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/4183" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/4183/hovercard" href="https://github.com/denoland/deno/issues/4183">#4183</a></p>
<p dir="auto">As I suggested in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="569113567" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/4069" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/4069/hovercard?comment_id=592305083&amp;comment_type=issue_comment" href="https://github.com/denoland/deno/issues/4069#issuecomment-592305083">#4069 (comment)</a>, the file names need to be more descriptive.</p>
<ol dir="auto">
<li>All cached files should have an extension. I would suggest TSX for <a href="https://en.wikipedia.org/wiki/MPEG_transport_stream" rel="nofollow">compatibility</a>.</li>
<li>The hash should be prefixed with a descriptive name.</li>
</ol>
<p dir="auto">The proposed filename format is:</p>
<p dir="auto">"[stripped-file-basename]_[hash].[appended-extension-from-content-type]"</p>
<p dir="auto">Example</p>
<blockquote>
<p dir="auto">yaml_b7953a2fe90b56defc2c4cbba3f7f8b963cf2a38e587d20c3ffcd11e95f4fb64.tsx</p>
</blockquote>