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

java vscode extension is not published to vsx registry properly #7448

Closed
lmcbout opened this issue Mar 30, 2020 · 22 comments
Closed

java vscode extension is not published to vsx registry properly #7448

lmcbout opened this issue Mar 30, 2020 · 22 comments
Labels
bug bugs found in the application java issues related to the java language vsx-registry Issues related to Open VSX Registry Integration

Comments

@lmcbout
Copy link
Contributor

lmcbout commented Mar 30, 2020

Description

Propose to set the redhat JAVA version 0.54.2 in open-vsx registry

Testing Theia and JAVA available in vsx-registry (https://open-vsx.org/?)
The redhat JAVA version is 0.58.0 and is incompatible with version of Theia. When you install it, you get a popup dialog saying: " Activating extension Language Support for Java(TM) by Red Hat failed: Cannot read property 'join' of null.
bash: syntax error near unexpected token `(' "

refer to the issue #6791

Side effect:
1- You don't get the "RUN | Debug" button from gitlens
2- Install MAVEN and try to expand the plugions folder from the mavens view, it loops
3- Install the JAVA dependency view , you get a popup saying: "Cannot activate extension 'Java Dependency Viewer' because it depends on extension 'Language Support for Java(TM) by Red Hat', which failed to activate."

Reproduction Steps

Open THeia latest version
Expand the extension view, search for JAVA plugins
1- Install "Language <support for JAva" version 0.58.0
--> observe the dialog popup
2- Install MAven, open a maven project
Expand the Mavens view until the plugins tree folder and try to open it
--> it loops and does not get display
3- Install the Java dependency view
--> get a dialog saying: "Cannot activate extension 'Java Dependency Viewer' because it depends on extension 'Language Support for Java(TM) by Red Hat', which failed to activate."

OS and Theia version:
Ubuntu 18.04
Chrome
Theia : latest commit 743836e

Diagnostics:

Java58AndMaven

@akosyakov akosyakov added bug bugs found in the application java issues related to the java language labels Mar 30, 2020
@marcdumais-work
Copy link
Contributor

@spoenemann @jankeromnes This issue is about consuming the "Java by Red Hat" extension, from open-vsx.org, in Theia applications.

It happens that the latest version of that extension, built/deployed nightly in open-vsx,org, does not work well in Theia. In an ideal world, when I access the registry from the my Theia-based IDE app, I would be offered a version of an extension that's known to work in my application, but it sounds to be easier said than done.

Any thoughts about how to handle this type of situation?

@jankeromnes
Copy link
Member

I would say short-term, we can publish the older version to Open VSX, and remove the newer version for now.

Longer term, I think there should be a way to upload multiple versions to Open VSX, and for clients to download a specific version depending on their needs.

jankeromnes added a commit to open-vsx/publish-extensions that referenced this issue Mar 30, 2020
@jankeromnes
Copy link
Member

jankeromnes commented Mar 30, 2020

@spoenemann Please remove redhat.java version 0.58.0 from https://open-vsx.org for the short-term fix outlined above (this will allow the publish-extensions CI to publish version 0.54.2).

Also, do you have any thoughts or suggestions on the proposed longer term solution?

@akosyakov
Copy link
Member

@lmcbout @marcdumais-work Which project did you use to reproduce the issue?

@lmcbout
Copy link
Contributor Author

lmcbout commented Mar 30, 2020

@akosyakov I use a small application to test JAVA with different version of REDHAT JAVA and maven. Rename the file...tar.txt to ...tar, Just untar the following in a workspace, install from the open registry MAVEN with JAVA 058.0, no RUN | Debug
with JAVA 054.2 , open the file App.java, you will see the RUN | JAVA.

my-app.tar.txt

@marcdumais-work
Copy link
Contributor

Also, do you have any thoughts or suggestions on the proposed longer term solution?

Though it would not cover all possible cases of incompatibility, could the registry use the client's reported version of supported vscode engine, proposing by default e.g. the latest version of an extension that does not exceed this value?

In the specific case of redhat.java, we have the following mapping:

redhat.java version -> vscode engine
v0.54.2 ->  "^1.40.0"
v0.55.0 -> "^1.41.0"
...
v0.58.0 ("next") ->  "^1.41.0"

Anecdotally, this extension stops working well in Theia from v0.55.0, which is the first version where they stepped vs code engine from "^1.40.0" to "^1.41.0".

@akosyakov
Copy link
Member

@marcdumais-work I think it is a feature request for Theia, right now we only pull latest version, we don't verify whether its confirm to vscode api engine version. Could you file an issue please? We also don't support detecting outdated extensions and upgrading them.

@spoenemann
Copy link
Contributor

spoenemann commented Mar 31, 2020

Longer term, I think there should be a way to upload multiple versions to Open VSX, and for clients to download a specific version depending on their needs.

The first part is already possible. Downloading a specific version is also possible, but so far our UI only displays the latest version. We could change that.

Can'we just fix the problems in Theia instead of deleting published extensions from the registry?

@akosyakov
Copy link
Member

I agree with Miro that we cannot keep outdated versions in the registry, but should work on bug fixing in the plugin system.

@akosyakov
Copy link
Member

@lmcbout It works for me, code lens are disabled by default, you should enabled them in settings with "java.referencesCodeLens.enabled": true.

How did you manage to get:

Activating extension Language Support for Java(TM) by Red Hat failed: Cannot read property 'join' of null.
bash: syntax error near unexpected token `(' 

I cannot reproduce it. If you can provide a GitHub repo it would help.

@akosyakov
Copy link
Member

Ok, i was able to reproduce it. The issue is not with Theia or VS Code java extension, but apparently with the publishing script:
Screenshot 2020-03-31 at 10 32 10

(1) - is from VS Code Marketplace, this extension works
(2) - is from Open VSX Registry, this extension does not work and it is very tine compare to (1)

cc @spoenemann @jankeromnes

@akosyakov akosyakov added the vsx-registry Issues related to Open VSX Registry Integration label Mar 31, 2020
@akosyakov akosyakov changed the title Propose to change the JAVA version in open-vsx registry to an older version before marketing Theia 1.0.0 java vscode extension is not published to vsx registry properly Mar 31, 2020
@akosyakov
Copy link
Member

moved to open-vsx/publish-extensions#18

@spoenemann
Copy link
Contributor

I would like to avoid doing this in general, but in this case we're going to delete the already published version from open-vsx.org

@marcdumais-work
Copy link
Contributor

@marcdumais-work I think it is a feature request for Theia. Could you file an issue please?

Ok, will do. So IIUC the client can deal with this, with no additional support from Open VSX? Do we know if VS Code and their registry have a similar mechanism?

@marcdumais-work
Copy link
Contributor

Ok, will do.

#7464

@marcdumais-work
Copy link
Contributor

Can'we just fix the problems in Theia instead of deleting published extensions from the registry?

Yes, I agree.

Even more so if, as looks probable, Open VSX eventually adds supports clients other than Theia, like VSCodium.

@jankeromnes
Copy link
Member

@lmcbout A fixed redhat.java extension was recently pushed to Open VSX by RedHat: https://open-vsx.org/extension/redhat/java

Could you please try again with 0.59.0?

@marcdumais-work
Copy link
Contributor

Hi @jankeromnes ,

I just tried using the Theia electron example app from the main repo, using latest master. I installed the Java extension from the extensions view, pulling it from open-vsx.org:
image

Upon opening a .java file I get error:
image

Backend exception:

root ERROR [hosted-plugin: 9271] Error on activation of java TypeError: s.workspace.onDidCreateFiles is not a function
    at Object.t.registerFileEventHandlers (/home/lmcmcds/.theia/extensions/redhat.java-0.59.0/extension/dist/extension.js:7:96930)
    at Promise (/home/lmcmcds/.theia/extensions/redhat.java-0.59.0/extension/dist/extension.js:1:197103)
    at new Promise (<anonymous>)
    at /home/lmcmcds/.theia/extensions/redhat.java-0.59.0/extension/dist/extension.js:1:188413
    at Generator.next (<anonymous>)
    at o (/home/lmcmcds/.theia/extensions/redhat.java-0.59.0/extension/dist/extension.js:1:180965)
    at process._tickCallback (internal/process/next_tick.js:68:7)

@akosyakov
Copy link
Member

@marcdumais-work it is missing workspace APIs we should work on it: #7171

I don't think there is an issue in the registry or in the extension.

@marcdumais-work
Copy link
Contributor

I don't think there is an issue in the registry or in the extension.

I do not think this was implied in the original title of this issue that the problem was with the registry or the extension. Rather that for a user naively trying a Theia app and installing the java extension will not have a good outcome, hence the suggestion to publish a version that works with the current theia.

@akosyakov
Copy link
Member

@marcdumais RedHat is going to claim own namespace: EclipseFdn/open-vsx.org#6 I think it would be too much to ask them to change their release process to publish another version for Theia. It should not be hard to fix missing APIs, we have them in Theia already.

@marcdumais-work
Copy link
Contributor

ok, seems reasonable in this case. But I expect this will be a recurring type of problem whenever new APIs will appear in the wild that we do not support yet. Until we have something like #7464

tennox pushed a commit to tennox/publish-extensions that referenced this issue Jan 21, 2022
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 java issues related to the java language vsx-registry Issues related to Open VSX Registry Integration
Projects
None yet
Development

No branches or pull requests

5 participants