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() {
if(isElectron()){
return ''
}
if (this.mode !== 'localhost') {
const file = this.currentFile() || ''
const provider = this.fileProviderOf(file)

@ -42,7 +42,6 @@ export default class CodeParserImports {
if (isElectron()) {
const files = await this.plugin.call('fs', 'glob', '/', '**/*.sol')
console.log('GLOB', '/', files)
// only get path property of files
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) => {

@ -126,11 +126,12 @@ class FSPluginClient extends ElectronBasePluginClient {
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, {
withFileTypes: true,
...options
})
const result: any[] = []
for (const file of files) {
@ -141,6 +142,9 @@ class FSPluginClient extends ElectronBasePluginClient {
if (pathWithoutWorkingDir.startsWith('/')) {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(1)
}
if(pathWithoutWorkingDir.startsWith('\\')) {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(1)
}
result.push({
path: pathWithoutWorkingDir + (file as Path).name,
isDirectory: (file as Path).isDirectory(),
@ -225,11 +229,11 @@ class FSPluginClient extends ElectronBasePluginClient {
ignorePermissionErrors: true, ignoreInitial: true,
ignored: [
'**/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) => {
let pathWithoutPrefix = path.replace(this.workingDir, '')
pathWithoutPrefix = convertPathToPosix(pathWithoutPrefix)
if (pathWithoutPrefix.startsWith('/')) pathWithoutPrefix = pathWithoutPrefix.slice(1)
@ -242,7 +246,6 @@ class FSPluginClient extends ElectronBasePluginClient {
if (currentContent !== newContent) {
try {
this.emit('change', eventName, pathWithoutPrefix)
} catch (e) {
console.log('error emitting change', e)

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

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

Loading…
Cancel
Save