Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support managing referenced libraries #213

Merged
merged 14 commits into from
Jan 13, 2020
Merged

Conversation

Vigilans
Copy link
Member

@Vigilans Vigilans commented Nov 19, 2019

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 force-pushed the vigilans/referencedLibraries branch from 1f26a1e to 55cd56c Compare November 19, 2019 20:21
@Vigilans Vigilans force-pushed the vigilans/referencedLibraries branch from a54ba39 to db6fc92 Compare November 26, 2019 08:15
@Vigilans Vigilans marked this pull request as ready for review November 27, 2019 05:09
@testforstephen
Copy link
Contributor

what's the status for this PR?

@Vigilans
Copy link
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 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 force-pushed the vigilans/referencedLibraries branch from f9d4af4 to 3b8f1c6 Compare December 28, 2019 14:09
package.json Outdated Show resolved Hide resolved
package.nls.json Outdated Show resolved Hide resolved
package.nls.json Outdated Show resolved Hide resolved
package.nls.zh.json Outdated Show resolved Hide resolved
package.nls.zh.json Outdated Show resolved Hide resolved
src/controllers/libraryController.ts Outdated Show resolved Hide resolved
src/settings.ts Outdated Show resolved Hide resolved
webpack.config.js Outdated Show resolved Hide resolved
src/controllers/libraryController.ts Outdated Show resolved Hide resolved
jdneo
jdneo previously approved these changes Jan 7, 2020
}));
}
const setting = Settings.referencedLibraries();
setting.include.push(...libraryGlobs);
Copy link
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.

testforstephen
testforstephen previously approved these changes Jan 8, 2020
testforstephen
testforstephen previously approved these changes Jan 8, 2020
@jdneo 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