Refactoring `:e` options + support windows host
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
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
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
:eand auto completion with *nix remoting into Windows -
Change the base directory of the
:efor 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/Vimis opened in vscode, and the active editor issrc/statusBar.ts.:e ./should autocomplete contents in the directory of/home/steven/Viminstead of/home/steven/Vim/src. - A folder
/home/steven/Vimis 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/Vimis 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.
- A folder
-
Remove auto extension completion when execute
:ecommand (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.tsand entered:e textEditor, vscode vim will tried to opensrc/textEditor.ts - AFAIK, this doesn't exist in regular vim, and doesn't make much sense now that we have auto completion.
- This feature only auto completes using the active buffer's extension. For example: if I opened
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:
https://github.com/VSCodeVim/Vim/issues/4859
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/util/path.ts at the linked lines and review related issue #4859. Trace the existing :e completion and remote-file handling before checking how workspace, active-editor, untitled, and Windows paths are resolved. Done means the listed local and remote cases work, and extension auto-completion is no longer added by :e.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100