Closed oscar6echo closed 4 months ago
Do you recommend against using a local .cache folder and stick to a single location set by DENO_DIR ?
I can answer my own question: DO NOT SET YOU CACHE TO A FOLDER INSIDE YOUR NAMESPACE if you use VS Code with deno extention.
There seems to be a sort of catch22 situation - which could be potentially be escaped by a negative use of "deno.enablePaths" but (1) I don't think this is possible (2) anyway this would be uselessly cumbersome (just set the cache folder outside view).
It works fine with any other location, default or custom.
Cf. this issue comment for a specific example and context.
If not, would it make sense to make CLI deno cache read cache config from a potential ./vscode/settings.json ?
I can share my observations:
BEWARE: there are 2 caches:
.vscode/settings.json
DENO_DIR
by default in ~/.cache/deno
To refresh the first cache do:
To refresh the second cache do:
deno cache --reload main.ts
If you do deno check main.ts
the CLI uses the DENO_DIR
cache.
If you use vscode code analysis the settings.json
/"deno.cache" folder is used.
This can be a bit confusing but makes some sense as the 2 pieces of software are independent.
If the CLI and the language server logs were explicit about where the cache used is, this would help users.
Conclusion: From there it seems a good practice to use always the same cache - some folder with enough space.
Closing as no more 'perplexing' behavior.
I have a folder with a deno project with a
.vscode/settings.json
file below and amaint.ts
file, opened in VS Code installed with the deno vs_code extension latest version.In my setup
DENO_DIR
is not set so defaults to~/.cache/deno
.When I do
deno cache -c deno.json --reload main.ts
, local folder.cache
is not impacted.In order to hard clear the cache I must do
rm -rf ~/.cache
.(And then reload the vs code window - but this is a separate topic).
Do you confirm the behavior ?
Is it because
deno cache
is driven byDENO_DIR
only ?Questions:
.cache
folder and stick to a single location set byDENO_DIR
?deno cache
read cache config from a potential./vscode/settings.json
?I ran into this puzzling (at first sight) behavior in this honojs issue.