vim-denops / denops.vim

🐜 An ecosystem of Vim/Neovim which allows developers to write cross-platform plugins in Deno
https://vim-denops.github.io/denops-documentation/
MIT License
685 stars 36 forks source link

Add g:denops#deno_dir to set deno cache directory #295

Closed atusy closed 11 months ago

atusy commented 11 months ago

In the current implementation, denops shares the deno cache directory with system. This may lead slow startup of denops plugins when cache invalidates.

The typical invalidation occurs when the versions of deno are different among system and denops.

To improve the experience, I want to isolate deno version and cache directory for denops like below.

let g:denops#deno = /path/to/deno/bin/deno
let g:denops#deno_dir = /path/to/deno/cache

Summary by CodeRabbit

coderabbitai[bot] commented 11 months ago

Walkthrough

The changes involve the introduction of a new configuration option g:denops#deno_dir across several Vim script files. This option allows users to specify a custom directory for Deno's cache, enhancing flexibility and control over the Deno environment within the Denops plugin. The update includes setting the environment variable DENO_DIR based on this configuration and documenting the new option for users.

Changes

File Path Change Summary
autoload/denops.vim Added denops#deno_dir configuration setting with default v:null.
autoload/denops/.../proc.vim Initialized l:env to hold environment variables; conditionally set DENO_DIR based on g:denops#deno_dir.
doc/denops.txt Documented new g:denops#deno_dir variable and its default value.

🐇✨ In the land of code and vim,
A rabbit hopped, setting DENO_DIR on a whim.
With a flick of its ear, cache paths align,
"Now Deno can run with a home that's all mine!"
🌟📂


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`
codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6c7ebef) 92.59% compared to head (74abcb8) 92.59%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #295 +/- ## ======================================= Coverage 92.59% 92.59% ======================================= Files 3 3 Lines 81 81 Branches 6 6 ======================================= Hits 75 75 Misses 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

atusy commented 11 months ago

let $DENO_DIR = ... affects Terminal-mode, so deno process outside denops might be affected. This PR adds a complete isolation.