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

support vscode.CustomExecution api #7185

Closed
svor opened this issue Feb 20, 2020 · 18 comments · Fixed by #9189
Closed

support vscode.CustomExecution api #7185

svor opened this issue Feb 20, 2020 · 18 comments · Fixed by #9189
Assignees
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help java issues related to the java language tasks issues related to the task system vscode issues related to VSCode compatibility

Comments

@svor
Copy link
Contributor

svor commented Feb 20, 2020

Description

To see that Java language server is initializing need to click on the task button:
screenshot-localhost_3000-2020 02 (1)
But this button doesn't work:

command.ts:15 Uncaught (in promise) TypeError: i.CustomExecution is not a constructor
    at :3000/tmp/vscode-unpacked/java-0.57.0-2029.vsix/extension/dist/extension.js:7
    at Generator.next (<anonymous>)
    at o (:3000/tmp/vscode-unpacked/java-0.57.0-2029.vsix/extension/dist/extension.js:7)

Reproduction Steps

  1. Download vscode java plugin https://download.jboss.org/jbosstools/static/jdt.ls/stable/java-0.57.0-2029.vsix and put it into plugins folder
  2. Open the workspace with java project and try to click on the active task button

OS and Theia version:
Linux
@theia/example-browser 0.15.0

Diagnostics:

That's how it looks in vscode:

@vince-fugnitto vince-fugnitto added java issues related to the java language vscode issues related to VSCode compatibility labels Feb 20, 2020
@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help labels Feb 20, 2020
@akosyakov
Copy link
Member

I don't think we support CustomExecution VS Code api for tasks yet.

@akosyakov akosyakov added the tasks issues related to the task system label Feb 20, 2020
@marcdumais-work
Copy link
Contributor

Version 0.54.2 of that extension is known to work well in Theia AFAIK. Could you try that version and report if you have the same issue?

https://github.com/redhat-developer/vscode-java/releases/download/v0.54.2/redhat.java-0.54.2.vsix

@akosyakov akosyakov changed the title [Java] Can't see the progress of jdt.ls initialization support vscode.CustomExecution api Feb 29, 2020
@502647092
Copy link
Contributor

@marcdumais-work I test redhat.java@0.62.0 it's work
but console have error Uncaught (in promise) TypeError: i.CustomExecution is not a constructor
when i click
image

@allaVolkov
Copy link

Is implementation of CustomExecution planned?

@akosyakov
Copy link
Member

Contributions to issues marked as help wanted and without any assignments are welcomed. It means that nobody is working or planning to work on them right now.

@ericwill
Copy link

Someone from my team will take a look at this after the upcoming Che sprint, so sometime late August. Of course by no means should that stop someone else from working on it before then, if they want to!

@gsmachado
Copy link

gsmachado commented Oct 4, 2020

Hey @ericwill

Some info:

I'm running theia 1.6.0, with vscode-java-redhat version 0.61.0, and tried to add this extension here.

However, I see this error when the extension starts:

[error] Unable to generate vscode tasks from gradle tasks: vscode.CustomExecution is not a constructor

Are you guys working on this? Anything I could do as a workaround to make it work?

@tsmaeder
Copy link
Contributor

tsmaeder commented Oct 5, 2020

@gsmachado no, it's not in the sprint plan. We're aware that this API is not implemented. It's a question of assigning resources.

@ericwill
Copy link

ericwill commented Oct 5, 2020

@gsmachado no, it's not in the sprint plan. We're aware that this API is not implemented. It's a question of assigning resources.

Correct. @gsmachado if you propose a PR to theia, someone from our team can review it.

@gsmachado
Copy link

gsmachado commented Oct 5, 2020

Correct. @gsmachado if you propose a PR to theia, someone from our team can review it.

Alright! I would be interested to do it, but I'm not even sure what's the correct behavior of this vscode.CustomExecution API, and where I can find the "reference implementation" of it.

I would appreciate any leads on this -- maybe I get inspired and get something done. 😄

@marcdumais-work
Copy link
Contributor

Hi @gsmachado,

A few pointers - those around here that know more than me can correct or complete:

vscode API doc: https://code.visualstudio.com/api/references/vscode-api#CustomExecution

implementation:
https://github.com/microsoft/vscode/blob/master/src/vs/workbench/api/common/extHostTypes.ts#L1874
https://github.com/microsoft/vscode/blob/master/src/vs/workbench/api/common/extHostTask.ts#L480

On the Theia side:
need to define CustomExecution in this file I think: https://github.com/eclipse-theia/theia/blob/master/packages/plugin/src/theia.d.ts#L8834

And probably to enhance this to look more like vscode above:
https://github.com/eclipse-theia/theia/blob/master/packages/plugin-ext/src/plugin/tasks/tasks.ts#L62

examples of the API being used by vscode-gradle, that could be used to test: 1, 2

P.S. We generally do not reinvent the wheel. It's permissible to copy code from the vscode repo (MIT) so long as credit is given and the license respected. See this for example. If you do copy some code, please keep a log for each snippet, including file(s)/line(s)/range and from which vscode version. We'll need to go through an internal Eclipse Foundation process, that vets copied code, before we can merge, and your detailed log will facilitate this.

@gsmachado
Copy link

@marcdumais-work awesome answer. You know, being in the open-source space for some time, that's what I believe we need more: people willing to at least explain, with a reasonable level of detail, what needs to be done, where people can start with, etc. This kind of thing motivates people. 👍 😄

@marcdumais-work
Copy link
Contributor

@gsmachado I hope this is good to get you started. Please ask here if you have questions along the way.

@mauricioszabo
Copy link

Well, while this API is not implemented, is there a work-around? A way for plug-in authors to implement a Task that's simply a callback, for example, even if I have to keep two code versions (one for vscode and one for Theia)

Otherwise, my plug-in will not work at all :(

@vince-fugnitto
Copy link
Member

Well, while this API is not implemented, is there a work-around? A way for plug-in authors to implement a Task that's simply a callback, for example, even if I have to keep two code versions (one for vscode and one for Theia)

@mauricioszabo I do not believe there is a workaround at the moment, if the feature is important to your use-case you can always attempt to implement the API yourself and submit a pull-request. The following #7185 (comment) describes the necessary changes in detail.

@TomHermanSAP
Copy link

Hi @gsmachado,
It has been some time since your last comment in this thread.
Are you working on a PR to implement the vscode.CustomExecution API?

Thank you!

@kittaakos kittaakos self-assigned this Mar 4, 2021
@kittaakos
Copy link
Contributor

I will look into this.

kittaakos pushed a commit to kittaakos/theia that referenced this issue Mar 10, 2021
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
shyshywhy added a commit to shyshywhy/theia that referenced this issue Mar 12, 2021
shyshywhy added a commit to shyshywhy/theia that referenced this issue Mar 12, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <tanhaiyang@163.com>
@shyshywhy
Copy link
Contributor

I have an implementation,#9189

shyshywhy pushed a commit to shyshywhy/theia that referenced this issue Mar 14, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <tanhaiyang@163.com>
shyshywhy pushed a commit to shyshywhy/theia that referenced this issue Mar 14, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
shyshywhy pushed a commit to shyshywhy/theia that referenced this issue Mar 14, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
shyshywhy pushed a commit to shyshywhy/theia that referenced this issue Mar 14, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
shyshywhy added a commit to shyshywhy/theia that referenced this issue Mar 14, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
shyshywhy added a commit to shyshywhy/theia that referenced this issue Apr 1, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
shyshywhy added a commit to shyshywhy/theia that referenced this issue Apr 2, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
kittaakos pushed a commit that referenced this issue Apr 6, 2021
issue: #7185, #8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
dna2github pushed a commit to dna2fork/theia that referenced this issue Aug 25, 2021
issue: eclipse-theia#7185, eclipse-theia#8767

Signed-off-by: Lewin Tan <e_tanhaiyang@163.com>
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 help wanted issues meant to be picked up, require help java issues related to the java language tasks issues related to the task system vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.