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

Relative Patterns don't work accross Platforms #8261

Closed
tsmaeder opened this issue Jul 29, 2020 · 6 comments · Fixed by #8268
Closed

Relative Patterns don't work accross Platforms #8261

tsmaeder opened this issue Jul 29, 2020 · 6 comments · Fixed by #8268
Assignees
Labels
bug bugs found in the application monaco issues related to monaco vscode issues related to VSCode compatibility

Comments

@tsmaeder
Copy link
Contributor

Bug Description:

When running the back end on linux and running the front end on Windows, document selectors using relative paths never match: For example, the CodeLensProvider for the Java Test Runner plugin never gets invoked when opening a Java file with a test in it. This works when both back-end and front-end run on the same platform

Steps to Reproduce:

  1. Install the Java Test Runner plugin (https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test)
  2. Run Theia back-end on linux, open the browser on Windows
  3. Clone https://github.com/che-samples/console-java-simple
  4. Open the Singe file containing tests.
  5. Observe: after initializing all plugins (you'll need java, java debug), you do not get a code lens saysing "Debug Test | Run Test".

Additional Information

The problem arises that monaco compares the currently opened file with a relative glob pattern in the DocumentSelector by using URI.fsPath, which in turn calls this method: https://github.com/microsoft/vscode/blob/90efeb4f2dc41827b382c8bb5da1c3abfff9459f/src/vs/base/common/uri.ts#L579
This results in the path separators being converted to backslashes. However, the same treatment is not done with the pattern, so the paths will not match. For example, the open file might be file:///projects/foo/bar and the pattern we match might be /projects/foo/bar, but we'll end up comparing \projects\foo\bar with /projects/foo/bar, which obviously fails.
On VS Code this does not arise, since they're always running on the same machine.
The problem seems fixed in the master version of vs code: https://github.com/microsoft/vscode/blob/c86411397d528d96686345d94f0478fbd77cc0b2/src/vs/editor/common/modes/languageSelector.ts#L96

@akosyakov
Copy link
Member

On VS Code this does not arise, since they're always running on the same machine.

Not anymore with codespaces.

The problem seems fixed in the master version of vs code: https://github.com/microsoft/vscode/blob/c86411397d528d96686345d94f0478fbd77cc0b2/src/vs/editor/common/modes/languageSelector.ts#L96

We need another Monaco upgrade 😬

@akosyakov akosyakov added bug bugs found in the application monaco issues related to monaco vscode issues related to VSCode compatibility labels Jul 29, 2020
@akosyakov
Copy link
Member

We could work it around though by patching IRelativePattern here:

const languageSelector = fromLanguageSelector(selector);

@akosyakov
Copy link
Member

@tsmaeder Are you going to make a PR or it is free to grab?

@tsmaeder
Copy link
Contributor Author

Free to grab....currently just analyzing issues with java test runner, not fixing.

@akosyakov akosyakov self-assigned this Jul 29, 2020
akosyakov added a commit that referenced this issue Jul 29, 2020
It also removes dependencies to the plugin process code from the main process.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jul 30, 2020
It also removes dependencies to the plugin process code from the main process.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jul 30, 2020
It also removes dependencies to the plugin process code from the main process.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
akosyakov added a commit that referenced this issue Jul 30, 2020
It also removes dependencies to the plugin process code from the main process.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
minyoungyang pushed a commit to minyoungyang/theia that referenced this issue Aug 4, 2020
…another OS

It also removes dependencies to the plugin process code from the main process.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
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 monaco issues related to monaco vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants