Fix @vscode/chat-lib install script and package#2134
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issues with the @vscode/chat-lib package's installation process after inline completions were added. The changes ensure the package can be properly installed and configured in different npm environments.
Key Changes:
- Modified postinstall script to dynamically resolve the
@vscode/tree-sitter-wasmpackage location instead of assuming a fixed path - Moved
applicationinsightsfrom devDependencies to dependencies to ensure it's available at runtime - Added the
scriptdirectory to the package files list so the postinstall script is included in published packages
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| chat-lib/script/postinstall.ts | Added treeSitterWasmDir() function to dynamically resolve tree-sitter-wasm location and updated asset copying to use resolved paths |
| chat-lib/package.json | Moved applicationinsights to dependencies, added script directory to package files |
Files not reviewed (1)
- chat-lib/package-lock.json: Language not supported
|
|
||
| function treeSitterWasmDir(): string { | ||
| const modulePath = path.dirname(require.resolve('@vscode/tree-sitter-wasm')); | ||
| return path.relative(REPO_ROOT, modulePath); |
There was a problem hiding this comment.
The function assumes WASM files are in the same directory as the resolved module entry point, but require.resolve() resolves to the package's main entry file (typically index.js). The WASM files are in a wasm/ subdirectory. The path should be path.join(modulePath, 'wasm') to correctly locate the WASM files.
Suggested change
| return path.relative(REPO_ROOT, modulePath); | |
| return path.relative(REPO_ROOT, path.join(modulePath, 'wasm')); |
chrmarti
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a few problems with the @vscode/chat-lib package after the addition of inline completions:
@vscode/tree-sitter-wasmpackage