Skip to content

Commit

Permalink
fixing platform quickfix code completion not working (#340)
Browse files Browse the repository at this point in the history
Signed-off-by: Arun Venmany <[email protected]>
  • Loading branch information
arunvenmany-ibm authored Jan 29, 2025
1 parent 793a4d7 commit bb10e15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024 IBM Corporation and others.
* Copyright (c) 2024, 2025 IBM Corporation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -54,7 +54,7 @@ public void doCodeAction(ICodeActionRequest request, List<CodeAction> codeAction
if (replacePlatformName) {
LibertyRuntime runtimeInfo = LibertyUtils.getLibertyRuntimeInfo(document);
Set<String> allPlatforms = getAllPlatforms(runtimeInfo, document);
List<String> existingPlatforms = FeatureService.getInstance().collectExistingPlatforms(document, platformNameToReplace);
List<String> existingPlatforms = FeatureService.getInstance().collectExistingPlatforms(document, invalidPlatform);
List<String> replacementPlatforms = getReplacementPlatforms(
allPlatforms, existingPlatforms);
// check for conflicting platforms for already existing platforms. remove them from quick fix items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,21 +843,21 @@ public void testInvalidPlatformDiagnosticWithCodeCompletion() throws BadLocation
"<server description=\"Sample Liberty server\">", //
" <featureManager>", //
" <feature>batch-1.0</feature>", //
" <platform>miCroP</platform>", //
" <platform>microProfile-5</platform>", //
" <platform>javaee-7.0</platform>", //
" </featureManager>", //
"</server>" //
);
invalid1 = new Diagnostic();
invalid1.setRange(r(3, 25, 3, 31));
invalid1.setRange(r(3, 25, 3, 39));
invalid1.setCode(LibertyDiagnosticParticipant.INCORRECT_PLATFORM_CODE);
invalid1.setMessage("ERROR: The platform \"miCroP\" does not exist.");
invalid1.setMessage("ERROR: The platform \"microProfile-5\" does not exist.");

XMLAssert.testDiagnosticsFor(serverXML, null, null, serverXMLURI,
invalid1);

// expecting code action to show only microprofile platforms since
// 1. user has entered "microP"
// 1. user has entered "microProfile-5"
List<String> microProfilePlatforms = new ArrayList<>();
microProfilePlatforms.add("microProfile-1.0");
microProfilePlatforms.add("microProfile-1.2");
Expand Down

0 comments on commit bb10e15

Please sign in to comment.