Skip to content

fix(lsp): respect minimumDependencyAge in completions and resolution - #37028

Open
ump45nose wants to merge 1 commit into
denoland:mainfrom
ump45nose:cursor/fix-lsp-minimum-dependency-age-31009-bd8c
Open

ump45nose wants to merge 1 commit into
denoland:mainfrom
ump45nose:cursor/fix-lsp-minimum-dependency-age-31009-bd8c

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

Summary

The CLI honors minimumDependencyAge (minutes, ISO 8601 duration, RFC3339 date, false/0, and the object form with exclude) when resolving npm and JSR versions. The language server did not: it built its npm/jsr search APIs and managed npm version resolver with empty newest-dependency-date options, so import-specifier completions and LSP-side matching of the newest version could offer versions newer than the configured cutoff.

This change shares the CLI helpers that turn a MinimumDependencyAgeConfig into npm and JSR newest-dependency-date options, including exclude exact names and wildcard prefixes and the .npmrc min-release-age / 24-hour fallbacks when no age is set. Those options are used for import completions, managed npm resolution, and JSR cache resolution. The process-global search APIs are rebuilt after the config tree refreshes, so editing deno.json updates completions.

Closes #31009

Tests

  • cargo test -p integration_tests --test integration lsp_completions_minimum_dependency_age — passed. Versions newer than 2025-03-01 are omitted for jsr:@denotest/add and npm:@denotest/min-release-age-latest. exclude and minimumDependencyAge: false offer them again after a deno.json reload.
  • cargo test -p integration_tests --test integration lsp_completions — 23 passed, including lsp_completions_npm, lsp_completions_deno_json_imports, lsp_completions_npm_package_exports, and lsp_completions_registry.
  • cargo test -p deno_resolver -p deno --lib minimum_dependency_age — 5 passed.

./x is unavailable here (no deno binary). rustfmt with the repo config (--check) passed on the changed files. Clippy with the ./x lint deny set reported only pre-existing #[allow]s without a reason in cli/lsp/trace.rs. cargo clippy -p integration_tests --tests passed once that pre-existing lint was allowed so deno_maybe_sync could compile.

AI assistance

This change was written with an AI coding agent (Cursor).

Import-specifier completions and LSP npm/jsr resolution used empty
newest-dependency-date options, so they could offer versions newer than
the workspace minimumDependencyAge. Use the same age, exclude, and
fallback resolution as the CLI, and rebuild the search APIs when config
reloads.

Co-authored-by: ump45nose <ump45nose@users.noreply.github.com>
@CLAassistant

CLAassistant commented Oct 17, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ump45nose
ump45nose force-pushed the cursor/fix-lsp-minimum-dependency-age-31009-bd8c branch from ae7f62c to a26bb5b Compare November 6, 2026 13:33

This branch has not been deployed

No deployments
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.

Support minimumDependencyAge in the lsp

2 participants