Skip to content

Commit f844544

Browse files
committed
GH-1342: disabled the elide common prefix in completion proposals feature, will bring that back behind a preference
1 parent 7532aa3 commit f844544

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/properties/completions/PropertiesCompletionProposalsCalculator.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2016, 2023 Pivotal, Inc.
2+
* Copyright (c) 2016, 2024 Pivotal, Inc.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -8,7 +8,6 @@
88
* Contributors:
99
* Pivotal, Inc. - initial API and implementation
1010
*******************************************************************************/
11-
1211
package org.springframework.ide.vscode.boot.properties.completions;
1312

1413
import static org.springframework.ide.vscode.boot.common.CommonLanguageTools.SPACES;
@@ -366,12 +365,14 @@ protected Collection<ICompletionProposal> getFuzzyCompletions() {
366365
}
367366

368367
private Collection<ICompletionProposal> elideCommonPrefix(String basePrefix, ArrayList<ICompletionProposal> proposals) {
369-
String prefix = StringUtil.commonPrefix(Stream.concat(Stream.of(basePrefix), proposals.stream().map(ICompletionProposal::getLabel)));
370-
int lastDot = prefix.lastIndexOf('.');
371-
if (lastDot>=0) {
372-
for (int i = 0; i < proposals.size(); i++) {
373-
ICompletionProposal p = proposals.get(i);
374-
proposals.set(i, p.dropLabelPrefix(lastDot+1));
368+
if (false) { // TODO: check for preference setting
369+
String prefix = StringUtil.commonPrefix(Stream.concat(Stream.of(basePrefix), proposals.stream().map(ICompletionProposal::getLabel)));
370+
int lastDot = prefix.lastIndexOf('.');
371+
if (lastDot>=0) {
372+
for (int i = 0; i < proposals.size(); i++) {
373+
ICompletionProposal p = proposals.get(i);
374+
proposals.set(i, p.dropLabelPrefix(lastDot+1));
375+
}
375376
}
376377
}
377378
return proposals;

0 commit comments

Comments
 (0)