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

core: 'copy path' returns wrong path for windows #8098

Closed
vince-fugnitto opened this issue Jun 26, 2020 · 7 comments · Fixed by #12002
Closed

core: 'copy path' returns wrong path for windows #8098

vince-fugnitto opened this issue Jun 26, 2020 · 7 comments · Fixed by #12002
Labels
bug bugs found in the application commands issues related to application commands help wanted issues meant to be picked up, require help OS/Windows issues related to the Windows OS

Comments

@vince-fugnitto
Copy link
Member

Bug Description:

Following #7934, the copy path command does not produce the correct path for Windows.
The directory separator and drive casing are incorrect due to the way we process paths in packages/core/src/common/path.ts.

Example:

VS Code

  • C:\Users\kittaakos\dev\git\theia\packages\core\src\common\menu.spec.ts

Theia

  • /c:/Users/kittaakos/dev/git/theia/packages/core/src/common/menu.spec.ts

Steps to Reproduce:

  1. start the application on windows
  2. select files in the explorer, execute copy path command using the context-menu
  3. paste the content of your clipboard in an editor (ex: notepad) and notice the path is incorrect (separator & drive)
  4. perform the same operation on vscode and notice the correct path

Additional Information

@vince-fugnitto vince-fugnitto added bug bugs found in the application OS/Windows issues related to the Windows OS commands issues related to application commands labels Jun 26, 2020
@vince-fugnitto vince-fugnitto changed the title core: 'copy path' incorrectly returns paths for windows core: 'copy path' incorrectly returns path for windows Jun 26, 2020
@kittaakos
Copy link
Contributor

It's a generic issue. Windows users cannot do much with the path created from URI and Theia's Path on the frontend. It's not a valid FS path, it never was.

Same for the dialogs:
image

Recent workspaces:
image

For tooltips:
image

And many more...

@akosyakov akosyakov added the help wanted issues meant to be picked up, require help label Jun 27, 2020
@tsmaeder tsmaeder changed the title core: 'copy path' incorrectly returns path for windows core: 'copy path' returns wrong path for windows Jun 29, 2020
@tsmaeder
Copy link
Contributor

@vince-fugnitto I've taken the liberty to clarify the title. I'll undo if you think it's not correct.

@akosyakov
Copy link
Member

akosyakov commented Jun 29, 2020

Is it the issue about running electron app on windows on the same machine? We could think about solving it in such case, generally it is tricky, since electron even can be used to connect to remove backend in theory running on linux and then converting to windows paths would be bogus.

@kittaakos
Copy link
Contributor

Is it the issue about running electron app on windows on the same machine?

Yes, for instance.

We could think about solving it in such case, generally it is tricky,

The backend should be capable of resolving and concatenating paths. The API should accept URI strings.

since electron even can be used to connect to remove backend in theory running on linux and then converting to windows paths would be bogus.

I thought we dropped this idea long ago, but once the backend can resolve paths, we will be able to support an electron frontend connected to a remote backend too.

@akosyakov
Copy link
Member

The backend should be capable of resolving and concatenating paths. The API should accept URI strings.

LabelProviders cannot be async for performance reasons.

@kittaakos
Copy link
Contributor

LabelProviders cannot be async for performance reasons.

OK, let's collect the requirements, additional technical obstacles, and so on, and make a decision. This seems to be a bigger task.

I can say, cool that we have a performant LabelProvider but it provides me a path that is incorrect.

@akosyakov
Copy link
Member

I can say, cool that we have a performant LabelProvider but it provides me a path that is incorrect.

It can be potentially be resolved by #8187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application commands issues related to application commands help wanted issues meant to be picked up, require help OS/Windows issues related to the Windows OS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants