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

Allow "Command" type in status bar items #8253

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

tsmaeder
Copy link
Contributor

@tsmaeder tsmaeder commented Jul 28, 2020

Signed-off-by: Thomas Mäder [email protected]

What it does

Aligns the type of StatusBarItem.command with the current state of the VS Code API.
fix #8241: Support Command Type for StatusBarItem.command

How to test

  1. Install VS Code Java, VS Code Java debug and VS Code Java Test runner plugins.
  2. Open a test program that contains unit tests, for example https://github.com/che-samples/console-java-simple
  3. In the test runner view, run a test
  4. Observe: there is a status bar item the first says "running tests" and then gives the number of run and failed tests.
  5. Click on the status bar item
  6. Observe: the test run report opens in an editor.

Review checklist

Reminder for reviewers

@tsmaeder tsmaeder requested review from vinokurig and akosyakov July 28, 2020 11:59
@tsmaeder tsmaeder added statusbar issues related to the statusbar vscode issues related to VSCode compatibility labels Jul 28, 2020
@akosyakov
Copy link
Member

Code changes look good to me, but I could not verify. I'm getting:

{"message":"Error: No delegateCommandHandler for vscode.java.test.search.items.all.","level":"error"}

Screenshot 2020-07-29 at 09 28 15

Versions of installed extensions are visible in Extensions view. Did you use other versions?

@akosyakov
Copy link
Member

akosyakov commented Jul 29, 2020

I built latest official published VS Code Java Test Runner extension along with others, but I still cannot run tests. Now it fails with:

root INFO [hosted-plugin: 7223] {
  message: '[Error - 9:38:02 AM] Jul 29, 2020, 9:38:02 AM Dispatch debug protocol error: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_ARRAY at path $.args\n' +
    'java.lang.IllegalStateException: Expected STRING but was BEGIN_ARRAY at path $.args\n' +
    'com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_ARRAY at path $.args\n' +
    '\tat com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224)\n' +
    '\tat com.google.gson.Gson.fromJson(Gson.java:888)\n' +
    '\tat com.google.gson.Gson.fromJson(Gson.java:953)\n' +
    '\tat com.google.gson.Gson.fromJson(Gson.java:926)\n' +
    '\tat com.microsoft.java.debug.core.protocol.JsonUtils.fromJson(JsonUtils.java:34)\n' +
    '\tat com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:76)\n' +
    '\tat com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:118)\n' +
    '\tat com.microsoft.java.debug.core.protocol.AbstractProtocolServer.lambda$new$0(AbstractProtocolServer.java:78)\n' +
    '\tat io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:60)\n' +
    '\tat io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200)\n' +
    '\tat io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)\n' +
    '\tat io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)\n' +
    '\tat io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)\n' +
    '\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n' +
    '\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)\n' +
    '\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n' +
    '\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n' +
    '\tat java.base/java.lang.Thread.run(Thread.java:834)\n' +
    'Caused by: java.lang.IllegalStateException: Expected STRING but was BEGIN_ARRAY at path $.args\n' +
    '\tat com.google.gson.internal.bind.JsonTreeReader.nextString(JsonTreeReader.java:180)\n' +
    '\tat com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:401)\n' +
    '\tat com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:389)\n' +
    '\tat com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)\n' +
    '\tat com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)\n' +
    '\t... 17 more\n',
  level: 'info',

Does it ring any bell? If not I will keep digging into it.

@akosyakov
Copy link
Member

It does not work because of #7690 args get concatenated by this API in the latest vscode-java-debug

I will do a PR for it promptly.

…tutedVariables VS Code API

Signed-off-by: Anton Kosyakov <[email protected]>
@akosyakov
Copy link
Member

akosyakov commented Jul 29, 2020

@tsmaeder I've pushed a commit adding missing resolveDebugConfigurationWithSubstitutedVariables directly to your branch. I can verify now that latest versions of java extensions work:
Screenshot 2020-07-29 at 13 30 59

Fixing codeiconds would be good too, but with another PR.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

Verified that it works with latest versions of Java extensions.

@tsmaeder
Copy link
Contributor Author

I'm using 0.26 of debug and 0.63 of vscode java.

@akosyakov
Copy link
Member

@tsmaeder Can we merge it? I will open another PR for icons, but it would be better to have this in master that we can verify against latest java extensions.

@tsmaeder
Copy link
Contributor Author

Fine by me, unless you want a review of the changes you made 🤷

@akosyakov
Copy link
Member

akosyakov commented Jul 29, 2020

@tsmaeder resolveDebugConfigurationWithSubstitutedVariables is the same like resolveDebugConfiguration, but called after variable substitutions. Could you review my commit please? Basically I've copied resolveDebugConfiguration in all affected files and renamed it. You can verify by installing all latest java extensions and checking that your changes are working with them too now.

...please if everything is fine just merge, I can send then 2 PRs tomorrow morning to fix icons and code lenses again master

@akosyakov akosyakov requested a review from vince-fugnitto July 29, 2020 14:16
@vince-fugnitto
Copy link
Member

vince-fugnitto commented Jul 29, 2020

@tsmaeder @akosyakov which versions of the extensions should we use, I'm getting the error reported earlier:

root ERROR Failed to fetch children for 'testExplorer' Error: No delegateCommandHandler for vscode.java.test.search.items

java-test

Update: I see an issue and pr was filed EclipseFdn/publish-extensions#97, I'll use the marketplace version for the time being (test purposes).

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes work well for me, I see the statusbar item and the report correctly 👍

java

@akosyakov
Copy link
Member

@vince-fugnitto auto update script is running only once a day, I think you were unlucky

@akosyakov akosyakov merged commit db34c98 into eclipse-theia:master Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
statusbar issues related to the statusbar vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Command Type for StatusBarItem.command
3 participants