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

Lombok agent doesn't need to be configured if javac is enabled #3877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/lombokSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,23 @@ export function addLombokParam(context: ExtensionContext, params: string[]) {
// Exclude user setting Lombok agent parameter
const reg = /-javaagent:.*[\\|/]lombok.*\.jar/;
const deleteIndex = [];
let hasIndexer = false;
for (let i = 0; i < params.length; i++) {
if (reg.test(params[i])) {
deleteIndex.push(i);
}
hasIndexer = params[i] === "-DSourceIndexer.DOM_BASED_INDEXER=true";
}
for (let i = deleteIndex.length - 1; i >= 0; i--) {
params.splice(deleteIndex[i], 1);
}
// https://github.com/redhat-developer/vscode-java/issues/3875
// Lombok agent doesn't need to be configured if
// java.jdt.ls.javac.enabled=on; java.completion.engine=dom; -DSourceIndexer.DOM_BASED_INDEXER=true
if (hasIndexer && "on" === vscode.workspace.getConfiguration().get("java.jdt.ls.javac.enabled")
&& "dom" === vscode.workspace.getConfiguration().get("java.completion.engine")) {
return;
}
// add -javaagent arg to support Lombok.
// use the extension's Lombok version by default.
isExtensionLombok = true;
Expand Down