fix ripgrep paths

desktopmerge
bunsenstraat 1 year ago
parent 8e9130ce5a
commit 686bca37b9
  1. 4
      .prettierrc.json
  2. 9
      apps/remix-ide/src/app/plugins/electron/fsPlugin.ts
  3. 5
      apps/remixdesktop/package.json
  4. 6
      apps/remixdesktop/src/plugins/ripgrepPlugin.ts
  5. 1365
      apps/remixdesktop/yarn.lock
  6. 10
      apps/walletconnect/src/app/app.tsx
  7. 1
      libs/remix-ui/search/src/lib/components/results/SearchHelper.ts

@ -1,7 +1,7 @@
{
"tabWidth": 2,
"useTabs": false,
"printWidth": 180,
"semi": false,
"singleQuote": true
"singleQuote": true,
"bracketSpacing": false
}

@ -16,7 +16,7 @@ export class fsPlugin extends ElectronPlugin {
name: 'fs',
description: 'fs',
})
this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'lstat', 'exists', 'setWorkingDir', 'getRecentFolders', 'glob', 'openWindow']
this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'lstat', 'exists', 'setWorkingDir', 'getRecentFolders', 'openWindow']
// List of commands all filesystems are expected to provide. `rm` is not
// included since it may not exist and must be handled as a special case
@ -49,11 +49,6 @@ export class fsPlugin extends ElectronPlugin {
const files = await this.call('fs', 'readdir', path)
return files
},
glob: async (path: string, pattern: string, options?: any) => {
path = fixPath(path)
const files = await this.call('fs', 'glob', path, pattern, options)
return files
},
unlink: async (path: string) => {
path = fixPath(path)
return await this.call('fs', 'unlink', path)
@ -131,7 +126,7 @@ export class fsPlugin extends ElectronPlugin {
async onActivation() {
(window as any).remixFileSystem = this.fs;
(window as any).remixFileSystem = this.fs
this.on('fs', 'workingDirChanged', async (path: string) => {

@ -36,15 +36,18 @@
"typescript": "^5.1.3"
},
"dependencies": {
"@remix-project/remix-ws-templates": "^1.0.27",
"@remixproject/engine": "0.3.37",
"@remixproject/engine-electron": "0.3.37",
"@remixproject/plugin": "0.3.37",
"@remixproject/plugin-electron": "0.3.37",
"@vscode/ripgrep": "^1.15.6",
"add": "^2.0.6",
"byline": "^5.0.0",
"chokidar": "^3.5.3",
"isomorphic-git": "^1.24.2",
"node-pty": "^0.10.1"
"node-pty": "^0.10.1",
"yarn": "^1.22.19"
},
"build": {
"productName": "Remix IDE",

@ -47,6 +47,7 @@ export class RipgrepPluginClient extends ElectronBasePluginClient {
async glob(path: string, pattern: string, options?: any) {
path = convertPathToPosix(this.fixPath(path))
console.log('path', path, this.workingDir)
return new Promise((c, e) => {
@ -56,7 +57,8 @@ export class RipgrepPluginClient extends ElectronBasePluginClient {
const stream = byline(rg.stdout.setEncoding('utf8'))
stream.on('data', (rgresult: string) => {
let pathWithoutWorkingDir = rgresult.replace(this.workingDir, '')
console.log('rgresult', rgresult)
let pathWithoutWorkingDir = rgresult.replace(convertPathToPosix(this.workingDir), '')
if (pathWithoutWorkingDir.endsWith('/')) {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(0, -1)
}
@ -67,7 +69,7 @@ export class RipgrepPluginClient extends ElectronBasePluginClient {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(1)
}
resultrg.push({
path: pathWithoutWorkingDir,
path:convertPathToPosix(pathWithoutWorkingDir),
isDirectory: false,
})
})

File diff suppressed because it is too large Load Diff

@ -1,9 +1,9 @@
import React, {useEffect, useState} from 'react'
import React, { useEffect, useState } from 'react'
import '../css/app.css'
import '@fortawesome/fontawesome-free/css/all.css'
import type {EthereumClient} from '@web3modal/ethereum'
import {WalletConnectRemixClient} from '../services/WalletConnectRemixClient'
import {WalletConnectUI} from './walletConnectUI'
import type { EthereumClient } from '@web3modal/ethereum'
import { WalletConnectRemixClient } from '../services/WalletConnectRemixClient'
import { WalletConnectUI } from './walletConnectUI'
const remix = new WalletConnectRemixClient()
@ -13,7 +13,7 @@ function App() {
const [theme, setTheme] = useState<string>('dark')
useEffect(() => {
;(async () => {
; (async () => {
await remix.initClient()
remix.internalEvents.on('themeChanged', (theme: string) => {
setTheme(theme)

@ -10,6 +10,7 @@ export const getDirectory = async (dir: string, plugin: any) => {
const files = await plugin.call('ripgrep', 'glob', dir, '**/*')
// only get path property of files
console.log(files)
result = files.map(x => x.path)
} else {

Loading…
Cancel
Save