Conversation
📝 WalkthroughWalkthroughThis pull request implements a workspace state management system for the language server's dependency resolution capabilities. It introduces a Possibly related PRs
🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/language-server/src/workspace.ts (2)
35-44: Function signature doesn't match interface contract.The
WorkspaceAdapterinterface expectsdetectPackageManager(rootPath: string), but this implementation omits therootPathparameter entirely. Although the closure capturesfolderUriand the behaviour is correct, the missing parameter may cause confusion and could break if the interface evolves.♻️ Suggested fix to match interface signature
- async detectPackageManager(): Promise<'npm' | 'pnpm' | 'yarn'> { + async detectPackageManager(_rootPath: string): Promise<'npm' | 'pnpm' | 'yarn'> {
99-107: Consider error handling forWorkspaceContext.createfailures.If
WorkspaceContext.createthrows (e.g., due to filesystem errors or malformed manifest files), the error will propagate uncaught. Since this is a cached function, a single failure could leave the cache in an inconsistent state or cause repeated failures.🛡️ Suggested defensive approach
async (folderUri) => { this.#connection.console.info(`[workspace-context] built ${folderUri.path}`) this.#cachedFolderPaths.add(folderUri.path) - return await WorkspaceContext.create( - folderUri.path, - createLanguageServerAdapter(folderUri, this.#connection), - ) + try { + return await WorkspaceContext.create( + folderUri.path, + createLanguageServerAdapter(folderUri, this.#connection), + ) + } + catch (error) { + this.#connection.console.error(`[workspace-context] failed to create context for ${folderUri.path}: ${error}`) + return undefined + } },
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 06ef8ea8-b6b1-41a6-8d6c-6518034d991a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (15)
extensions/vscode/src/client.tspackages/language-server/package.jsonpackages/language-server/src/server.tspackages/language-server/src/workspace.tspackages/language-server/tsconfig.jsonpackages/language-server/tsdown.config.tspackages/language-service/package.jsonpackages/language-service/src/config.tspackages/language-service/src/index.tspackages/language-service/src/types.tspackages/language-service/tsconfig.jsonpackages/language-service/tsdown.config.tspnpm-workspace.yamlshared/protocol.tsshared/types.ts
💤 Files with no reviewable changes (1)
- shared/types.ts
No description provided.