Skip to content

Support managing referenced libraries - #213

Merged
Sheng Chen (jdneo) merged 14 commits into
masterfrom
vigilans/referencedLibraries
Jan 13, 2020
Merged

Sheng Chen (jdneo) merged 14 commits into
masterfrom
vigilans/referencedLibraries

Conversation

@Vigilans

@Vigilans Vigilans (Vigilans) commented Nov 19, 2019 •

Copy link
Copy Markdown
Member

Fix #174, microsoft/vscode-java-pack#94

Based on:

VS Code will take care of the file watching and searching work by providng a setting:

"java.dependency.referencedLibraries": string[] | {
  "include": string[],
  "exclude": string[],
  "sources": { [binary: string]: string }
}

...with the following extended behaviors before sending to jdt.ls:

  • If specified setting is an array, it will be expanded into a full object, with the original content as include field.
  • Jars in lib/ but not included will be appended to exclude field. It is to ensure jars not listened by VS Code don't get shown in referenced libraries — only one source of truth. (This is not an elegent workaround, waiting for better alternative...)
  • A match of foo.jar and foo-src.jar (not necessarily in the same folder) will be added to sources mapping.

@Vigilans
Vigilans (Vigilans) force-pushed the vigilans/referencedLibraries branch from 1f26a1e to 55cd56c Compare November 19, 2019 20:21
@Vigilans
Vigilans (Vigilans) force-pushed the vigilans/referencedLibraries branch from a54ba39 to db6fc92 Compare November 26, 2019 08:15
@Vigilans
Vigilans (Vigilans) marked this pull request as ready for review November 27, 2019 05:09
@testforstephen

Copy link
Copy Markdown
Contributor

what's the status for this PR?

@Vigilans

Copy link
Copy Markdown
Member Author

Some important modifications are saved in my Linux PC. May I rebase to the master branch and update the PR after going back home tonight?

* Notification dependency viewer to refresh on updating classpath done
* Command to manually trigger classpath refreshing
@Vigilans
Vigilans (Vigilans) force-pushed the vigilans/referencedLibraries branch from 812caed to f9d4af4 Compare December 28, 2019 08:00
* Adding file/folder to referenced libraries
* Removing a jar file from referenced libraries
* Manually trigger refreshing of referenced libraries in classpath
@Vigilans
Vigilans (Vigilans) force-pushed the vigilans/referencedLibraries branch from f9d4af4 to 3b8f1c6 Compare December 28, 2019 14:09
Comment thread src/controllers/libraryController.ts Outdated
Comment thread package.json Outdated
Comment thread package.nls.json Outdated
Comment thread package.nls.json Outdated
Comment thread package.nls.zh.json Outdated
Comment thread package.nls.zh.json Outdated
Comment thread src/controllers/libraryController.ts Outdated
Comment thread src/settings.ts Outdated
Comment thread webpack.config.js Outdated
Comment thread src/controllers/libraryController.ts Outdated
Comment thread src/controllers/libraryController.ts Outdated
}));
}
const setting = Settings.referencedLibraries();
setting.include.push(...libraryGlobs);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply push might not work in some scenario, like:

if the original setting is:

"java.project.referencedLibraries": {
        "include": [
            "lib/**/*.jar"
        ],
        "exclude": [
            "lib/junit-platform-console-standalone-1.5.2.jar"
        ]
    }

where the junit-platform-console-standalone-1.5.2.jar is the only jar in the lib folder.

Now if I re-add the lib folder into the referenced libs, the exclude part won't be updated.

@jdneo Sheng Chen (jdneo) added this to the 0.7.1 milestone Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support managing referenced libraries

3 participants