diff --git a/eclipse-distribution/org.springframework.boot.ide.branding/about.properties b/eclipse-distribution/org.springframework.boot.ide.branding/about.properties index ddbb2ca81..f20da7974 100644 --- a/eclipse-distribution/org.springframework.boot.ide.branding/about.properties +++ b/eclipse-distribution/org.springframework.boot.ide.branding/about.properties @@ -10,7 +10,7 @@ Version: @QUALIFIER@\n\ Build Id: @BUILD_ID@\n\ Revision: @REVISION@\n\ \n\ -Copyright (c) 2007 - 2024 Broadcom\n\ +Copyright (c) 2007 - 2025 Broadcom\n\ All rights reserved. Visit https://spring.io/tools\n\ \n\ This product includes software developed by the\n\ diff --git a/eclipse-distribution/org.springframework.boot.ide.branding/plugin.properties b/eclipse-distribution/org.springframework.boot.ide.branding/plugin.properties index 07a97981f..557ce91cf 100644 --- a/eclipse-distribution/org.springframework.boot.ide.branding/plugin.properties +++ b/eclipse-distribution/org.springframework.boot.ide.branding/plugin.properties @@ -8,7 +8,7 @@ Version: @QUALIFIER@\n\ Build Id: @BUILD_ID@\n\ Revision: @REVISION@\n\ \n\ -Copyright (c) 2007 - 2024 Broadcom\n\ +Copyright (c) 2007 - 2025 Broadcom\n\ All rights reserved. Visit https://spring.io/tools\n\ \n\ This product includes software developed by the\n\ diff --git a/eclipse-extensions/org.springframework.boot.ide.main.feature/feature.properties b/eclipse-extensions/org.springframework.boot.ide.main.feature/feature.properties index aa23fd796..c895d96d4 100644 --- a/eclipse-extensions/org.springframework.boot.ide.main.feature/feature.properties +++ b/eclipse-extensions/org.springframework.boot.ide.main.feature/feature.properties @@ -4,7 +4,7 @@ This feature contains the Eclipse-UI-specific STS 4 components # "copyright" property - text of the Copyright copyright=\ -Copyright (c) 2024 Broadcom +Copyright (c) 2025 Broadcom ################ end of copyright property #################################### diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls.feature/feature.properties b/eclipse-language-servers/org.springframework.tooling.boot.ls.feature/feature.properties index 8a380a02d..aaef2acee 100644 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls.feature/feature.properties +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls.feature/feature.properties @@ -4,7 +4,7 @@ Spring Boot Language Server # "copyright" property - text of the Copyright copyright=\ -Copyright (c) 2024 Broadcom +Copyright (c) 2025 Broadcom ################ end of copyright property #################################### diff --git a/eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/feature.properties b/eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/feature.properties index 12d34c301..d87a10c86 100644 --- a/eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/feature.properties +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/feature.properties @@ -4,7 +4,7 @@ BOSH Manifest Language Server # "copyright" property - text of the Copyright copyright=\ -Copyright (c) 2024 Broadcom +Copyright (c) 2025 Broadcom ################ end of copyright property #################################### diff --git a/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.feature/feature.properties b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.feature/feature.properties index 67a955e0c..60d2811c2 100644 --- a/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.feature/feature.properties +++ b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.feature/feature.properties @@ -5,7 +5,7 @@ description=\ This feature provides the language server to support editing cloud foundry manifest files copyright=\ -Copyright (c) 2024 Broadcom +Copyright (c) 2025 Broadcom ################ end of copyright property #################################### diff --git a/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/feature.properties b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/feature.properties index cbdb89d9c..fda2278b9 100644 --- a/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/feature.properties +++ b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/feature.properties @@ -4,7 +4,7 @@ Integeation of the Cloud Foundry Manifest Language Server Extension into the Gen # "copyright" property - text of the Copyright copyright=\ -Copyright (c) 2024 Broadcom +Copyright (c) 2025 Broadcom ################ end of copyright property #################################### diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/feature.properties b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/feature.properties index 9abd9e2f9..b24b5e85d 100644 --- a/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/feature.properties +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/feature.properties @@ -4,7 +4,7 @@ Concourse Pipeline and Task Language Server # "copyright" property - text of the Copyright copyright=\ -Copyright (c) 2024 Broadcom +Copyright (c) 2025 Broadcom ################ end of copyright property #################################### diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java index 02e2b4609..ad3e1d072 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/JdtConfig.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndex.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndex.java index be47fb217..5ccc75a24 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndex.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndex.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2024 Pivotal, Inc. + * Copyright (c) 2017, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,7 +25,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.CompletableFuture; @@ -57,7 +56,6 @@ import org.springframework.ide.vscode.boot.index.cache.IndexCache; import org.springframework.ide.vscode.boot.java.BootJavaLanguageServerComponents; import org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchyAwareLookup; import org.springframework.ide.vscode.boot.java.handlers.EnhancedSymbolInformation; -import org.springframework.ide.vscode.boot.java.handlers.SymbolAddOnInformation; import org.springframework.ide.vscode.boot.java.handlers.SymbolProvider; import org.springframework.ide.vscode.boot.java.reconcilers.JdtReconciler; import org.springframework.ide.vscode.boot.java.utils.CompilationUnitCache; @@ -747,42 +745,6 @@ public class SpringSymbolIndex implements InitializingBean, SpringIndex { } } - public List getAllAdditionalInformation(Predicate filter) { - if (filter != null) { - synchronized(symbols) { - return symbols.stream() - .map(s -> s.getAdditionalInformation()) - .filter(Objects::nonNull) - .flatMap(i -> Arrays.stream(i)) - .filter(filter) - .collect(Collectors.toList()); - } - } - else { - return Collections.emptyList(); - } - } - - public List getAdditonalInformation(String docURI) { - List info = this.symbolsByDoc.get(docURI); - - if (info != null) { - synchronized(info) { - ImmutableList.Builder builder = ImmutableList.builder(); - for (EnhancedSymbolInformation enhanced : info) { - SymbolAddOnInformation[] additionalInformation = enhanced.getAdditionalInformation(); - if (additionalInformation != null) { - builder.add(additionalInformation); - } - } - return builder.build(); - } - } - else { - return Collections.emptyList(); - } - } - @Override public CompletableFuture> beans(BeansParams params) { String projectName = params.getProjectName(); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndexerConfig.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndexerConfig.java index 80d66084a..25c71eb5d 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndexerConfig.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndexerConfig.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Pivotal, Inc. + * Copyright (c) 2019, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/SpringMetamodelIndex.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/SpringMetamodelIndex.java index 0cabc5ca4..6a18b5698 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/SpringMetamodelIndex.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/SpringMetamodelIndex.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDisc.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDisc.java index d5df39dcf..48f4b69c3 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDisc.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDisc.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Pivotal, Inc. + * Copyright (c) 2019, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,7 +34,6 @@ import org.apache.commons.lang3.tuple.Pair; import org.eclipse.lsp4j.Location; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.ide.vscode.boot.java.handlers.SymbolAddOnInformation; import org.springframework.ide.vscode.commons.protocol.spring.AnnotationMetadata; import org.springframework.ide.vscode.commons.protocol.spring.Bean; import org.springframework.ide.vscode.commons.protocol.spring.DefaultValues; @@ -52,9 +51,6 @@ import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; -import com.google.gson.JsonPrimitive; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -351,7 +347,6 @@ public class IndexCacheOnDisc implements IndexCache { public static Gson createGson() { return new GsonBuilder() - .registerTypeAdapter(SymbolAddOnInformation.class, new SymbolAddOnInformationAdapter()) .registerTypeAdapter(Bean.class, new BeanJsonAdapter()) .registerTypeAdapter(InjectionPoint.class, new InjectionPointJsonAdapter()) .registerTypeAdapter(IndexCacheStore.class, new IndexCacheStoreAdapter()) @@ -426,33 +421,6 @@ public class IndexCacheOnDisc implements IndexCache { } - /** - * gson adapter to store subtype information for symbol addon informations - */ - private static class SymbolAddOnInformationAdapter implements JsonSerializer, JsonDeserializer { - - @Override - public JsonElement serialize(SymbolAddOnInformation addonInfo, Type typeOfSrc, JsonSerializationContext context) { - JsonObject result = new JsonObject(); - result.add("type", new JsonPrimitive(addonInfo.getClass().getName())); - result.add("data", context.serialize(addonInfo)); - return result; - } - - @Override - public SymbolAddOnInformation deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { - JsonObject parsedObject = json.getAsJsonObject(); - String className = parsedObject.get("type").getAsString(); - JsonElement element = parsedObject.get("data"); - - try { - return context.deserialize(element, Class.forName(className)); - } catch (ClassNotFoundException cnfe) { - throw new JsonParseException("cannot parse data from unknown SymbolAddOnInformation subtype: " + type, cnfe); - } - } - } - /** * gson adapter to store subtype information for beans */ diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDiscDeltaBased.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDiscDeltaBased.java index 0a1e909cb..d83032101 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDiscDeltaBased.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDiscDeltaBased.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,6 @@ import org.apache.commons.lang3.tuple.Pair; import org.eclipse.lsp4j.Location; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.ide.vscode.boot.java.handlers.SymbolAddOnInformation; import org.springframework.ide.vscode.commons.protocol.spring.AnnotationMetadata; import org.springframework.ide.vscode.commons.protocol.spring.Bean; import org.springframework.ide.vscode.commons.protocol.spring.DefaultValues; @@ -371,7 +370,6 @@ public class IndexCacheOnDiscDeltaBased implements IndexCache { public static Gson createGson() { return new GsonBuilder() .registerTypeAdapter(DeltaStorage.class, new DeltaStorageAdapter()) - .registerTypeAdapter(SymbolAddOnInformation.class, new SymbolAddOnInformationAdapter()) .registerTypeAdapter(Bean.class, new BeanJsonAdapter()) .registerTypeAdapter(InjectionPoint.class, new InjectionPointJsonAdapter()) .registerTypeAdapter(IndexCacheStore.class, new IndexCacheStoreAdapter()) @@ -637,30 +635,6 @@ public class IndexCacheOnDiscDeltaBased implements IndexCache { } } - private static class SymbolAddOnInformationAdapter implements JsonSerializer, JsonDeserializer { - - @Override - public JsonElement serialize(SymbolAddOnInformation addonInfo, Type typeOfSrc, JsonSerializationContext context) { - JsonObject result = new JsonObject(); - result.add("type", new JsonPrimitive(addonInfo.getClass().getName())); - result.add("data", context.serialize(addonInfo)); - return result; - } - - @Override - public SymbolAddOnInformation deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { - JsonObject parsedObject = json.getAsJsonObject(); - String className = parsedObject.get("type").getAsString(); - JsonElement element = parsedObject.get("data"); - - try { - return context.deserialize(element, Class.forName(className)); - } catch (ClassNotFoundException cnfe) { - throw new JsonParseException("cannot parse data from unknown SymbolAddOnInformation subtype: " + type, cnfe); - } - } - } - private static class BeanJsonAdapter implements JsonDeserializer { @Override diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaLanguageServerComponents.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaLanguageServerComponents.java index 91d3bd691..422c0411c 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaLanguageServerComponents.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/BootJavaLanguageServerComponents.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2024 Pivotal, Inc. + * Copyright (c) 2016, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/BeansSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/BeansSymbolProvider.java index 070247c86..dd8efdf31 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/BeansSymbolProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/BeansSymbolProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2024 Pivotal, Inc. + * Copyright (c) 2017, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,6 +18,7 @@ import java.util.Set; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.Annotation; +import org.eclipse.jdt.core.dom.Block; import org.eclipse.jdt.core.dom.IAnnotationBinding; import org.eclipse.jdt.core.dom.ITypeBinding; import org.eclipse.jdt.core.dom.MethodDeclaration; @@ -39,8 +40,8 @@ import org.springframework.ide.vscode.boot.java.requestmapping.WebfluxRouterSymb import org.springframework.ide.vscode.boot.java.utils.ASTUtils; import org.springframework.ide.vscode.boot.java.utils.CachedSymbol; import org.springframework.ide.vscode.boot.java.utils.FunctionUtils; -import org.springframework.ide.vscode.boot.java.utils.SpringIndexerJavaContext; import org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.SCAN_PASS; +import org.springframework.ide.vscode.boot.java.utils.SpringIndexerJavaContext; import org.springframework.ide.vscode.commons.protocol.spring.AnnotationMetadata; import org.springframework.ide.vscode.commons.protocol.spring.Bean; import org.springframework.ide.vscode.commons.protocol.spring.InjectionPoint; @@ -62,7 +63,6 @@ import reactor.util.function.Tuples; public class BeansSymbolProvider extends AbstractSymbolProvider { private static final Logger log = LoggerFactory.getLogger(BeansSymbolProvider.class); - private static final String[] NAME_ATTRIBUTES = {"value", "name"}; @Override @@ -73,21 +73,23 @@ public class BeansSymbolProvider extends AbstractSymbolProvider { if (parent == null || !(parent instanceof MethodDeclaration)) return; MethodDeclaration method = (MethodDeclaration) parent; - if (isMethodAbstract(method)) return; + List childElements = new ArrayList<>(); + boolean isWebfluxRouter = WebfluxRouterSymbolProvider.isWebfluxRouterBean(method); // for webflux details, we need full method body ASTs - if (isWebfluxRouter && SCAN_PASS.ONE.equals(context.getPass())) { - context.getNextPassFiles().add(context.getFile()); - return; - } - - List childElements = new ArrayList<>(); - if (isWebfluxRouter) { - WebfluxRouterSymbolProvider.createWebfluxElements(method, context, doc, childElements); + Block methodBody = method.getBody(); + if ((methodBody == null || methodBody.statements() == null || methodBody.statements().size() == 0) + && SCAN_PASS.ONE.equals(context.getPass())) { + context.getNextPassFiles().add(context.getFile()); + return; + } + else { + WebfluxRouterSymbolProvider.createWebfluxElements(method, context, doc, childElements); + } } boolean isFunction = isFunctionBean(method); @@ -103,8 +105,7 @@ public class BeansSymbolProvider extends AbstractSymbolProvider { new WorkspaceSymbol( beanLabel(isFunction, nameAndRegion.getT1(), beanType.getName(), "@Bean" + markerString), SymbolKind.Interface, - Either.forLeft(location)), - null + Either.forLeft(location)) ); InjectionPoint[] injectionPoints = ASTUtils.findInjectionPoints(method, doc); @@ -142,7 +143,7 @@ public class BeansSymbolProvider extends AbstractSymbolProvider { Either.forLeft(beanLocation)); context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), - new EnhancedSymbolInformation(symbol, null))); + new EnhancedSymbolInformation(symbol))); ITypeBinding concreteBeanType = typeDeclaration.resolveBinding(); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/ComponentSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/ComponentSymbolProvider.java index 225777733..515dffff0 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/ComponentSymbolProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/ComponentSymbolProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2024 Pivotal, Inc. + * Copyright (c) 2017, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -62,7 +62,7 @@ public class ComponentSymbolProvider extends AbstractSymbolProvider { } else if (Annotations.NAMED_ANNOTATIONS.contains(annotationType.getQualifiedName())) { WorkspaceSymbol symbol = DefaultSymbolProvider.provideDefaultSymbol(node, doc); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), enhancedSymbol)); } } @@ -108,7 +108,7 @@ public class ComponentSymbolProvider extends AbstractSymbolProvider { Bean beanDefinition = new Bean(beanName, beanType.getQualifiedName(), location, injectionPoints, supertypes, annotations, isConfiguration); - return Tuple.two(new EnhancedSymbolInformation(symbol, null), beanDefinition); + return Tuple.two(new EnhancedSymbolInformation(symbol), beanDefinition); } protected String beanLabel(String searchPrefix, String annotationTypeName, Collection metaAnnotationNames, String beanName, String beanType) { diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/FeignClientSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/FeignClientSymbolProvider.java index a70714363..896d8d316 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/FeignClientSymbolProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/FeignClientSymbolProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -97,7 +97,7 @@ public class FeignClientSymbolProvider extends AbstractSymbolProvider { Bean beanDefinition = new Bean(beanName, beanType == null ? "" : beanType.getQualifiedName(), location, injectionPoints, supertypes, annotations, false); - return Tuple.two(new EnhancedSymbolInformation(symbol, null), beanDefinition); + return Tuple.two(new EnhancedSymbolInformation(symbol), beanDefinition); } protected String beanLabel(String searchPrefix, String annotationTypeName, Collection metaAnnotationNames, String beanName, String beanType) { diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/data/DataRepositorySymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/data/DataRepositorySymbolProvider.java index f200d020a..587a1f982 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/data/DataRepositorySymbolProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/data/DataRepositorySymbolProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2024 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,7 +63,7 @@ public class DataRepositorySymbolProvider extends AbstractSymbolProvider { SymbolKind.Interface, Either.forLeft(location)); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); InjectionPoint[] injectionPoints = ASTUtils.findInjectionPoints(typeDeclaration, doc); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/EnhancedSymbolInformation.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/EnhancedSymbolInformation.java index 2627be24b..36d944690 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/EnhancedSymbolInformation.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/EnhancedSymbolInformation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2022 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,21 +18,15 @@ import org.eclipse.lsp4j.WorkspaceSymbol; public class EnhancedSymbolInformation { private final WorkspaceSymbol symbol; - private final SymbolAddOnInformation[] additionalInformation; - public EnhancedSymbolInformation(WorkspaceSymbol symbol, SymbolAddOnInformation[] additionalInformation) { + public EnhancedSymbolInformation(WorkspaceSymbol symbol) { this.symbol = symbol; - this.additionalInformation = additionalInformation; } public WorkspaceSymbol getSymbol() { return symbol; } - public SymbolAddOnInformation[] getAdditionalInformation() { - return additionalInformation; - } - @Override public String toString() { return "EnhancedSymbolInformation [symbol=" + symbol + "]"; diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/SymbolAddOnInformation.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/SymbolAddOnInformation.java deleted file mode 100644 index 882f0df4d..000000000 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/SymbolAddOnInformation.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018 Pivotal, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Pivotal, Inc. - initial API and implementation - *******************************************************************************/ -package org.springframework.ide.vscode.boot.java.handlers; - -/** - * @author Martin Lippert - */ -public interface SymbolAddOnInformation { -} diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/AddConfigurationIfBeansPresentReconciler.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/AddConfigurationIfBeansPresentReconciler.java index 394d8cb1d..5da190300 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/AddConfigurationIfBeansPresentReconciler.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/AddConfigurationIfBeansPresentReconciler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/NotRegisteredBeansReconciler.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/NotRegisteredBeansReconciler.java index 8a4ed10dd..17becd364 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/NotRegisteredBeansReconciler.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/reconcilers/NotRegisteredBeansReconciler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingSymbolProvider.java index ff05a1d60..8205d8fb7 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingSymbolProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingSymbolProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2024 Pivotal, Inc. + * Copyright (c) 2017, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -69,7 +69,7 @@ public class RequestMappingSymbolProvider extends AbstractSymbolProvider { .filter(Objects::nonNull).map(p -> { return combinePath(parent, p); })) - .map(p -> RouteUtils.createRouteSymbol(location, p, methods, contentTypes, acceptTypes, null)) + .map(p -> RouteUtils.createRouteSymbol(location, p, methods, contentTypes, acceptTypes)) .forEach((enhancedSymbol) -> context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), enhancedSymbol))); } catch (Exception e) { log.error("problem occured while scanning for request mapping symbols from " + doc.getUri(), e); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RouteUtils.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RouteUtils.java index 598d9ce85..220022e3b 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RouteUtils.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RouteUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,7 +15,6 @@ import org.eclipse.lsp4j.SymbolKind; import org.eclipse.lsp4j.WorkspaceSymbol; import org.eclipse.lsp4j.jsonrpc.messages.Either; import org.springframework.ide.vscode.boot.java.handlers.EnhancedSymbolInformation; -import org.springframework.ide.vscode.boot.java.handlers.SymbolAddOnInformation; /** * @author Martin Lippert @@ -23,7 +22,7 @@ import org.springframework.ide.vscode.boot.java.handlers.SymbolAddOnInformation; public class RouteUtils { public static EnhancedSymbolInformation createRouteSymbol(Location location, String path, - String[] httpMethods, String[] contentTypes, String[] acceptTypes, SymbolAddOnInformation[] enhancedInformation) { + String[] httpMethods, String[] contentTypes, String[] acceptTypes) { if (path != null && path.length() > 0) { String label = "@" + (path.startsWith("/") ? path : ("/" + path)); @@ -35,7 +34,7 @@ public class RouteUtils { String contentType = WebfluxUtils.getStringRep(contentTypes, WebfluxUtils::getMediaType); label += contentType != null ? " - Content-Type: " + contentType : ""; - return new EnhancedSymbolInformation(new WorkspaceSymbol(label, SymbolKind.Interface, Either.forLeft(location)), enhancedInformation); + return new EnhancedSymbolInformation(new WorkspaceSymbol(label, SymbolKind.Interface, Either.forLeft(location))); } else { return null; diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerCodeLensProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerCodeLensProvider.java index 775b90229..a7a6575dc 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerCodeLensProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerCodeLensProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2024 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerMethodIndexElement.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerMethodIndexElement.java index 53e50d4d9..37d45693f 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerMethodIndexElement.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxHandlerMethodIndexElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteElementRangesIndexElement.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteElementRangesIndexElement.java index 2ac1bf851..d6e8d4d74 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteElementRangesIndexElement.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteElementRangesIndexElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteHighlightProdivder.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteHighlightProdivder.java index a72ce779b..4a2e3f7ae 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteHighlightProdivder.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouteHighlightProdivder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2024 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouterSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouterSymbolProvider.java index 8b9fd30c5..58151a96b 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouterSymbolProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouterSymbolProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2024 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -132,7 +132,7 @@ public class WebfluxRouterSymbolProvider { if (elements != null) indexElementsCollector.add(elements); EnhancedSymbolInformation enhancedSymbol = RouteUtils.createRouteSymbol(location, path, getElementStrings(httpMethods), - getElementStrings(contentTypes), getElementStrings(acceptTypes), null); + getElementStrings(contentTypes), getElementStrings(acceptTypes)); context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), enhancedSymbol)); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxUtils.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxUtils.java index 218aa991c..8a4ee9f98 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxUtils.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2024 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/RestrictedDefaultSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/RestrictedDefaultSymbolProvider.java index aedd2ccea..3adfffa85 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/RestrictedDefaultSymbolProvider.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/RestrictedDefaultSymbolProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2023 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ public class RestrictedDefaultSymbolProvider extends AbstractSymbolProvider { // provide default symbol only in case this annotation is not combined with @Bean annotation if (!isCombinedWithAnnotation(node, Annotations.BEAN)) { try { - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(DefaultSymbolProvider.provideDefaultSymbol(node, doc), null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(DefaultSymbolProvider.provideDefaultSymbol(node, doc)); context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), enhancedSymbol)); } catch (Exception e) { log.warn(e.getMessage()); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringFactoriesIndexer.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringFactoriesIndexer.java index 3582b1816..be949db14 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringFactoriesIndexer.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringFactoriesIndexer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -58,7 +58,7 @@ public class SpringFactoriesIndexer implements SpringIndexer { // whenever the implementation of the indexer changes in a way that the stored data in the cache is no longer valid, // we need to change the generation - this will result in a re-indexing due to no up-to-date cache data being found - private static final String GENERATION = "GEN-7"; + private static final String GENERATION = "GEN-8"; private static final String FILE_PATTERN = "**/META-INF/spring/*.factories"; @@ -121,7 +121,7 @@ public class SpringFactoriesIndexer implements SpringIndexer { symbols.add(new EnhancedSymbolInformation(new WorkspaceSymbol( BeansSymbolProvider.beanLabel(false, beanId, fqName, Paths.get(URI.create(docURI)).getFileName().toString()), SymbolKind.Interface, - Either.forLeft(new Location(docURI, range))), null)); + Either.forLeft(new Location(docURI, range))))); } catch (Exception e) { log.error("", e); } diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerJava.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerJava.java index 5bbc6f6ee..3c1f4d095 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerJava.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerJava.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2024 Pivotal, Inc. + * Copyright (c) 2017, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -93,7 +93,7 @@ public class SpringIndexerJava implements SpringIndexer { // whenever the implementation of the indexer changes in a way that the stored data in the cache is no longer valid, // we need to change the generation - this will result in a re-indexing due to no up-to-date cache data being found - private static final String GENERATION = "GEN-11"; + private static final String GENERATION = "GEN-12"; private static final String INDEX_FILES_TASK_ID = "index-java-source-files-task-"; private static final String SYMBOL_KEY = "symbols"; @@ -770,7 +770,7 @@ public class SpringIndexerJava implements SpringIndexer { } else { WorkspaceSymbol symbol = provideDefaultSymbol(node, context); if (symbol != null) { - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), enhancedSymbol)); } } diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXML.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXML.java index 798dc11c7..de228b13b 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXML.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXML.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Pivotal, Inc. + * Copyright (c) 2019, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -54,7 +54,7 @@ public class SpringIndexerXML implements SpringIndexer { // whenever the implementation of the indexer changes in a way that the stored data in the cache is no longer valid, // we need to change the generation - this will result in a re-indexing due to no up-to-date cache data being found - private static final String GENERATION = "GEN-6"; + private static final String GENERATION = "GEN-7"; private static final String SYMBOL_KEY = "symbols"; private static final String BEANS_KEY = "beans"; diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXMLNamespaceHandlerBeans.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXMLNamespaceHandlerBeans.java index f527e42ab..232795819 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXMLNamespaceHandlerBeans.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXMLNamespaceHandlerBeans.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Pivotal, Inc. + * Copyright (c) 2019, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -92,7 +92,7 @@ public class SpringIndexerXMLNamespaceHandlerBeans implements SpringIndexerXMLNa } WorkspaceSymbol symbol = new WorkspaceSymbol("@+ '" + beanID + "' " + beanClass, SymbolKind.Interface, Either.forLeft(new Location(docURI, range))); - EnhancedSymbolInformation fullSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation fullSymbol = new EnhancedSymbolInformation(symbol); CachedSymbol cachedSymbol = new CachedSymbol(docURI, lastModified, fullSymbol); generatedSymbols.add(cachedSymbol); diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscDeltaBasedTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscDeltaBasedTest.java index dae0519d2..8c6509b39 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscDeltaBasedTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscDeltaBasedTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -89,7 +89,7 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); generatedSymbols.add(new CachedSymbol("", timeFile1.toMillis(), enhancedSymbol)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols, ImmutableMultimap.of( @@ -107,7 +107,6 @@ public class IndexCacheOnDiscDeltaBasedTest { assertEquals("symbol1", cachedSymbols[0].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[0].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))), cachedSymbols[0].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[0].getEnhancedSymbol().getAdditionalInformation()); Multimap dependencies = result.getRight(); assertEquals(2, dependencies.keySet().size()); @@ -133,7 +132,7 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); generatedSymbols.add(new CachedSymbol("", timeFile1.toMillis(), enhancedSymbol)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols, null, CachedSymbol.class); @@ -157,7 +156,7 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); generatedSymbols.add(new CachedSymbol("", timeFile1.toMillis(), enhancedSymbol)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols, ImmutableMultimap.of( @@ -268,17 +267,17 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols1 = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols1.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols1, null, CachedSymbol.class); List generatedSymbols2 = new ArrayList<>(); symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Interface, Either.forLeft(new Location(doc1URI, new Range(new Position(5, 5), new Position(5, 10))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols2.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, enhancedSymbol1)); generatedSymbols2.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, enhancedSymbol2)); @@ -305,7 +304,7 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols1 = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols1.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols1, null, CachedSymbol.class); @@ -369,15 +368,15 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); WorkspaceSymbol symbol3 = new WorkspaceSymbol("symbol3", SymbolKind.Field, Either.forLeft(new Location(doc3URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3, null); + EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3); generatedSymbols.add(new CachedSymbol(doc3URI, timeFile3.toMillis(), enhancedSymbol3)); // store original version of the symbols to the cache @@ -388,17 +387,17 @@ public class IndexCacheOnDiscDeltaBasedTest { List updatedSymbols = new ArrayList<>(); WorkspaceSymbol updatedSymbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation updatedEnhancedSymbol1 = new EnhancedSymbolInformation(updatedSymbol1, null); + EnhancedSymbolInformation updatedEnhancedSymbol1 = new EnhancedSymbolInformation(updatedSymbol1); WorkspaceSymbol newSymbol1 = new WorkspaceSymbol("symbol1-new", SymbolKind.Interface, Either.forLeft(new Location(doc1URI, new Range(new Position(5, 5), new Position(5, 10))))); - EnhancedSymbolInformation newEnhancedSymbol1 = new EnhancedSymbolInformation(newSymbol1, null); + EnhancedSymbolInformation newEnhancedSymbol1 = new EnhancedSymbolInformation(newSymbol1); updatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, updatedEnhancedSymbol1)); updatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, newEnhancedSymbol1)); assertTrue(file1.toFile().setLastModified(timeFile1.toMillis() + 2000)); WorkspaceSymbol updatedSymbol2 = new WorkspaceSymbol("symbol2-updated", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation updatedEnhancedSymbol2 = new EnhancedSymbolInformation(updatedSymbol2, null); + EnhancedSymbolInformation updatedEnhancedSymbol2 = new EnhancedSymbolInformation(updatedSymbol2); updatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis() + 3000, updatedEnhancedSymbol2)); assertTrue(file2.toFile().setLastModified(timeFile2.toMillis() + 3000)); @@ -472,7 +471,7 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols1 = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols1.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols1, null, CachedSymbol.class); @@ -533,14 +532,14 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols1 = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols1.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols1, null, CachedSymbol.class); List generatedSymbols2 = new ArrayList<>(); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Interface, Either.forLeft(new Location(doc2URI, new Range(new Position(5, 5), new Position(5, 10))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols2.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); @@ -605,10 +604,10 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); generatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); @@ -629,7 +628,6 @@ public class IndexCacheOnDiscDeltaBasedTest { assertEquals("symbol2", cachedSymbols[0].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[0].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))), cachedSymbols[0].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[0].getEnhancedSymbol().getAdditionalInformation()); Multimap cachedDependencies = result.getRight(); assertEquals(ImmutableSet.of(), cachedDependencies.get(file1.toString())); @@ -667,16 +665,16 @@ public class IndexCacheOnDiscDeltaBasedTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); WorkspaceSymbol symbol3 = new WorkspaceSymbol("symbol3", SymbolKind.Field, Either.forLeft(new Location(doc3URI, new Range(new Position(20, 11), new Position(20, 30))))); - EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3, null); + EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3); WorkspaceSymbol symbol4 = new WorkspaceSymbol("symbol4", SymbolKind.Field, Either.forLeft(new Location(doc4URI, new Range(new Position(4, 4), new Position(5, 5))))); - EnhancedSymbolInformation enhancedSymbol4 = new EnhancedSymbolInformation(symbol4, null); + EnhancedSymbolInformation enhancedSymbol4 = new EnhancedSymbolInformation(symbol4); generatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); generatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); @@ -701,12 +699,10 @@ public class IndexCacheOnDiscDeltaBasedTest { assertEquals("symbol2", cachedSymbols[0].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[0].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))), cachedSymbols[0].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[0].getEnhancedSymbol().getAdditionalInformation()); assertEquals("symbol4", cachedSymbols[1].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[1].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location(doc4URI, new Range(new Position(4, 4), new Position(5, 5))), cachedSymbols[1].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[1].getEnhancedSymbol().getAdditionalInformation()); Multimap cachedDependencies = result.getRight(); assertEquals(ImmutableSet.of(), cachedDependencies.get(file1.toString())); diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscTest.java index ea693c834..37ae7c07c 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/cache/test/IndexCacheOnDiscTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2023 Pivotal, Inc. + * Copyright (c) 2019, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -87,7 +87,7 @@ public class IndexCacheOnDiscTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); generatedSymbols.add(new CachedSymbol("", timeFile1.toMillis(), enhancedSymbol)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols, ImmutableMultimap.of( @@ -105,7 +105,6 @@ public class IndexCacheOnDiscTest { assertEquals("symbol1", cachedSymbols[0].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[0].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))), cachedSymbols[0].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[0].getEnhancedSymbol().getAdditionalInformation()); Multimap dependencies = result.getRight(); assertEquals(2, dependencies.keySet().size()); @@ -131,7 +130,7 @@ public class IndexCacheOnDiscTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); generatedSymbols.add(new CachedSymbol("", timeFile1.toMillis(), enhancedSymbol)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols, null, CachedSymbol.class); @@ -155,7 +154,7 @@ public class IndexCacheOnDiscTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol, null); + EnhancedSymbolInformation enhancedSymbol = new EnhancedSymbolInformation(symbol); generatedSymbols.add(new CachedSymbol("", timeFile1.toMillis(), enhancedSymbol)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols, ImmutableMultimap.of( @@ -266,17 +265,17 @@ public class IndexCacheOnDiscTest { List generatedSymbols1 = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols1.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols1, null, CachedSymbol.class); List generatedSymbols2 = new ArrayList<>(); symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Interface, Either.forLeft(new Location(doc1URI, new Range(new Position(5, 5), new Position(5, 10))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols2.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, enhancedSymbol1)); generatedSymbols2.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, enhancedSymbol2)); @@ -315,15 +314,15 @@ public class IndexCacheOnDiscTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); WorkspaceSymbol symbol3 = new WorkspaceSymbol("symbol3", SymbolKind.Field, Either.forLeft(new Location(doc3URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3, null); + EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3); generatedSymbols.add(new CachedSymbol(doc3URI, timeFile3.toMillis(), enhancedSymbol3)); // store original version of the symbols to the cache @@ -334,17 +333,17 @@ public class IndexCacheOnDiscTest { List updatedSymbols = new ArrayList<>(); WorkspaceSymbol updatedSymbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation updatedEnhancedSymbol1 = new EnhancedSymbolInformation(updatedSymbol1, null); + EnhancedSymbolInformation updatedEnhancedSymbol1 = new EnhancedSymbolInformation(updatedSymbol1); WorkspaceSymbol newSymbol1 = new WorkspaceSymbol("symbol1-new", SymbolKind.Interface, Either.forLeft(new Location(doc1URI, new Range(new Position(5, 5), new Position(5, 10))))); - EnhancedSymbolInformation newEnhancedSymbol1 = new EnhancedSymbolInformation(newSymbol1, null); + EnhancedSymbolInformation newEnhancedSymbol1 = new EnhancedSymbolInformation(newSymbol1); updatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, updatedEnhancedSymbol1)); updatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis() + 2000, newEnhancedSymbol1)); assertTrue(file1.toFile().setLastModified(timeFile1.toMillis() + 2000)); WorkspaceSymbol updatedSymbol2 = new WorkspaceSymbol("symbol2-updated", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation updatedEnhancedSymbol2 = new EnhancedSymbolInformation(updatedSymbol2, null); + EnhancedSymbolInformation updatedEnhancedSymbol2 = new EnhancedSymbolInformation(updatedSymbol2); updatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis() + 3000, updatedEnhancedSymbol2)); assertTrue(file2.toFile().setLastModified(timeFile2.toMillis() + 3000)); @@ -418,7 +417,7 @@ public class IndexCacheOnDiscTest { List generatedSymbols1 = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location("docURI", new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols1.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols1, null, CachedSymbol.class); @@ -479,14 +478,14 @@ public class IndexCacheOnDiscTest { List generatedSymbols1 = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); generatedSymbols1.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); cache.store(CACHE_KEY_VERSION_1, files, generatedSymbols1, null, CachedSymbol.class); List generatedSymbols2 = new ArrayList<>(); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Interface, Either.forLeft(new Location(doc2URI, new Range(new Position(5, 5), new Position(5, 10))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols2.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); @@ -551,10 +550,10 @@ public class IndexCacheOnDiscTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); generatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); generatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); @@ -575,7 +574,6 @@ public class IndexCacheOnDiscTest { assertEquals("symbol2", cachedSymbols[0].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[0].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))), cachedSymbols[0].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[0].getEnhancedSymbol().getAdditionalInformation()); Multimap cachedDependencies = result.getRight(); assertEquals(ImmutableSet.of(), cachedDependencies.get(file1.toString())); @@ -613,16 +611,16 @@ public class IndexCacheOnDiscTest { List generatedSymbols = new ArrayList<>(); WorkspaceSymbol symbol1 = new WorkspaceSymbol("symbol1", SymbolKind.Field, Either.forLeft(new Location(doc1URI, new Range(new Position(3, 10), new Position(3, 20))))); - EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1, null); + EnhancedSymbolInformation enhancedSymbol1 = new EnhancedSymbolInformation(symbol1); WorkspaceSymbol symbol2 = new WorkspaceSymbol("symbol2", SymbolKind.Field, Either.forLeft(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))))); - EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2, null); + EnhancedSymbolInformation enhancedSymbol2 = new EnhancedSymbolInformation(symbol2); WorkspaceSymbol symbol3 = new WorkspaceSymbol("symbol3", SymbolKind.Field, Either.forLeft(new Location(doc3URI, new Range(new Position(20, 11), new Position(20, 30))))); - EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3, null); + EnhancedSymbolInformation enhancedSymbol3 = new EnhancedSymbolInformation(symbol3); WorkspaceSymbol symbol4 = new WorkspaceSymbol("symbol4", SymbolKind.Field, Either.forLeft(new Location(doc4URI, new Range(new Position(4, 4), new Position(5, 5))))); - EnhancedSymbolInformation enhancedSymbol4 = new EnhancedSymbolInformation(symbol4, null); + EnhancedSymbolInformation enhancedSymbol4 = new EnhancedSymbolInformation(symbol4); generatedSymbols.add(new CachedSymbol(doc1URI, timeFile1.toMillis(), enhancedSymbol1)); generatedSymbols.add(new CachedSymbol(doc2URI, timeFile2.toMillis(), enhancedSymbol2)); @@ -647,12 +645,10 @@ public class IndexCacheOnDiscTest { assertEquals("symbol2", cachedSymbols[0].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[0].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location(doc2URI, new Range(new Position(5, 10), new Position(5, 20))), cachedSymbols[0].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[0].getEnhancedSymbol().getAdditionalInformation()); assertEquals("symbol4", cachedSymbols[1].getEnhancedSymbol().getSymbol().getName()); assertEquals(SymbolKind.Field, cachedSymbols[1].getEnhancedSymbol().getSymbol().getKind()); assertEquals(new Location(doc4URI, new Range(new Position(4, 4), new Position(5, 5))), cachedSymbols[1].getEnhancedSymbol().getSymbol().getLocation().getLeft()); - assertNull(cachedSymbols[1].getEnhancedSymbol().getAdditionalInformation()); Multimap cachedDependencies = result.getRight(); assertEquals(ImmutableSet.of(), cachedDependencies.get(file1.toString())); diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexTest.java index 2f8ee9d2c..43db61322 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexerBeansTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexerBeansTest.java index 45ac02dfb..8f7ac041b 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexerBeansTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/index/test/SpringMetamodelIndexerBeansTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnCompletionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnCompletionProviderTest.java index 63c230aff..d12683da2 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnCompletionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnCompletionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnDefinitionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnDefinitionProviderTest.java index 17cbbfc02..39adca108 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnDefinitionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/DependsOnDefinitionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/FeignSymbolProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/FeignSymbolProviderTest.java index 1e82de8ad..98b0ad424 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/FeignSymbolProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/FeignSymbolProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2019 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedCompletionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedCompletionProviderTest.java index be6da7ed5..f93da9305 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedCompletionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedCompletionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedDefinitionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedDefinitionProviderTest.java index a8fd659e9..cb3f99edb 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedDefinitionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedDefinitionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedReferencesProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedReferencesProviderTest.java index 335e6f3e3..e180a87c6 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedReferencesProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/NamedReferencesProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,7 +12,6 @@ package org.springframework.ide.vscode.boot.java.beans.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; import java.io.File; import java.util.List; diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ProfileCompletionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ProfileCompletionProviderTest.java index ce85e7e7e..588aa0b36 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ProfileCompletionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ProfileCompletionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/QualifierCompletionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/QualifierCompletionProviderTest.java index 592db1ee0..0cc50fa29 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/QualifierCompletionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/QualifierCompletionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceCompletionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceCompletionProviderTest.java index d4dec8fa3..07dad7cba 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceCompletionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceCompletionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceDefinitionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceDefinitionProviderTest.java index b88a29f1a..dc0503126 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceDefinitionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/ResourceDefinitionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerBeansTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerBeansTest.java index c02f54eb8..e4d0c8df0 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerBeansTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerBeansTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2022 Pivotal, Inc. + * Copyright (c) 2017, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerFunctionBeansTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerFunctionBeansTest.java index b0ffad7a6..abdfd9347 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerFunctionBeansTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/beans/test/SpringIndexerFunctionBeansTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2019 Pivotal, Inc. + * Copyright (c) 2017, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/conditionals/test/ConditionalOnBeanCompletionTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/conditionals/test/ConditionalOnBeanCompletionTest.java index 6bf74f3fd..e3a27daa2 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/conditionals/test/ConditionalOnBeanCompletionTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/conditionals/test/ConditionalOnBeanCompletionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2024, 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/jpa/queries/HqlSemanticTokensTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/jpa/queries/HqlSemanticTokensTest.java index 9d56d9ce1..cf479d8cc 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/jpa/queries/HqlSemanticTokensTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/jpa/queries/HqlSemanticTokensTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom, Inc. + * Copyright (c) 2024, 2025 Broadcom, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/test/DataRepositorySymbolProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/test/DataRepositorySymbolProviderTest.java index 49c91f546..a0c419e93 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/test/DataRepositorySymbolProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/test/DataRepositorySymbolProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2024 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/AddConfigurationIfBeansPresentReconcilerTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/AddConfigurationIfBeansPresentReconcilerTest.java index 97df5c4e3..600fa921d 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/AddConfigurationIfBeansPresentReconcilerTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/AddConfigurationIfBeansPresentReconcilerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/NotRegisteredBeansReconcilerTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/NotRegisteredBeansReconcilerTest.java index d264526d42..e6e7ffa2c 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/NotRegisteredBeansReconcilerTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/reconcilers/test/NotRegisteredBeansReconcilerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 VMware, Inc. + * Copyright (c) 2023, 2025 VMware, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebFluxMappingSymbolProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebFluxMappingSymbolProviderTest.java index 170e9b15c..30afb4c44 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebFluxMappingSymbolProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebFluxMappingSymbolProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2024 Pivotal, Inc. + * Copyright (c) 2018, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,6 +14,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; +import java.net.URI; +import java.nio.charset.Charset; import java.util.Arrays; import java.util.Iterator; import java.util.List; @@ -21,6 +23,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; +import org.apache.commons.io.FileUtils; import org.eclipse.lsp4j.TextDocumentIdentifier; import org.eclipse.lsp4j.WorkspaceSymbol; import org.junit.jupiter.api.BeforeEach; @@ -36,6 +39,7 @@ import org.springframework.ide.vscode.boot.java.requestmapping.WebfluxHandlerMet import org.springframework.ide.vscode.commons.java.IJavaProject; import org.springframework.ide.vscode.commons.languageserver.java.JavaProjectFinder; import org.springframework.ide.vscode.commons.protocol.spring.Bean; +import org.springframework.ide.vscode.commons.protocol.spring.InjectionPoint; import org.springframework.ide.vscode.commons.protocol.spring.SpringIndexElement; import org.springframework.ide.vscode.project.harness.BootLanguageServerHarness; import org.springframework.ide.vscode.project.harness.ProjectsHarness; @@ -284,6 +288,34 @@ public class WebFluxMappingSymbolProviderTest { assertEquals("org.test.PersonHandler3", handlerElement6.getHandlerClass()); assertEquals("public Mono deletePerson(org.springframework.web.reactive.function.server.ServerRequest)", handlerElement6.getHandlerMethod()); } + + @Test + void testUpdatedRouteInChangedDocument() throws Exception { + // update document and update index + String changedDocURI = directory.toPath().resolve("src/main/java/org/test/QuoteRouter.java").toUri().toString(); + + String newContent = FileUtils.readFileToString(new File(new URI(changedDocURI)), Charset.defaultCharset()).replace("/hello", "/hello-updated"); + CompletableFuture updateFuture = indexer.updateDocument(changedDocURI, newContent, "test triggered"); + updateFuture.get(5, TimeUnit.SECONDS); + + Bean[] routeBeans = springIndex.getBeansWithName(project.getElementName(), "route"); + assertEquals(1, routeBeans.length); + assertEquals("route", routeBeans[0].getName()); + + SpringIndexElement[] children = routeBeans[0].getChildren(); + assertEquals(8, children.length); + + WebfluxHandlerMethodIndexElement handlerElement1 = getWebfluxIndexElements(children, "/hello-updated", "GET").get(0); + assertEquals("/hello-updated", handlerElement1.getPath()); + assertEquals("[GET]", Arrays.toString(handlerElement1.getHttpMethods())); + assertEquals(0, handlerElement1.getContentTypes().length); + assertEquals("[TEXT_PLAIN]", Arrays.toString(handlerElement1.getAcceptTypes())); + assertEquals("org.test.QuoteHandler", handlerElement1.getHandlerClass()); + assertEquals("public Mono hello(org.springframework.web.reactive.function.server.ServerRequest)", handlerElement1.getHandlerMethod()); + + } + + private boolean containsSymbol(List symbols, String name, String uri, int startLine, int startCHaracter, int endLine, int endCharacter) { for (Iterator iterator = symbols.iterator(); iterator.hasNext();) { diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebfluxRouteElementRangesIndexElementTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebfluxRouteElementRangesIndexElementTest.java index 016350c89..b6609571e 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebfluxRouteElementRangesIndexElementTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/requestmapping/test/WebfluxRouteElementRangesIndexElementTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2024 Broadcom + * Copyright (c) 2025 Broadcom * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/spel/SpelDefinitionProviderTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/spel/SpelDefinitionProviderTest.java index 96afc8076..bf1799ac7 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/spel/SpelDefinitionProviderTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/spel/SpelDefinitionProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017, 2024 Broadcom, Inc. + * Copyright (c) 2017, 2025 Broadcom, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/utils/test/SpringIndexerXMLProjectTest.java b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/utils/test/SpringIndexerXMLProjectTest.java index 93fb6a2b3..ecfa5d9e8 100644 --- a/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/utils/test/SpringIndexerXMLProjectTest.java +++ b/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/utils/test/SpringIndexerXMLProjectTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Pivotal, Inc. + * Copyright (c) 2019, 2025 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at