-
Notifications
You must be signed in to change notification settings - Fork 6
fix: Package the SQL language server. #240
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
Conversation
📝 WalkthroughWalkthroughA new build step bundles the SQL language server into a single CommonJS file and copies its runtime dependencies into a dedicated Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
===========================
===========================
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
build/esbuild/build.ts(2 hunks)src/kernels/deepnote/deepnoteLspClientManager.node.ts(4 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.node.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Platform Implementation - Desktop: Use
.node.tsfiles for full file system access and Python environments
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Usel10n.t()for all user-facing strings in TypeScript files
Use typed error classes fromsrc/platform/errors/instead of generic errors
UseILoggerservice instead of console.log for logging
Preserve error details in error messages while scrubbing personally identifiable information (PII)
Prefer async/await over promise chains
Handle cancellation with CancellationTokenOrder method, fields and properties first by accessibility (public/private/protected) and then by alphabetical order
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.tsbuild/esbuild/build.ts
src/kernels/**/*.ts
📄 CodeRabbit inference engine (.github/instructions/kernel.instructions.md)
src/kernels/**/*.ts: RespectCancellationTokenin all async operations across kernel execution, session communication, and finder operations
Implement proper error handling in files using custom error types fromerrors/directory (KernelDeadError,KernelConnectionTimeoutError,KernelInterruptTimeoutError,JupyterInvalidKernelError,KernelDependencyError)
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.ts
**/*.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
**/*.ts: ALWAYS check the 'Core - Build' task output for TypeScript compilation errors before running any script or declaring work complete
ALWAYS runnpm run format-fixbefore committing changes to ensure proper code formatting
FIX all TypeScript compilation errors before moving forward with development
Usenpm run format-fixto auto-fix TypeScript formatting issues before committing
Usenpm run lintto check for linter issues in TypeScript files and attempt to fix before committing
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.tsbuild/esbuild/build.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
src/**/*.{ts,tsx}: Don't add the Microsoft copyright header to new files
UseUri.joinPath()for constructing file paths instead of string concatenation with/to ensure platform-correct path separators
Follow established patterns when importing new packages, using helper imports rather than direct imports (e.g., useimport { generateUuid } from '../platform/common/uuid'instead of importing uuid directly)
Add blank lines after const groups and before return statements for readability
Separate third-party and local file imports
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.ts
🔇 Additional comments (6)
src/kernels/deepnote/deepnoteLspClientManager.node.ts (2)
384-386: NODE_PATH setup looks correct.Conditional injection handles the undefined case well.
388-398: Server options correctly propagate NODE_PATH.Both run and debug transports receive the extended environment.
build/esbuild/build.ts (4)
486-487: Correct integration into build pipeline.Desktop-only build step follows existing patterns.
557-579: Bundle configuration looks reasonable.Externalized packages match what's installed in sql-lsp-modules. Consider enabling sourcemap for debugging production issues.
590-600: The original review comment is incorrect. These hardcoded dependency versions are intentional and serve a specific purpose: they define an isolated dependency tree for the sql-language-server artifact (sql-lsp-modules), which is separate from the main extension. These packages do not appear in the main package.json because they are only needed during the build process for this secondary component. Reading versions from the main package.json would not be appropriate here, as it would create the wrong dependency tree. The current implementation is correct.Likely an incorrect or invalid review comment.
609-609: This review comment is incorrect. sqlite3 is not a dependency in this project.The code installs sql-lsp dependencies in an isolated directory with
--ignore-scripts. While sqlite3 packages do require postinstall scripts for native bindings, sqlite3 is not present in this project's dependency tree. The--ignore-scriptsflag may affect sql-lsp's own dependencies, but not sqlite3.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
build/esbuild/build.ts(2 hunks)src/kernels/deepnote/deepnoteLspClientManager.node.ts(5 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Usel10n.t()for all user-facing strings in TypeScript files
Use typed error classes fromsrc/platform/errors/instead of generic errors
UseILoggerservice instead of console.log for logging
Preserve error details in error messages while scrubbing personally identifiable information (PII)
Prefer async/await over promise chains
Handle cancellation with CancellationTokenOrder method, fields and properties first by accessibility (public/private/protected) and then by alphabetical order
Files:
build/esbuild/build.tssrc/kernels/deepnote/deepnoteLspClientManager.node.ts
**/*.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
**/*.ts: ALWAYS check the 'Core - Build' task output for TypeScript compilation errors before running any script or declaring work complete
ALWAYS runnpm run format-fixbefore committing changes to ensure proper code formatting
FIX all TypeScript compilation errors before moving forward with development
Usenpm run format-fixto auto-fix TypeScript formatting issues before committing
Usenpm run lintto check for linter issues in TypeScript files and attempt to fix before committing
Files:
build/esbuild/build.tssrc/kernels/deepnote/deepnoteLspClientManager.node.ts
**/*.node.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Platform Implementation - Desktop: Use
.node.tsfiles for full file system access and Python environments
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.ts
src/kernels/**/*.ts
📄 CodeRabbit inference engine (.github/instructions/kernel.instructions.md)
src/kernels/**/*.ts: RespectCancellationTokenin all async operations across kernel execution, session communication, and finder operations
Implement proper error handling in files using custom error types fromerrors/directory (KernelDeadError,KernelConnectionTimeoutError,KernelInterruptTimeoutError,JupyterInvalidKernelError,KernelDependencyError)
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
src/**/*.{ts,tsx}: Don't add the Microsoft copyright header to new files
UseUri.joinPath()for constructing file paths instead of string concatenation with/to ensure platform-correct path separators
Follow established patterns when importing new packages, using helper imports rather than direct imports (e.g., useimport { generateUuid } from '../platform/common/uuid'instead of importing uuid directly)
Add blank lines after const groups and before return statements for readability
Separate third-party and local file imports
Files:
src/kernels/deepnote/deepnoteLspClientManager.node.ts
🔇 Additional comments (4)
build/esbuild/build.ts (1)
480-488: Wiring SQL LSP build step into desktop pipeline looks consistent.Adding
buildSqlLanguageServer()alongside the other desktop-only copy/build tasks fits the existing pattern (Promise aggregation viabuilders.push(...)andPromise.all(builders)), and the gating onbundleConfig !== 'web'keeps it out of pure web builds.src/kernels/deepnote/deepnoteLspClientManager.node.ts (3)
385-399: NODE_PATH wiring correctly targets bundled SQL LSP dependencies.Deriving
nodePathEnvfromgetSqlLspModulesPath()and merging it intorun/debugoptions.envensures the SQL LSP process can resolve its runtime deps fromdist/sql-lsp-modules/node_modulesin packaged builds, while gracefully doing nothing in dev when that directory hasn’t been created.
544-569: Comment and fallback path now match the.cjsbuild artifact.The comment now correctly refers to
dist/sqlLanguageServer.cjs, and the fallback path matches the build output. Combined with the initialrequire.resolveattempt, this keeps both dev (node_modules/@deepnote/sql-language-server/...) and packaged (dist/sqlLanguageServer.cjs) scenarios covered.
1-1: Helper forsql-lsp-modulespath + fs import is aligned with runtime layout.Importing
fsand addinggetSqlLspModulesPath()that:
- Resolves the extension root via
vscode.extensions.getExtension(...)with__dirnamefallback, and- Returns
undefinedwhendist/sql-lsp-modules/node_modulesis missingnicely matches the new build step and fixes the earlier “always returns string” type mismatch. The existence check prevents setting a broken NODE_PATH in dev or misconfigured builds.
Also applies to: 571-590
Includes the SQL LSP in the built package.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.