Skip to content

Commit

Permalink
When 'projectLombokPath' is updated to 'undefined' after removal, we
Browse files Browse the repository at this point in the history
clean the project's Lombok classpath cache.

Signed-off-by: Yuhao Xiao <[email protected]>
  • Loading branch information
Yuhao Xiao committed Jul 19, 2022
1 parent d9f6b5a commit ffe63f8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lombokSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,14 @@ export async function checkLombokDependency(context: ExtensionContext) {
for (const classpath of classpathResult.classpaths) {
if (lombokJarRegex.test(classpath)) {
currentLombokClasspath = classpath;
if (context.workspaceState.get(JAVA_LOMBOK_PATH)) {
if (activeLombokPath && !isExtensionLombok) {
currentLombokVersion = lombokJarRegex.exec(classpath)[0];
previousLombokVersion = lombokJarRegex.exec(context.workspaceState.get(JAVA_LOMBOK_PATH))[0];
previousLombokVersion = lombokJarRegex.exec(activeLombokPath)[0];
if (currentLombokVersion !== previousLombokVersion) {
needReload = true;
versionChange = true;
}
}
else {
needReload = true;
}
lombokFound = true;
break;
}
Expand All @@ -167,6 +164,7 @@ export async function checkLombokDependency(context: ExtensionContext) {
if (isLombokStatusBarInitialized && !projectLombokPath) {
runtimeStatusBarProvider.destroyLombokStatusBar();
isLombokStatusBarInitialized = false;
cleanupLombokCache(context);
}
if (needReload && !isExtensionLombok) {
if (versionChange) {
Expand Down

0 comments on commit ffe63f8

Please sign in to comment.