redhat-developer / redhat-developer/vscode-java

Gradle Source Dependencies do not Show up in Intellisense

Aperta
#1,781 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Gradle source dependencies (introduction article: https://blog.gradle.org/introducing-source-dependencies) do not show up inside of intellisense (and by extent, the debugger). Gradle can still build and run the projects fine, but the editor itself doesn't see any of it.

Example settings.gradle:

sourceControl {
    gitRepository("https://github.com/EliSauder/robot-lib-test.git") {
        producesModule("org.frcnomad:lib")
    }
}

Example build.gradle

plugins {
    id "application"
}

group = 'org.frcnomad'

repositories {
    mavenCentral()
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

mainClassName = 'org.frcnomad.robot.Main'

dependencies {
    implementation('org.frcnomad:lib') {
        version {
            branch = 'noFRC'
        }
    }

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
    
    testImplementation "org.mockito:mockito-core:2.+"
    testImplementation "org.mockito:mockito-junit-jupiter:2.+"
}

tasks.named('test') {
    useJUnitPlatform()
}

The dependency that is not being resolved is org.frcnomad:lib (a test library I wrote to test source dependencies)

Prior to pursuing this path I created a stack overflow issue here:
https://stackoverflow.com/questions/65912344/vscode-not-recognizing-gradle-source-dependency

Environment
  • Operating System: Windows 10 Pro - Build 19042
  • JDK version: 11.0.10
  • Visual Studio Code version: 1.52.1
  • Java extension version: 0.74.0
  • Gradle: 6.0.1 & 6.8.1 (I tested both versions)
Steps To Reproduce
  1. Create a gradle library to be used as a dependency and then post it publicly to any git server (such as github).
  2. Using gradle's source dependencies require that project directly from the git server.
  3. Intellisense will not detect the contents of the library however gradle will still build and run just fine.

Sample Projects:
Application: https://github.com/EliSauder/robot-test/tree/e652b3670f2bb63f1224c55d346fc5c95d0b1d49 (Linked to a commit since I have switched to jitpack until vscode works with source deps)
Library: https://github.com/EliSauder/robot-lib-test/tree/noFRC

Logs From VSCode (Includes me opening VSCode to opening a file that imports the source dependency): https://1drv.ms/u/s!As6xGUN6WyzakMVHpmJm6sVig9gbIw

Current Result

Intellisense does not recognize any of the contents of a source dependecy

Expected Result

Intellisense should recognize the contents of a source dependency

Additional Informations

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.

Direzione di ricerca

Riproduci il problema con i progetti di esempio collegati dell’applicazione e della libreria utilizzando la configurazione delle dipendenze del codice sorgente fornita in settings.gradle e build.gradle. Inizia verificando come l’estensione Java gestisce le dipendenze Gradle, quindi verifica se org.frcnomad:lib appare in IntelliSense; l’attività è completata quando i suoi contenuti vengono riconosciuti, mentre Gradle continua a eseguire correttamente la build e l’esecuzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.