redhat-developer / vscode-quarkus

Quarkus Tools for Visual Studio Code, by Red Hat
https://quarkus.io
Apache License 2.0
72 stars 27 forks source link

Running/Debugging quarkus application with Gradle throws error #634

Open shailendraparihar opened 1 year ago

shailendraparihar commented 1 year ago

Background: Creating projects with >Quarkus: Generate a Quarkus Project in VS code Trying to run/debug Quarkus project using command >Quarkus: Debug current Quarkus project

Issue: Works perfectly fine for maven projects. However, throws following error while running Gradle: Cannot read properties of undefined (reading 'getQuarkusDevTaskName')

Extension version: 1.16.0

Note: Gradle code running perfectly fine using terminal using command: gradlew quarkusDev

angelozerr commented 1 year ago

@datho7561 I have never tested vscode-quarkus with gradle, have you played with gradle quarkus project?

datho7561 commented 1 year ago

I can replicated the failure, but instead, the error popup I get "Cannot read properties of undefined (reading 'filter')".

datho7561 commented 1 year ago

I can't consistently reproduce the issue. I don't know what the root cause is.

lpicchi commented 11 months ago

Same problem, I tracked it to this line

Apparently it is returning undefined because there isn't a gradle label in the workspace labels.

await commands.executeCommand("java.execute.workspaceCommand", JavaVSCodeCommands.WORKSPACE_LABELS_COMMAND_ID);

from here

I don't have experience in VS Code extensions development so I don't know what thatcommand means

datho7561 commented 11 months ago

Same problem, I tracked it to this line

Thanks! This is very helpful. This means that the mechanism we are using to detect if a project is a Gradle project is failing. I thought the bug was in the TypeScript code, but it's probably in the Java code, or in the communication between the two.

DaviesDiDo commented 1 month ago

Old discussion, but finally I resolved by creating a main class for the Quarkus application. Pretty annoying, but works well