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

asyncronous log search #783

Closed
Yanpas opened this issue Jan 27, 2020 · 10 comments · Fixed by #798
Closed

asyncronous log search #783

Yanpas opened this issue Jan 27, 2020 · 10 comments · Fixed by #798

Comments

@Yanpas
Copy link
Contributor

Yanpas commented Jan 27, 2020

  • VSCode Version:
  • OS Version: all
  • Extension Version:2.6.0
  • System Language:
  • SVN Version:

Issue

From #782

In my case (repo with about 250k revisions) searching is too long. There is no output until server scans all revisions. Line by line reading and outputing would be much useful. And maybe stop command or something.

@JohnstonCode
Copy link
Owner

Not possible to do using virtual files

@JohnstonCode
Copy link
Owner

Also dont currently have a way to kill commands

@JohnstonCode
Copy link
Owner

JohnstonCode commented Jan 27, 2020

Also repo with 1873207 revisions takes 30 seconds for me.

@Yanpas
Copy link
Contributor Author

Yanpas commented Jan 27, 2020

Technically it's possible with redirecting to file in temp directory.

Not sure whether it's that useful, as for me searching in terminal is more convenient, and you always can redirect it to vscode (| code -).

@JohnstonCode
Copy link
Owner

JohnstonCode commented Jan 27, 2020

Yeah using a tmp file would work. Does vs code continously update files once they have been rendered? i.e. the command opens the file. vs code renders the empty file. Then does it check if the file has changed and add the new text or does it wait for user interaction like clicking on the file or swtiching tabs?

I think it will be lazy for performance reasons.

@JohnstonCode
Copy link
Owner

I stand corrected it will render it as it streams

@Yanpas
Copy link
Contributor Author

Yanpas commented Jan 27, 2020

Vscode updates file's content even if the user doesn't do anything. Tested with:
( for i in {1..10}; do echo -n "$i "; date; sleep 2; done ) | code -

@JohnstonCode
Copy link
Owner

proc.kill('SIGINT'); will kill the child process.

@JohnstonCode
Copy link
Owner

JohnstonCode commented Jan 27, 2020

ignore

    fs.truncateSync(`${repository.workspaceRoot}/svn.log`);

    await commands.executeCommand<void>("vscode.open", Uri.file(`${repository.workspaceRoot}/svn.log`));

    const proc = cp.spawn('svn', ['log', '--search', input], {cwd: repository.workspaceRoot});

	proc.stdout.on('data', data => {
        fs.appendFile(`${repository.workspaceRoot}/svn.log`, data.toString(), err => {
          if (err) {
            console.error(err);
            return;
          }

          console.log('written');
        });
      });

    window.withProgress({cancellable: true, location: ProgressLocation.Notification, title: 'Searching Log'}, (_progress, token) => {
      token.onCancellationRequested(() => {
        proc.kill('SIGINT');
      });
    });

@JohnstonCode
Copy link
Owner

🎉 This issue has been resolved in version 2.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants