Skip to content
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

Breaking Change regarding the usage of vscode-ripgrep #27

Closed
alexdima opened this issue Feb 19, 2018 · 1 comment
Closed

Breaking Change regarding the usage of vscode-ripgrep #27

alexdima opened this issue Feb 19, 2018 · 1 comment

Comments

@alexdima
Copy link

Hi,

I'm working on VSCode and I am trying to enable the usage of ASAR for VSCode. This can improve the startup time of VSCode by up to 5%. We are at a point where we are pursuing even such small gains...

I have found that your extension makes an assumption about the disk layout of VSCode's node_modules:

satokaz.vscode-memo-life-for-you/out/src/extension.js:396
  const rgPath = path.normalize(path.join(vscode.env.appRoot, "node_modules", "vscode-ripgrep", "bin", "rg"));
satokaz.vscode-memo-life-for-you/out/src/extension.js:733
  grepcmd: (process.platform == "win32") ? "grep -nH ${PATTERN} ${FILES}" : path.normalize(path.join(vscode.env.appRoot, "node_modules", "vscode-ripgrep", "bin", "rg").replace(/\s/g, '\\ ')) + ' -n --no-heading -S ${PATTERN} ${FILES}',
satokaz.vscode-memo-life-for-you/out/src/extension.js:752
  return path.normalize(path.join(vscode.env.appRoot, "node_modules", "vscode-ripgrep", "bin", "rg"));

To make your extension entirely compatible with a distribution of VSCode that uses ASAR, and to make your extension work with both VSCode stable and VSCode insiders, you will need to try to look for rg in two different paths... Something like the following:

const possiblePath1 = path.join(vscode.env.appRoot, "node_modules", "vscode-ripgrep", "bin", "rg")
const possiblePath2 =path.join(vscode.env.appRoot, "node_modules.asar.unpacked", "vscode-ripgrep", "bin", "rg") 

I plan to release the changes to Insiders this week, such that the Insiders build on Friday, 23.02.2018, will contain the ASAR packing of node modules. In the meantime, I have created custom builds that include this change if you wish to test your extension against a VSCode version which contains these changes:

@satokaz
Copy link
Owner

satokaz commented Mar 4, 2018

@alexandrudima

Thank you for letting me knowing that ASAR will be adopted.

Fixed in #28

@satokaz satokaz closed this as completed Mar 4, 2018
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

No branches or pull requests

2 participants