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

Refactoring :e options + support windows host #5158

Open
stevenguh opened this issue Aug 30, 2020 · 0 comments
Open

Refactoring :e options + support windows host #5158

stevenguh opened this issue Aug 30, 2020 · 0 comments

Comments

@stevenguh
Copy link
Contributor

stevenguh commented Aug 30, 2020

This is both a request/issue/discussion. I reimplemented :e option a while back to support both the tab completion and opening file on remote. I learned that a few days ago that vscode-remote support windows machine as remote, and the assumption I made here

Vim/src/util/path.ts

Lines 115 to 116 in e7c5c70

if (currentUri.scheme === 'untitled') {
// Assume remote server is nix only

is no longer valid.


Since I just worked on a feature on another extension that touches on path manipulation, I learned more about how to handle different edge cases and I am thinking to refactor the work I did here to support some new features for :e:

  • Support :e and auto completion with *nix remoting into Windows

  • Change the base directory of the :e for relative path to the workspace folder of the active editor (to be more like vim) than just the folder containing the active editor
    Local cases:

    • A folder /home/steven/Vim is opened in vscode, and the active editor is src/statusBar.ts. :e ./ should autocomplete contents in the directory of /home/steven/Vim instead of /home/steven/Vim/src.
    • A folder /home/steven/Vim is opened in vscode, and the active editor is an untitled document. :e ./ should autocomplete contents the directory of /home/steven/Vim/ instead of /home/steven/Vim/src/
      A folder /home/steven/Vim is opened in vscode, and the active editor is file outside of the workspace like /home/steven/.bashrc. :e ./ should autocomplete contents the directory of /home/steven/ instead of /home/steven/Vim -OR- No folder is opened, and the active editor is /home/steven/Vim/src/statusBar.ts, :e ./ should complete the contents in the directory of /home/steven/Vim/src/
    • No folder is opened, and the active editor is an untitled, only absolute path can be autocompleted

    Remote cases are the same as the local case except:

    • No folder is opened, and the active editor is an untitled, it can also autocomplete local absolute path.
  • Remove auto extension completion when execute :e command (vim doesn't do that. I don't know why it was there in the first place - Maybe it was there because there wasn't any autocompletion)

    • This feature only auto completes using the active buffer's extension. For example: if I opened src/statusBar.ts and entered :e textEditor, vscode vim will tried to open src/textEditor.ts
    • AFAIK, this doesn't exist in regular vim, and doesn't make much sense now that we have auto completion.

I started part of the work, and just want to make sure those features/fixes make sense before I get to far.

Other related issues:
#4859

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

No branches or pull requests

1 participant