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

Fix invalid path on Windows when opening traces #674

Merged

Conversation

hoangphamEclipse
Copy link
Contributor

@hoangphamEclipse hoangphamEclipse commented Feb 8, 2022

On Windows, Theia returns an invalid file path when opening traces. The invalid file path begins with a forward slash /. For example, the path C:/ will become /C:/. This prevents the trace extension from opening trace files. This is a known Theia issue. More on the issue can be read here.

This commit resolves temporarily this issue by using FileUri to convert the original file path returned by Theia to a platform specific path. This will allow the trace extension to open traces on Windows.

Signed-off-by: Hoang Thuan Pham <[email protected]>

Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your commit message needs to be formatted properly and you need to add a correctly formatted signed-off-by line


@injectable()
export class BackendFileServiceImpl implements BackendFileService {

async findTraces(path: string, cancellationToken: CancellationToken): Promise<string[]> {
/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove trailing whitespaces

Rodrigoplp-work
Rodrigoplp-work previously approved these changes Feb 8, 2022
Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message is not formatted properly has to long lines. The main readme has a section about how to contribute code and format the message.
https://github.com/theia-ide/theia-trace-extension#how-to-contribute-code

Please update the commit message accordingly.

@hoangphamEclipse hoangphamEclipse marked this pull request as draft February 9, 2022 14:59
Currently, when opening traces on Windows, Theia returns the file path
starting with a /. For example, instead of C:/, Theia returns /C://.
The path is an invalid Windows path, and prevent the trace extension
from opening traces. This is a known issue that requires a work around.

This commit resolves this issue by using FileUri to convert the original
file path returned by Theia to a platform specific path. This work
around will temporarily allow traces to be opened in Windows environment.

Signed-off-by: Hoang Thuan Pham <[email protected]>
Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this. Looks good to me.

@bhufmann bhufmann merged commit b148568 into eclipse-cdt-cloud:master Feb 9, 2022
@bhufmann
Copy link
Collaborator

bhufmann commented Feb 9, 2022

Fixes #545

@hoangphamEclipse hoangphamEclipse deleted the windows-path-fix branch February 10, 2022 14:06
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

Successfully merging this pull request may close these issues.

3 participants