How to use the vscode-ripgrep.rgPath function in vscode-ripgrep

To help you get started, we’ve selected a few vscode-ripgrep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atom / atom / src / ripgrep-directory-searcher.js View on Github external
searchInDirectory(directory, regexp, options, numPathsFound) {
    // Delay the require of vscode-ripgrep to not mess with the snapshot creation.
    if (!this.rgPath) {
      this.rgPath = require('vscode-ripgrep').rgPath.replace(
        /\bapp\.asar\b/,
        'app.asar.unpacked'
      );
    }

    const directoryPath = directory.getPath();
    const regexpStr = this.prepareRegexp(regexp.source);

    const args = ['--hidden', '--json', '--regexp', regexpStr];
    if (options.leadingContextLineCount) {
      args.push('--before-context', options.leadingContextLineCount);
    }
    if (options.trailingContextLineCount) {
      args.push('--after-context', options.trailingContextLineCount);
    }
    if (regexp.ignoreCase) {
github cdr / code-server / scripts / nbin-shim.js View on Github external
// This file is prepended to loader/entry code (like our main.js or VS Code's
// bootstrap-fork.js). {{ROOT_PATH}} is replaced during the build process.
if (!global.NBIN_LOADED) {
	try {
		const nbin = require("nbin");
		nbin.shimNativeFs("{{ROOT_PATH}}");
		global.NBIN_LOADED = true;
		const path = require("path");
		const rg = require("vscode-ripgrep");
		rg.binaryRgPath = rg.rgPath;
		rg.rgPath = path.join(
			require("os").tmpdir(),
			`code-server/${path.basename(rg.binaryRgPath)}`
		);
	} catch (error) { /*  Not in the binary. */ }
}
github malkomalko / searchy / provider.js View on Github external
const vscode = require('vscode')
const querystring = require('querystring')
const rgPath = require('vscode-ripgrep').rgPath
const {
  execSync
} = require('child_process')

const rootPath = vscode.workspace.rootPath

const execOpts = {
  cwd: rootPath,
  maxBuffer: 1024 * 1000
}

class SearchyProvider {
  constructor() {
    this.links = []
    this._subscriptions = vscode.workspace.onDidCloseTextDocument(doc => {
      this.links[doc.uri.toString()] = []

vscode-ripgrep

A module for using ripgrep in a Node project

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages