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

"The left and right path can't be compared!" #159

Open
vadimcn opened this issue Nov 3, 2024 · 6 comments
Open

"The left and right path can't be compared!" #159

vadimcn opened this issue Nov 3, 2024 · 6 comments

Comments

@vadimcn
Copy link

vadimcn commented Nov 3, 2024

I've found your extension useful on many occasions! However, this one time I'm trying to compare two folders (one of them on a mounted filesystem—could that be the reason?), and the extension errors out with the message: "The left and right path can't be compared!" without any explanation as to why.
It would be great if more information about the errors could be provided to help figure out what's wrong. Thanks!

@L13
Copy link
Owner

L13 commented Nov 3, 2024

Hi, this message appears if the paths are not of the same type e.g. the left path is a folder and the right is a symlink or is not of the type folder/file. You can only compare files with files and folders with folders. Other combinations like folder with symlink are not possible because a symlink is treated as a separate type.

@vadimcn
Copy link
Author

vadimcn commented Nov 3, 2024

Hmm, you are right, one of them was a directory symlink. It turns out that adding a trailing slash actually makes it work.

Still, something weird is going on with the folder selector: when I navigated the directories (after having clicked the folder icon), the path had the trailing slash, however, once I clicked [ok], the path copied to the diff panel was missing that slash.

@L13
Copy link
Owner

L13 commented Nov 5, 2024

Hmm, you are right, one of them was a directory symlink. It turns out that adding a trailing slash actually makes it work.

Yes, a trailing slash is the same like /. and means you are 'in' the folder.

Still, something weird is going on with the folder selector: when I navigated the directories (after having clicked the folder icon), the path had the trailing slash, however, once I clicked [ok], the path copied to the diff panel was missing that slash.

I tested every platform (mac, windows, linux) and couldn't find any different behavior on each. Selecting a folder doesn't show me a path. After clicking 'Open' the path was without a slash at the end. There was no 'Ok' Button. Do you mean something different?

@vadimcn
Copy link
Author

vadimcn commented Nov 5, 2024

Sorry, forgot to mention this was in a remote session. It looks like this in the file selector:
image

But after [ok] the slash gets dropped:
image

Not sure if this is possible to fix, but at least some extra diagnostics on errors would have helped.

@L13
Copy link
Owner

L13 commented Nov 6, 2024

The dialog is from VS Code which is different in each enviroment. This is one function call. It returns always an uri object which provides the information. I have no influence what you see.

I published a new version which changes the error message. It should be more clear now what's going wrong.

@vadimcn
Copy link
Author

vadimcn commented Nov 6, 2024

Thanks, much better now!

A small question though: if you can detect it's a symlink, why not resolve link target and if that turns out to be a directory, just use that?

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

2 participants