Skip to content

feat: migrate catalog-related providers to language-service#91

Open
9romise wants to merge 4 commits intomainfrom
catalog
Open

feat: migrate catalog-related providers to language-service#91
9romise wants to merge 4 commits intomainfrom
catalog

Conversation

@9romise
Copy link
Copy Markdown
Member

@9romise 9romise commented Mar 27, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4dd59c5-5654-4e34-8fe4-01f93d894812

📥 Commits

Reviewing files that changed from the base of the PR and between c8c9995 and 9a4c0ff.

📒 Files selected for processing (1)
  • packages/language-service/src/plugins/catalog.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/language-service/src/plugins/catalog.ts

📝 Walkthrough

Walkthrough

The pull request removes catalog-related completion and definition providers from the VS Code extension and migrates their functionality to a new language service plugin. Specifically, it removes the CatalogCompletionItemProvider and CatalogDefinitionProvider classes, along with their registration logic and the PACKAGE_JSON_PATTERN constant, and introduces a new npmx-catalog language service plugin that provides equivalent completion and definition functionality for catalog: dependencies.

Possibly related PRs

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The pull request has no description provided by the author, making it impossible to verify that the description relates to the changeset. Please add a pull request description explaining the changes, rationale, and migration from VS Code extension providers to language-service plugins.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch catalog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

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

🧹 Nitpick comments (1)
packages/language-service/src/plugins/catalog.ts (1)

105-110: Add a guard to check workspaceDocument for defensive consistency.

The context.documents.get() call at line 110 directly uses its return value without checking for undefined. Whilst this approach suggests the API guarantees a non-undefined return given valid inputs, adding a guard would be consistent with the defensive pattern already present throughout the function (checks at lines 82–108). If the document cannot be loaded, the early return prevents unnecessary processing.

Suggested guard
          const workspaceDocument = context.documents.get(sourceScript.id, sourceScript.languageId, sourceScript.snapshot)
+          if (!workspaceDocument)
+            return

          const [targetStart, targetEnd] = targetDependency.specRange

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c036267b-1c18-4fd8-8f60-ec7d6d6799c6

📥 Commits

Reviewing files that changed from the base of the PR and between 7f21590 and c8c9995.

📒 Files selected for processing (10)
  • extensions/vscode/src/index.ts
  • extensions/vscode/src/providers/completion-item/catalog.ts
  • extensions/vscode/src/providers/completion-item/index.ts
  • extensions/vscode/src/providers/definition/catalog.ts
  • extensions/vscode/src/providers/definition/index.ts
  • extensions/vscode/src/utils/constants.ts
  • packages/language-core/package.json
  • packages/language-server/package.json
  • packages/language-service/src/index.ts
  • packages/language-service/src/plugins/catalog.ts
💤 Files with no reviewable changes (5)
  • extensions/vscode/src/index.ts
  • extensions/vscode/src/providers/definition/index.ts
  • extensions/vscode/src/utils/constants.ts
  • extensions/vscode/src/providers/completion-item/catalog.ts
  • extensions/vscode/src/providers/definition/catalog.ts

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.

1 participant