-
Notifications
You must be signed in to change notification settings - Fork 565
Lombok & VSCode #3082
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
Merged
+470
−44
Merged
Lombok & VSCode #3082
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
lib/src/lombokStubs/java/lombok/eclipse/agent/EclipseLoaderPatcherTransplants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Copyright 2026 DiffPlug | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package lombok.eclipse.agent; | ||
|
|
||
| /** | ||
| * Stub implementation of {@code lombok.eclipse.agent.EclipseLoaderPatcherTransplants} | ||
| * used only within the {@code FeatureClassLoader} isolation boundary. | ||
| */ | ||
| @SuppressWarnings("unused") | ||
| public class EclipseLoaderPatcherTransplants { | ||
|
|
||
| /** Stub – returns {@code false} so the normal class-loading path is used. */ | ||
| public static boolean overrideLoadDecide(ClassLoader classLoader, String name, boolean resolve) { | ||
| return false; | ||
| } | ||
|
|
||
| /** Stub – returns {@code null} so the caller falls through to normal loading. */ | ||
| public static Class<?> overrideLoadResult(ClassLoader classLoader, String name, boolean resolve) throws ClassNotFoundException { | ||
| return null; | ||
| } | ||
| } |
34 changes: 34 additions & 0 deletions
34
lib/src/lombokStubs/java/lombok/eclipse/agent/PatchDelegatePortal.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Copyright 2026 DiffPlug | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package lombok.eclipse.agent; | ||
|
|
||
| /** | ||
| * Stub implementation of {@code lombok.eclipse.agent.PatchDelegatePortal} | ||
| * used only within the {@code FeatureClassLoader} isolation boundary. | ||
| */ | ||
| @SuppressWarnings("unused") | ||
| public class PatchDelegatePortal { | ||
|
|
||
| /** Stub – always returns {@code false}. */ | ||
| public static boolean handleDelegateForType(Object classScope) { | ||
| return false; | ||
| } | ||
|
|
||
| /** Stub – returns an empty array. */ | ||
| public static Object[] addGeneratedDelegateMethods(Object returnValue, Object javaElement) { | ||
| return new Object[0]; | ||
| } | ||
| } |
38 changes: 38 additions & 0 deletions
38
lib/src/lombokStubs/java/lombok/eclipse/agent/PatchDiagnostics.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Copyright 2026 DiffPlug | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package lombok.eclipse.agent; | ||
|
|
||
| /** | ||
| * Stub implementation of {@code lombok.eclipse.agent.PatchDiagnostics} used | ||
| * only within the {@code FeatureClassLoader} isolation boundary. | ||
| * | ||
| * <p>When lombok is active as a JVM agent it patches ECJ's | ||
| * {@code ASTNode.setSourceRange} to call | ||
| * {@code PatchDiagnostics.setSourceRangeCheck}. The real class lives in | ||
| * lombok's shadow class-loader and is never reachable from | ||
| * {@code FeatureClassLoader}. This stub satisfies the call site so that | ||
| * source-range setting proceeds without a {@link NoSuchMethodError}. | ||
| * Returning {@code false} means "no override" — ECJ proceeds with its | ||
| * normal source-range assignment. | ||
| */ | ||
| @SuppressWarnings("unused") | ||
| public class PatchDiagnostics { | ||
|
|
||
| /** Stub – always returns {@code false} so ECJ applies its normal source-range logic. */ | ||
| public static boolean setSourceRangeCheck(Object node, int start, int end) { | ||
| return false; | ||
| } | ||
| } |
49 changes: 49 additions & 0 deletions
49
lib/src/lombokStubs/java/lombok/eclipse/agent/PatchFixesShadowLoaded.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| * Copyright 2026 DiffPlug | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package lombok.eclipse.agent; | ||
|
|
||
| import java.io.BufferedOutputStream; | ||
| import java.io.IOException; | ||
| import java.io.OutputStream; | ||
|
|
||
| /** | ||
| * Stub implementation of {@code lombok.eclipse.agent.PatchFixesShadowLoaded} | ||
| * used only within the {@code FeatureClassLoader} isolation boundary. | ||
| * Methods return their input unchanged; post-compiler steps are no-ops. | ||
| */ | ||
| @SuppressWarnings("unused") | ||
| public class PatchFixesShadowLoaded { | ||
|
|
||
| /** Stub – returns {@code origReturnValue} unchanged. */ | ||
| public static String addLombokNotesToEclipseAboutDialog(String origReturnValue, String key) { | ||
| return origReturnValue; | ||
| } | ||
|
|
||
| /** Stub – returns {@code bytes} unchanged. */ | ||
| public static byte[] runPostCompiler(byte[] bytes, String fileName) { | ||
| return bytes; | ||
| } | ||
|
|
||
| /** Stub – returns {@code out} unchanged. */ | ||
| public static OutputStream runPostCompiler(OutputStream out) throws IOException { | ||
| return out; | ||
| } | ||
|
|
||
| /** Stub – returns {@code out} unchanged. */ | ||
| public static BufferedOutputStream runPostCompiler(BufferedOutputStream out, String path, String name) throws IOException { | ||
| return out; | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
lib/src/lombokStubs/java/lombok/eclipse/agent/PatchJavadoc.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Copyright 2026 DiffPlug | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package lombok.eclipse.agent; | ||
|
|
||
| /** | ||
| * Stub implementation of {@code lombok.eclipse.agent.PatchJavadoc} | ||
| * used only within the {@code FeatureClassLoader} isolation boundary. | ||
| */ | ||
| @SuppressWarnings("unused") | ||
| public class PatchJavadoc { | ||
|
|
||
| /** Stub – returns {@code original} unchanged. */ | ||
| public static String getHTMLContentFromSource(Object instance, String original, Object member) { | ||
| return original; | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
lib/src/lombokStubs/java/lombok/eclipse/agent/PatchValEclipsePortal.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Copyright 2026 DiffPlug | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package lombok.eclipse.agent; | ||
|
|
||
| /** | ||
| * Stub implementation of {@code lombok.eclipse.agent.PatchValEclipsePortal} | ||
| * used only within the {@code FeatureClassLoader} isolation boundary. | ||
| * All methods are no-ops. | ||
| */ | ||
| @SuppressWarnings("unused") | ||
| public class PatchValEclipsePortal { | ||
|
|
||
| public static void copyInitializationOfForEachIterable(Object parser) {} | ||
|
|
||
| public static void copyInitializationOfLocalDeclaration(Object parser) {} | ||
|
|
||
| public static void addFinalAndValAnnotationToVariableDeclarationStatement(Object converter, Object out, Object in) {} | ||
|
|
||
| public static void addFinalAndValAnnotationToSingleVariableDeclaration(Object converter, Object out, Object in) {} | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving forward, how would you like us to maintain this
3.46.0version? Should we bump it to latest whenever a new version is released? Should we pin it here until/unless you open a PR that bumps it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nedtwigg Thanks for taking a look at this.
So I've looked at the history of the Eclipse code that is imported. It dates from >= 15 years ago (for
ASTNode) (and similarly forIMember) , whileASTVisitorwas created ~ early 2004 and has had additions (and some tiny removals for String Templates) since then for JDK versions - but as its used a parameter only this shouldn't affect it. So therefore I think this should be pinned and only reconsidered if there is perhaps a CVE or a fix needed.