Theia: core: 'copy path' returns wrong path for windows

Created on 26 Jun 2020  路  7Comments  路  Source: eclipse-theia/theia

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

OWindows bug commands help wanted

All 7 comments

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...

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

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.

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.

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

LabelProviders cannot be async for performance reasons.

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.

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 https://github.com/eclipse-theia/theia/pull/8187

Was this page helpful?
0 / 5 - 0 ratings