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 be47fb2178..5ccc75a24d 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.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.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 List getSymbols(String docURI) { } } - 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/index/cache/IndexCacheOnDisc.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDisc.java index 373bf2d6e3..48f4b69c36 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 @@ -34,7 +34,6 @@ 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.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 @@ else if (key != null && !key.equals(cacheKey) 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 IndexCacheStore deserialize(JsonElement json, Type typeOfT, JsonDeseri } - /** - * 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 35f342f83e..d83032101a 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 @@ -41,7 +41,6 @@ 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 @@ private Pair, Integer> retrieveSto 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 DeltaStorage deserialize(JsonElement json, Type type, JsonDeserializat } } - 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/beans/BeansSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/beans/BeansSymbolProvider.java index 3ee3e4dc52..dd51053034 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 @@ -39,8 +39,8 @@ 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; @@ -103,8 +103,7 @@ public void addSymbols(Annotation node, ITypeBinding typeBinding, Collection createSymbol(Annotation nod 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 44d44ac1dc..896d8d3162 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 @@ -97,7 +97,7 @@ private Two createSymbol(Annotation node, IType 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 266e8b3c24..587a1f982c 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 @@ -63,7 +63,7 @@ protected void addSymbolsPass1(TypeDeclaration typeDeclaration, SpringIndexerJav 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 2627be24bc..36d9446902 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 @@ 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 882f0df4d1..0000000000 --- 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/requestmapping/RequestMappingSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/RequestMappingSymbolProvider.java index ff05a1d606..8205d8fb7a 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 @@ protected void addSymbolsPass1(Annotation node, ITypeBinding annotationType, Col .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 598d9ce858..220022e3b0 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.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 @@ 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 static EnhancedSymbolInformation createRouteSymbol(Location location, Str 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/WebfluxRouterSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/requestmapping/WebfluxRouterSymbolProvider.java index ab3d7d7f86..58151a96bb 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 @@ -132,7 +132,7 @@ protected static void extractMappingSymbol(MethodInvocation node, TextDocument d 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/utils/RestrictedDefaultSymbolProvider.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/RestrictedDefaultSymbolProvider.java index aedd2cceae..3adfffa853 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 @@ protected void addSymbolsPass1(Annotation node, ITypeBinding typeBinding, // 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 8e9b9222a0..db31ee43e2 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 @@ -121,7 +121,7 @@ private List computeSymbols(String docURI, String con 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 e7764b7c87..3692c8488f 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 @@ -770,7 +770,7 @@ private void extractSymbolInformation(Annotation node, final SpringIndexerJavaCo } 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/SpringIndexerXMLNamespaceHandlerBeans.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXMLNamespaceHandlerBeans.java index 7dea007ab0..2327958193 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 @@ -92,7 +92,7 @@ else if (name != null && name.equals("class")) { } 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 ac80e50b59..8c6509b399 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 @@ -89,7 +89,7 @@ void testSimpleValidCache() throws Exception { 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 @@ void testSimpleValidCache() throws Exception { 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 @@ void testDifferentCacheKey() throws Exception { 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 @@ void testFileTouched() throws Exception { 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 @@ void testSymbolAddedToExistingFile() throws Exception { 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 @@ void testStorageFileIncrementallyUpdatedAndCompacted() throws Exception { 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 @@ void testSymbolsAddedToMultipleFiles() throws Exception { 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 @@ void testSymbolsAddedToMultipleFiles() throws Exception { 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 @@ void testSymbolRemovedFromExistingFile() throws Exception { 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 @@ void testSymbolAddedToNewFile() throws Exception { 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 @@ void testFileDeleted() throws Exception { 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 @@ void testFileDeleted() throws Exception { 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 @@ void testMultipleFilesDeleted() throws Exception { 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 @@ void testMultipleFilesDeleted() throws Exception { 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 d539a0633d..37ae7c07c4 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, 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 @@ -87,7 +87,7 @@ void testSimpleValidCache() throws Exception { 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 @@ void testSimpleValidCache() throws Exception { 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 @@ void testDifferentCacheKey() throws Exception { 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 @@ void testFileTouched() throws Exception { 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 @@ void testSymbolAddedToExistingFile() throws Exception { 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 @@ void testSymbolsAddedToMultipleFiles() throws Exception { 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 @@ void testSymbolsAddedToMultipleFiles() throws Exception { 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 @@ void testSymbolRemovedFromExistingFile() throws Exception { 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 @@ void testSymbolAddedToNewFile() throws Exception { 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 @@ void testFileDeleted() throws Exception { 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 @@ void testFileDeleted() throws Exception { 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 @@ void testMultipleFilesDeleted() throws Exception { 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 @@ void testMultipleFilesDeleted() throws Exception { 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()));