-
Notifications
You must be signed in to change notification settings - Fork 156
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
PR: Cleanups of g.os_path wrappers and related methods. #3273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to take me some time. But I don't see where the path in an @path
node is included. It's essential to include that path somewhere.
@tbpassin Thanks for checking. I think the problem with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those changes look good. And I'll make sure to mirror them in leojs as soon as they are officially merged, But i dont know enough about os.path module in python to know if those are really appropriate changes. I'll leave it to you and Thomas to give the final word on this.
The os.path functions can be complicated in what they do. How will leojs be able to access the file system at all? Normally one can't do that from a browser. |
Note that we have to make sure the new path code is going to work with
It is essential that the paths work out right for these kinds of trees. |
@tbpassin Good observation, but it's not a problem at all really: The leojs extension can be installed as-is both in vscode on a computer to edit in local drives, or, in the browser to edit repositories directly (on github, azure repos, etc..) but not local files. As I explain below: When leojs runs in a computer's local installation of vscode, it has access to node's path module, which is somewhat equivalent to python's path module. (for working with local files on that computer as normal/typical usage) So no problem there for writing equivalent methods in typescript that match what the original Leo in python does! :) When leojs runs in vscode for the browser it works ONLY on a virtual filesystems of github or azure (and others) online-repository directly. It provides a shiv (an equivalent API) for node's path module. So the same things can be done no problem. I guess, if you (really) wanted to work with files from your computer, but with vscode in the browser, just push your working folder as a repo! :) Félix |
@boltex @tbpassin Thanks for your comments and approving review. I agree with Thomas that more testing is needed, especially for the botched PR #3264 (it broke In fact, I think we should test However, this PR is almost certainly safe. Besides removing a workaround for an ancient Python bug, this PR makes only obviously-correct substitutions. I'm going to merge this PR now. It should form the base of the PR that fixes #3264. |
c.scanAtPathDirectives
.It used a recent-removed setting.
g.os_path_normslashes
in several places.