redhat-developer / redhat-developer/vscode-java

No Java runtime version displayed for non-invisible project created under the jdt.ls workspace

Aperta
#2,552 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@rgrunber ci sta già lavorando.

Dal 21/9/2022.

bug runtime
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

Some context
I'm trying to get JBang scripts work OOTB in VS Code. Since the classpath dependencies are coded right in the Java file, I use a similar mechanism to invisible projects to create a Java project under the jdt.ls workspace, that is then augmented with informations gathered from the JBang directives in the original file. This is based on jbang-eclipse. The jdt.ls integration is currently living on my fork. Finally, the VS Code Java integration can be found at https://github.com/fbricon/vscode-jbang, one can install a CI build of the vscode-jbang.vsix from the latest release page.

Now.

When I open a folder containing a JBang script, say hello.java:

///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS com.github.lalyos:jfiglet:0.0.9
//DEPS org.slf4j:slf4j-api:1.7.32
//JAVA 17
import com.github.lalyos.jfiglet.FigletFont;

class hello {

    public static void main(String... args) throws Exception {
        System.out.println(FigletFont.convertOneLine(
                "Hello " + ((args.length > 0) ? args[0] : "jbang")));
    }

}

After opening the file, the Java Runtime version is not displayed. It should show JavaSE-17 (or whatever is matching the //JAVA version comment in the file.

I have a strong feeling Invisible project detection conflicts with other projects under the jdt.ls workspace. Chance are, we'll need to identify invisible projects differently, i.e. by adding them an invisible project specific nature.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.