redhat-developer / redhat-developer/vscode-java

Gradle Source Dependencies do not Show up in Intellisense

オープン
#1,781 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement Gradle
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された settings.gradle と build.gradle のソース依存関係設定を使用して、リンクされたアプリケーションおよびライブラリのサンプルプロジェクトで問題を再現します。まず Java 拡張機能が Gradle の依存関係をどのように処理するかを確認し、次に org.frcnomad:lib が IntelliSense に表示されるかを検証します。Gradle が引き続き正常にビルドおよび実行されながら、その内容が認識されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。