vscode-shader
vscode-shader copied to clipboard
Action needed: update your import of the built-in ripgrep
Hello from the VS Code team 👋
We're doing some housekeeping that involves renaming some of our internal packages. Namely, vscode-ripgrep
will be renamed to @vscode/ripgrep
, which affects its location in VS Code's node_modules
folder. It looks like this extension depends on vscode-ripgrep
in a way that will break when this rename happens.
We suggest either:
- Adding an extra check for the renamed binary path in your extension, or
- Updating your extension to import
vscode-ripgrep
and retrieve the binary path from there. We will alias therequire
statement, so that the renamed package is always resolved correctly, andvscode-ripgrep
exports the binary path. For example:
function getCoreNodeModule(moduleName) {
try {
return require(`${vscode.env.appRoot}/node_modules.asar/${moduleName}`);
} catch (err) {
try {
return require(`${vscode.env.appRoot}/node_modules/${moduleName}`);
} catch (err) {
return undefined;
}
}
}
const { rgPath } = getCoreNodeModule('vscode-ripgrep');
// then child_process.spawn(rgPath, [...
Note that if you're building your extension with Webpack, you will want to use __non_webpack_require__
instead of require
, otherwise webpack will try to (incorrectly) resolve the request by itself.
Hey @connor4312 , I'm trying your suggestion but this doesn't work for me on macOS with VSCode 1.85.0