Skip to content

Sources-JAR auto-mount #183

Description

@hikkidev

I'm not exactly sure where the issue is, but JAR auto-mount isn't working as expected for me.

Steps to reproduce:

  1. wipe-out: ~/.gradle/caches/*, ~/.kmp-lsp/sources/* and ~/.cache/kmp-lsp
  2. cd to android project and run ./gradlew :app:installDebug

After running installDebug, Gradle downloads all dependencies to ~/.gradle/caches/modules-2/files-2.1, then builds the project and installs the APK. A search of the directory tree confirms that the files-2.1/**/*.jar files are present.

Then I launch Helix. When I try to navigate to an androidx.* class, I get the error message: "No definition found".

  • I follow the recommendation to run ./gradlew dependencies and try again, but the result is the same.
  • I then run kmp-lsp extract-sources. The result is still the same, but the command output seems suspicious:
$ kmp-lsp extract-sources
Searching: //Users/<username>/.gradle/caches/modules-2/files-2.1
Output: /Users/<username>/.kmp-lsp/sources

Found 0 *-sources.jar file(s) total.
After dedup (last version per artifact): 0 jar(s).

Nothing to extract.
  • Next, I open the project in Android Studio, wait for Gradle sync and indexing to complete, and run kmp-lsp extract-sources again. This time the dependencies are successfully extracted into .kmp-lsp/sources, and navigation to androidx.* classes starts working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions