Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Dec 6, 2023

Conversation

atusy
Copy link
Contributor

@atusy atusy commented Dec 5, 2023

  • 👍 allow specifying deno cache directory by g:denops#deno_dir
  • 📝 document g:denops#deno_dir

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

  • New Features

    • Introduced a new configuration option denops#deno_dir to customize the Deno cache directory.
  • Documentation

    • Updated documentation to include the new g:denops#deno_dir variable and its usage.
  • Bug Fixes

    • Ensured that the DENO_DIR environment variable is set correctly based on user configuration.

Copy link

coderabbitai bot commented Dec 5, 2023

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.
  • 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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6c7ebef and 74abcb8.
Files selected for processing (3)
  • autoload/denops.vim (1 hunks)
  • autoload/denops/_internal/server/proc.vim (1 hunks)
  • doc/denops.txt (1 hunks)
Additional comments: 5
autoload/denops.vim (2)
  • 22-22: The introduction of the denops#deno_dir configuration is consistent with the PR objectives and the summary provided. It allows users to specify a custom cache directory for Deno, which can improve startup performance for Denops plugins.

  • 19-25: The provided hunk only shows the addition of the denops#deno_dir configuration. The summary mentions modifications to the s:start function and updates to the documentation, which are not present in the provided file. Ensure that these changes are also reviewed for completeness.

autoload/denops/_internal/server/proc.vim (2)
  • 71-87: The implementation of the new feature to specify a custom cache directory for Deno using the g:denops#deno_dir variable is correctly handled in the s:start function. The environment variable DENO_DIR is conditionally set based on the value of g:denops#deno_dir, and the custom environment is passed to the denops#_internal#job#start function. This change should enable the desired functionality without affecting existing behavior when g:denops#deno_dir is not set by the user.

  • 71-87: Please ensure that the documentation (doc/denops.txt) has been updated to include information about the new g:denops#deno_dir variable and its usage. Additionally, verify that there are no other places in the code where the DENO_DIR environment variable should be set or modified based on the new global variable.

doc/denops.txt (1)
  • 84-88: The documentation for g:denops#deno_dir is clear and correctly specifies the default value and behavior. This aligns with the PR's objective to allow users to specify a custom cache directory for Deno.

Copy link

codecov bot commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@lambdalisue lambdalisue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, what is advantage compared to adding let $DENO_DIR = ... on .vimrc?

@atusy
Copy link
Contributor Author

atusy commented Dec 6, 2023

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

Copy link
Member

@lambdalisue lambdalisue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. LGTM

@lambdalisue lambdalisue merged commit c50865d into vim-denops:main Dec 6, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants