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

Implement file index provider #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benesch
Copy link

@benesch benesch commented Jan 22, 2019

This powers VSCode's built-in fuzzy file finder.

The approach taken is to execute find on the remote machine. This is more efficient than the implementation on the insiders branch, which uses SFTP.

This implements part of #2. I'm not actually proposing that this be merged yet, since sadly the file finding APIs are still experimental.

This powers VSCode's built-in fuzzy file finder.
@@ -31,7 +31,7 @@ export async function calculateActualConfig(config: FileSystemConfig): Promise<F
config.host = replaceVariables(config.host);
const port = replaceVariables((config.port || '') + '');
if (port) config.port = Number(port);
config.agent = replaceVariables(config.agent);
config.agent = replaceVariables(config.agent) || process.env.SSH_AUTH_SOCK;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't thought of using this variable, but it's a good idea. If you want, you can make this a separate PR, or let me commit it myself.


public async provideFileIndex(options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<vscode.Uri[]> {
const name = this.config.label || this.config.name;
const command = `find ${this.relative(options.folder.path)} -print0`;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked whether this command and syntax is available on all distros that support SFTP?

@lamnguyenx
Copy link

Hey @benesch have you been able to build a version of this plugin with this new search implementation yet? I'd be really great if you could provide us a .vsix package!

@benesch
Copy link
Author

benesch commented Mar 23, 2019

I haven't the time, I'm afraid. You'll have to go it yourself.

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

Successfully merging this pull request may close these issues.

3 participants