project features / recursive browsing of one given remote folder

myel avatarmyel created an issue

it would be great if one could use the winscp remote folder (enviroment -> directories) to set a project root directoy.

with that directory set, the plugin would browse/get all files/folders from that directory recursively, so one can use the full power of sublimes project management features.

because the recursive download of the whole file/directorystrucure can be quite slow with deeply nested folders, some kind of caching would be needed in the feature (although i think winscp already has this integrated).

to clearify: don't make a local copy of the remote folder, "just" list all files and directories recursivly from the given remote folder.

Comments (8)

  1. Sami Pirbay

    WinSCP has directory caching but I don't think it works with scripting. We'd have to do our own caching (not that hard) or add a request to the WinSCP developers.

    I don't see the "environment -> directories" option... Is it in WinSCP?

    I was thinking about doing something in the local .sublime-project file. We could add some custom options in this file to specify a WinSCP session and a remote folder. We'd reuse the '(dir)exclude'. So you just open your project, then when you launch the plugin, it automatically connects to the right session and browses to the right folder. You can then edit any file you want, they would be downloaded to the local project folder and 'kept in synch'. Or something like that... it's not very clear in my head :)

  2. myel

    see attached file ;). it just sets a starting directory, which i though could then be read recursivly...

    your idea with the local .sublime-project file sounds much better!

    i also noticed that caching doesn't work with winscp.com. without caching, its far to slow to use, already testet that. sublime itself seems to do some caching on projects itself, i don't know i that could be reused...

    maybe i can help, but my python / sublime skills are limited to say the least...

  3. Sami Pirbay
    • Sublime Project: in the project options, there should be a 'remoteDir' and a 'sessionName' parameter. Each mount point will be relative to that path. It can be read like this: window.project().options().getString('remoteDir')
    • The caching should be simple to achieve: just pickle a list of filenames/directory names, using the stored session name as a key. The pickled file will be stored in the project directory OR in the plugin directory; I'm not sure what's best?
    • There should be a ":refresh list:" command to refresh the list (unless the cache is empty: in that case it should be automatic)
    • The recursive 'ls' must be done in the background, and must not stop the user from downloading/uploading files at the same time.
    • The files should be downloaded to the project directory instead of a temporary directory. Moreover, they shouldn't be deleted when closing the session. Should we let the user browse files that are not part of the project? It would complicate things.
  4. Sami Pirbay

    I'm not going to work on this until February. If someone wants to help, I can give you commit rights.

    Current status:

    • Sublime Project: add something like this under <project>:
    <options><![CDATA[
    remoteDir /myhome
    sessionKey mySessionName
    ]]></options>
    

    If there are spaces in your session name, you'll have to replace them with %20 for now.

    • Project directory: files are downloaded to the project directory and are not deleted.
    • Caching: not implemented yet. The files/directories (under remoteDir) are re-read everytime you call the plugin. It's fine small projects, but for larger projects, it's not really usable without caching.
  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.