rdesktop2
bunsenstraat 1 year ago
parent 962395926e
commit b7f59b65ac
  1. 4
      apps/remix-ide/src/app/files/fileManager.ts
  2. 2
      apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts
  3. 9
      apps/remixdesktop/src/plugins/fsPlugin.ts
  4. 1
      libs/remix-ui/search/src/lib/components/results/ResultItem.tsx
  5. 2
      libs/remix-ui/search/src/lib/context/context.tsx

@ -858,6 +858,10 @@ class FileManager extends Plugin {
} }
currentWorkspace() { currentWorkspace() {
if(isElectron()){
return ''
}
if (this.mode !== 'localhost') { if (this.mode !== 'localhost') {
const file = this.currentFile() || '' const file = this.currentFile() || ''
const provider = this.fileProviderOf(file) const provider = this.fileProviderOf(file)

@ -42,7 +42,6 @@ export default class CodeParserImports {
if (isElectron()) { if (isElectron()) {
const files = await this.plugin.call('fs', 'glob', '/', '**/*.sol') const files = await this.plugin.call('fs', 'glob', '/', '**/*.sol')
console.log('GLOB', '/', files)
// only get path property of files // only get path property of files
this.data.files = files.map(x => x.path) this.data.files = files.map(x => x.path)
@ -53,7 +52,6 @@ export default class CodeParserImports {
} }
console.log('setFileTree', this.data.files)
} }
getDirectory = async (dir: string) => { getDirectory = async (dir: string) => {

@ -126,11 +126,12 @@ class FSPluginClient extends ElectronBasePluginClient {
async glob(path: string, pattern: string, options?: GlobOptions): Promise<string[] | Path[]> { async glob(path: string, pattern: string, options?: GlobOptions): Promise<string[] | Path[]> {
path = this.fixPath(path) path = convertPathToPosix(this.fixPath(path))
const files = await glob(path + pattern, { const files = await glob(path + pattern, {
withFileTypes: true, withFileTypes: true,
...options ...options
}) })
const result: any[] = [] const result: any[] = []
for (const file of files) { for (const file of files) {
@ -141,6 +142,9 @@ class FSPluginClient extends ElectronBasePluginClient {
if (pathWithoutWorkingDir.startsWith('/')) { if (pathWithoutWorkingDir.startsWith('/')) {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(1) pathWithoutWorkingDir = pathWithoutWorkingDir.slice(1)
} }
if(pathWithoutWorkingDir.startsWith('\\')) {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(1)
}
result.push({ result.push({
path: pathWithoutWorkingDir + (file as Path).name, path: pathWithoutWorkingDir + (file as Path).name,
isDirectory: (file as Path).isDirectory(), isDirectory: (file as Path).isDirectory(),
@ -225,11 +229,11 @@ class FSPluginClient extends ElectronBasePluginClient {
ignorePermissionErrors: true, ignoreInitial: true, ignorePermissionErrors: true, ignoreInitial: true,
ignored: [ ignored: [
'**/node_modules/**', '**/node_modules/**',
'**/.git/index.lock', // this file is created and unlinked all the time when git is running on Windows
] ]
}).on('all', async (eventName, path, stats) => { }).on('all', async (eventName, path, stats) => {
let pathWithoutPrefix = path.replace(this.workingDir, '') let pathWithoutPrefix = path.replace(this.workingDir, '')
pathWithoutPrefix = convertPathToPosix(pathWithoutPrefix) pathWithoutPrefix = convertPathToPosix(pathWithoutPrefix)
if (pathWithoutPrefix.startsWith('/')) pathWithoutPrefix = pathWithoutPrefix.slice(1) if (pathWithoutPrefix.startsWith('/')) pathWithoutPrefix = pathWithoutPrefix.slice(1)
@ -242,7 +246,6 @@ class FSPluginClient extends ElectronBasePluginClient {
if (currentContent !== newContent) { if (currentContent !== newContent) {
try { try {
this.emit('change', eventName, pathWithoutPrefix) this.emit('change', eventName, pathWithoutPrefix)
} catch (e) { } catch (e) {
console.log('error emitting change', e) console.log('error emitting change', e)

@ -29,7 +29,6 @@ export const ResultItem = (props: ResultItemProps) => {
useEffect(() => { useEffect(() => {
if (props.file.forceReload) { if (props.file.forceReload) {
console.log('force reload')
clearTimeout(reloadTimeOut.current) clearTimeout(reloadTimeOut.current)
clearTimeout(loadTimeout.current) clearTimeout(loadTimeout.current)
subscribed.current = true subscribed.current = true

@ -203,7 +203,6 @@ export const SearchProvider = ({
text, text,
createRegExFromFind() createRegExFromFind()
) )
console.log('RESULT', result)
clearTimeout(clearSearchingTimeout.current) clearTimeout(clearSearchingTimeout.current)
clearSearchingTimeout.current = setTimeout(() => value.setSearching(null), 500) clearSearchingTimeout.current = setTimeout(() => value.setSearching(null), 500)
return result return result
@ -423,7 +422,6 @@ export const SearchProvider = ({
}, [state.count]) }, [state.count])
useEffect(() => { useEffect(() => {
console.log('STATE CHANGED', files, state.find)
if (state.find) { if (state.find) {
(async () => { (async () => {
try { try {

Loading…
Cancel
Save