diff --git a/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/capability/InitializationOptions.java b/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/capability/InitializationOptions.java index c3da9437be9b..1603024a2253 100644 --- a/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/capability/InitializationOptions.java +++ b/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/capability/InitializationOptions.java @@ -32,11 +32,6 @@ public interface InitializationOptions { */ String KEY_ENABLE_SEMANTIC_TOKENS = "enableSemanticHighlighting"; - /** - * Whether the client supports rename popup. - */ - String KEY_RENAME_SUPPORT = "supportRenamePopup"; - /** * Whether the client supports {@link org.eclipse.lsp4j.Position} based rename popup. */ @@ -66,13 +61,6 @@ public interface InitializationOptions { */ boolean isEnableSemanticTokens(); - /** - * Returns if the client supports rename popup. - * - * @return True if supported, false otherwise - */ - boolean isRefactorRenameSupported(); - /** * Returns if the client supports {@link org.eclipse.lsp4j.Position} based rename. * @return True if supported, false otherwise diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientCapabilitiesImpl.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientCapabilitiesImpl.java index 3516e737ff04..428ac88e003e 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientCapabilitiesImpl.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientCapabilitiesImpl.java @@ -142,11 +142,6 @@ private InitializationOptions parseInitializationOptions(Map ini Boolean.parseBoolean(String.valueOf(semanticTokensSupport)); initializationOptions.setEnableSemanticTokens(enableSemanticTokens); - Object renameSupport = initOptions.get(InitializationOptions.KEY_RENAME_SUPPORT); - boolean enableRenameSupport = renameSupport != null && - Boolean.parseBoolean(String.valueOf(renameSupport)); - initializationOptions.setSupportRenamePopup(enableRenameSupport); - Object quickPickSupport = initOptions.get(InitializationOptions.KEY_QUICKPICK_SUPPORT); boolean enableQuickPickSupport = quickPickSupport != null && Boolean.parseBoolean(String.valueOf(quickPickSupport)); @@ -210,7 +205,6 @@ public static class InitializationOptionsImpl implements InitializationOptions { private boolean supportBalaScheme = false; private boolean enableSemanticTokens = false; - private boolean supportRenamePopup = false; private boolean supportQuickPick = false; private boolean enableLSLightWeightMode = false; private boolean supportPositionalRenamePopup = false; @@ -232,11 +226,6 @@ public void setEnableSemanticTokens(boolean enableSemanticTokens) { this.enableSemanticTokens = enableSemanticTokens; } - @Override - public boolean isRefactorRenameSupported() { - return supportRenamePopup; - } - @Override public boolean isPositionalRefactorRenameSupported() { return supportPositionalRenamePopup; @@ -246,10 +235,6 @@ public void setSupportPositionalRenamePopup(boolean supportPositionalRenamePopup this.supportPositionalRenamePopup = supportPositionalRenamePopup; } - public void setSupportRenamePopup(boolean supportRenamePopup) { - this.supportRenamePopup = supportRenamePopup; - } - @Override public boolean isQuickPickSupported() { return supportQuickPick; diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/CreateVariableCodeAction.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/CreateVariableCodeAction.java index 9fad09bab99a..e165aea7d668 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/CreateVariableCodeAction.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/CreateVariableCodeAction.java @@ -21,14 +21,12 @@ import io.ballerina.compiler.api.symbols.TypeSymbol; import io.ballerina.compiler.api.symbols.UnionTypeSymbol; import io.ballerina.compiler.api.symbols.WorkerSymbol; -import io.ballerina.compiler.syntax.tree.SyntaxTree; import io.ballerina.tools.diagnostics.Diagnostic; import org.ballerinalang.annotation.JavaSPIService; import org.ballerinalang.langserver.codeaction.CodeActionNodeValidator; import org.ballerinalang.langserver.codeaction.CodeActionUtil; import org.ballerinalang.langserver.common.ImportsAcceptor; import org.ballerinalang.langserver.common.constants.CommandConstants; -import org.ballerinalang.langserver.common.utils.CommonUtil; import org.ballerinalang.langserver.common.utils.NameUtil; import org.ballerinalang.langserver.common.utils.PositionUtil; import org.ballerinalang.langserver.commons.CodeActionContext; @@ -58,7 +56,6 @@ public class CreateVariableCodeAction implements DiagnosticBasedCodeActionProvider { public static final String NAME = "Create Variable"; - private static final String RENAME_COMMAND = "Rename Variable"; /** * {@inheritDoc} @@ -110,8 +107,8 @@ public List getCodeActions(Diagnostic diagnostic, } CodeAction codeAction = CodeActionUtil.createCodeAction(commandTitle, edits, uri, CodeActionKind.QuickFix); - addRenamePopup(context, edits, variableEdit, codeAction, createVarTextEdits.renamePositions.get(i), - createVarTextEdits.varRenamePosition.get(i), createVarTextEdits.imports.size()); + addRenamePopup(context, codeAction, createVarTextEdits.varRenamePosition.get(i), + createVarTextEdits.imports.size()); actions.add(codeAction); } return actions; @@ -215,8 +212,7 @@ public CreateVariableOut(String name, List types, List edits, } } - public void addRenamePopup(CodeActionContext context, List textEdits, TextEdit variableEdit, - CodeAction codeAction, int renameOffset, + public void addRenamePopup(CodeActionContext context, CodeAction codeAction, Position varRenamePosition, int newImportsCount) { LSClientCapabilities lsClientCapabilities = context.languageServercontext().get(LSClientCapabilities.class); if (lsClientCapabilities.getInitializationOptions().isPositionalRefactorRenameSupported()) { @@ -225,45 +221,6 @@ public void addRenamePopup(CodeActionContext context, List textEdits, List.of(context.fileUri(), new Position(varRenamePosition.getLine() + newImportsCount, varRenamePosition.getCharacter())))); - return; } - - Optional syntaxTree = context.currentSyntaxTree(); - if (!lsClientCapabilities.getInitializationOptions().isRefactorRenameSupported() || syntaxTree.isEmpty()) { - return; - } - /* - Ex: class Test { - function testFunc() returns error? { - int testResult = check test(); - } - } - 1. startPos gives the start position of the variable type "int". - 2. If any text edits are applied before the variable creation edit, the length of those edits is added to the - "sum". In the above example, the length of "error?" will be added. - 3. renameOffset gives the length of the variable type and the white space between the variable type and the - variable. In the example, the renameOffset will be the length of "int ". - */ - - int startPos = CommonUtil.getTextEdit(syntaxTree.get(), variableEdit).range().startOffset(); - int sum = 0; - for (TextEdit textEdit : textEdits) { - io.ballerina.tools.text.TextEdit edits = CommonUtil.getTextEdit(syntaxTree.get(), textEdit); - int startOffset = edits.range().startOffset(); - int endOffset = edits.range().endOffset(); - if (startOffset < startPos) { - sum = sum + edits.text().length(); - if (startOffset < endOffset) { - int returnTypeLength = endOffset - startOffset; - sum = sum - returnTypeLength; - } - } - } - - startPos = startPos + sum + renameOffset; - - codeAction.setCommand( - new Command(CommandConstants.RENAME_COMMAND_TITLE_FOR_VARIABLE, CommandConstants.RENAME_COMMAND, - List.of(context.fileUri(), startPos))); } } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleInsideCodeAction.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleInsideCodeAction.java index e0a64377cd91..debd9a8fba0d 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleInsideCodeAction.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleInsideCodeAction.java @@ -92,8 +92,7 @@ public List getCodeActions(Diagnostic diagnostic, createVarTextEdits.imports.stream().filter(edit -> !edits.contains(edit)).forEach(edits::add); CodeAction codeAction = CodeActionUtil.createCodeAction(commandTitle, edits, uri, CodeActionKind.QuickFix); - addRenamePopup(context, edits, createVarTextEdits.edits.get(0), codeAction, - createVarTextEdits.renamePositions.get(0), createVarTextEdits.varRenamePosition.get(0), + addRenamePopup(context, codeAction, createVarTextEdits.varRenamePosition.get(0), createVarTextEdits.imports.size()); return Collections.singletonList(codeAction); } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleOutsideCodeAction.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleOutsideCodeAction.java index 49c79f1a672c..3e1fc03c3545 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleOutsideCodeAction.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/providers/createvar/ErrorHandleOutsideCodeAction.java @@ -102,11 +102,10 @@ public List getCodeActions(Diagnostic diagnostic, positionDetails.matchedNode(), context)); edits.addAll(importsAcceptor.getNewImportTextEdits()); - int renamePosition = modifiedTextEdits.renamePositions.get(0); CodeAction codeAction = CodeActionUtil.createCodeAction(CommandConstants.CREATE_VAR_ADD_CHECK_TITLE, edits, uri, CodeActionKind.QuickFix); - addRenamePopup(context, edits, modifiedTextEdits.edits.get(0), codeAction, renamePosition, - modifiedTextEdits.varRenamePosition.get(0), modifiedTextEdits.imports.size()); + addRenamePopup(context, codeAction, modifiedTextEdits.varRenamePosition.get(0), + modifiedTextEdits.imports.size()); return Collections.singletonList(codeAction); } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/constants/CommandConstants.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/constants/CommandConstants.java index 1a068aa5d73a..a5854e2b18d5 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/constants/CommandConstants.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/constants/CommandConstants.java @@ -187,8 +187,6 @@ public class CommandConstants { public static final String CHANGE_TO_SUBTYPE_OF_RAW_TEMPLATE_TITLE = "Convert to '%s' template"; - public static final String RENAME_COMMAND = "ballerina.action.rename"; - public static final String POSITIONAL_RENAME_COMMAND = "ballerina.action.positional.rename"; public static final String EXTRACT_COMMAND = "ballerina.action.extract"; diff --git a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/codeaction/AbstractCodeActionTest.java b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/codeaction/AbstractCodeActionTest.java index 4b601c769d9a..ec7cc806984f 100644 --- a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/codeaction/AbstractCodeActionTest.java +++ b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/codeaction/AbstractCodeActionTest.java @@ -404,40 +404,6 @@ protected boolean validateAndModifyArguments(JsonObject actualCommand, List actualEdits, TestConfig testConfig) { //Validate the args of rename command - if (CommandConstants.RENAME_COMMAND.equals(actualCommand.get("command").getAsString())) { - if (actualArgs.size() == 2) { - Optional actualFilePath = - PathUtil.getPathFromURI(actualArgs.get(0).getAsString()) - .map(path -> path.toUri().toString().replace(sourceRoot.toUri().toString(), "")); - int actualRenamePosition = actualArgs.get(1).getAsInt(); - String expectedFilePath = expArgs.get(0).getAsString(); - int expectedRenamePosition = expArgs.get(1).getAsInt(); - if (actualFilePath.isPresent()) { - String actualPath = actualFilePath.get(); - if (actualFilePath.get().startsWith("/") || actualFilePath.get().startsWith("\\")) { - actualPath = actualFilePath.get().substring(1); - } - if (sourceRoot.resolve(actualPath).equals(sourceRoot.resolve(expectedFilePath)) && - actualRenamePosition == expectedRenamePosition) { - return true; - } - JsonArray newArgs = new JsonArray(); - newArgs.add(actualArgs.get(0).getAsString()); - newArgs.add(actualRenamePosition); - - //Replace the args of the actual command to update the test config - actualCommand.add("arguments", newArgs); - } - } - return false; - } else if ("ballerina.action.extract".equals(actualCommand.get("command").getAsString())) { - if (actualArgs.size() == 3 && validateExtractCmd(actualCommand, actualArgs, expArgs, sourceRoot)) { - return true; - } - return actualArgs.size() == 4 && validateExtractCmd(actualCommand, actualArgs, expArgs, sourceRoot) - && actualArgs.get(3).getAsJsonObject().equals(expArgs.get(3).getAsJsonObject()); - } - if (CommandConstants.POSITIONAL_RENAME_COMMAND.equals(actualCommand.get("command").getAsString())) { if (actualArgs.size() == 2) { Optional actualFilePath = @@ -465,6 +431,12 @@ protected boolean validateAndModifyArguments(JsonObject actualCommand, } } return false; + } else if ("ballerina.action.extract".equals(actualCommand.get("command").getAsString())) { + if (actualArgs.size() == 3 && validateExtractCmd(actualCommand, actualArgs, expArgs, sourceRoot)) { + return true; + } + return actualArgs.size() == 4 && validateExtractCmd(actualCommand, actualArgs, expArgs, sourceRoot) + && actualArgs.get(3).getAsJsonObject().equals(expArgs.get(3).getAsJsonObject()); } for (JsonElement actualArg : actualArgs) { diff --git a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/codeaction/CreateVariableTest.java b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/codeaction/CreateVariableTest.java deleted file mode 100644 index d7181b0d2bb5..000000000000 --- a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/codeaction/CreateVariableTest.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.ballerinalang.langserver.codeaction; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.ballerinalang.langserver.common.constants.CommandConstants; -import org.ballerinalang.langserver.common.utils.PathUtil; -import org.ballerinalang.langserver.commons.capability.InitializationOptions; -import org.ballerinalang.langserver.commons.workspace.WorkspaceDocumentException; -import org.ballerinalang.langserver.util.TestUtil; -import org.eclipse.lsp4j.TextEdit; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - -/** - * Test Cases for CodeActions. - * - * @since 2.0.0 - */ -public class CreateVariableTest extends AbstractCodeActionTest { - - @Override - protected void setupLanguageServer(TestUtil.LanguageServerBuilder builder) { - builder.withInitOption(InitializationOptions.KEY_RENAME_SUPPORT, true); - } - - @Override - public String getResourceDir() { - return "create-variable"; - } - - @Override - @Test(dataProvider = "codeaction-data-provider") - public void test(String config) throws IOException, WorkspaceDocumentException { - super.test(config); - } - - @Override - @Test(dataProvider = "negative-test-data-provider") - public void negativeTest(String config) throws IOException, WorkspaceDocumentException { - super.negativeTest(config); - } - - @Override - protected boolean validateAndModifyArguments(JsonObject actualCommand, - JsonArray actualArgs, - JsonArray expArgs, - Path sourceRoot, - Path sourcePath, - List actualEdits, - TestConfig testConfig) { - if (CommandConstants.RENAME_COMMAND.equals(actualCommand.get("command").getAsString())) { - if (actualArgs.size() == 2) { - Optional actualFilePath = - PathUtil.getPathFromURI(actualArgs.get(0).getAsString()) - .map(path -> path.toUri().toString().replace(sourceRoot.toUri().toString(), "")); - int actualRenamePosition = actualArgs.get(1).getAsInt(); - String expectedFilePath = expArgs.get(0).getAsString(); - int expectedRenamePosition = expArgs.get(1).getAsInt(); - if (actualFilePath.isPresent()) { - String actualPath = actualFilePath.get(); - if (actualFilePath.get().startsWith("/") || actualFilePath.get().startsWith("\\")) { - actualPath = actualFilePath.get().substring(1); - } - if (sourceRoot.resolve(actualPath).equals(sourceRoot.resolve(expectedFilePath))) { - if (System.lineSeparator().equals("\r\n")) { - int newImportCount = (int) actualEdits.stream() - .filter(edit -> edit.getNewText().startsWith("import ")).count(); - int noOfNewLinesBeforeCursorPos = testConfig.position.getLine() + newImportCount; - if (actualRenamePosition == expectedRenamePosition + noOfNewLinesBeforeCursorPos) { - return true; - } - } else if (actualRenamePosition == expectedRenamePosition) { - return true; - } - } - - JsonArray newArgs = new JsonArray(); - newArgs.add(actualPath); - newArgs.add(actualRenamePosition); - - //Replace the args of the actual command to update the test config - actualCommand.add("arguments", newArgs); - } - } - } - return false; - } - - @DataProvider(name = "codeaction-data-provider") - @Override - public Object[][] dataProvider() { - return new Object[][]{ - {"variableAssignmentRequiredCodeAction1.json"}, - {"variableAssignmentRequiredCodeAction2.json"}, - {"variableAssignmentRequiredCodeAction3.json"}, - {"variableAssignmentRequiredCodeAction4.json"}, - {"variableAssignmentRequiredCodeAction5.json"}, - {"variableAssignmentRequiredCodeAction6.json"}, - {"variableAssignmentRequiredCodeAction7.json"}, - {"variableAssignmentRequiredCodeAction8.json"}, - {"variableAssignmentRequiredCodeAction9.json"}, - {"variableAssignmentRequiredCodeAction10.json"}, - {"variableAssignmentRequiredCodeAction11.json"}, - {"variableAssignmentRequiredCodeAction12.json"}, - {"variableAssignmentRequiredCodeAction13.json"}, - {"variableAssignmentRequiredCodeAction14.json"}, - {"variableAssignmentRequiredCodeAction15.json"}, - {"variableAssignmentRequiredCodeAction16.json"}, - {"variableAssignmentRequiredCodeAction17.json"}, - {"variableAssignmentRequiredCodeAction18.json"}, - {"variableAssignmentRequiredCodeAction19.json"}, - {"variableAssignmentRequiredCodeAction20.json"}, - {"variableAssignmentRequiredCodeAction21.json"}, - {"variableAssignmentRequiredCodeAction22.json"}, - {"variableAssignmentRequiredCodeAction23.json"}, - {"variableAssignmentRequiredCodeAction24.json"}, - {"variableAssignmentRequiredCodeAction25.json"}, - {"variableAssignmentRequiredCodeAction26.json"}, - {"variableAssignmentRequiredCodeAction27.json"}, - {"variableAssignmentRequiredCodeAction28.json"}, - {"variableAssignmentRequiredCodeAction29.json"}, - {"variableAssignmentRequiredCodeAction30.json"}, - {"variableAssignmentRequiredCodeAction31.json"}, - {"variableAssignmentRequiredCodeAction32.json"}, - {"variableAssignmentRequiredCodeAction33.json"}, - {"variableAssignmentRequiredCodeAction34.json"}, - {"variableAssignmentRequiredCodeAction35.json"}, - {"variableAssignmentRequiredCodeAction36.json"}, - {"variableAssignmentRequiredCodeAction37.json"}, - {"variableAssignmentRequiredCodeAction38.json"}, - {"variableAssignmentRequiredCodeAction39.json"}, - {"variableAssignmentRequiredCodeAction40.json"}, - {"variableAssignmentRequiredCodeAction41.json"}, - {"variableAssignmentRequiredCodeAction42.json"}, - {"variableAssignmentRequiredCodeAction43.json"}, - {"variableAssignmentRequiredCodeAction44.json"}, - {"variableAssignmentRequiredCodeAction45.json"}, - {"variableAssignmentRequiredCodeAction46.json"}, - {"ignoreReturnValueCodeAction.json"}, - {"projectVariableAssignmentRequiredCodeAction1.json"}, - {"projectVariableAssignmentRequiredCodeAction2.json"}, - {"projectVariableAssignmentRequiredCodeAction3.json"}, - {"createVariableInClassMethod.json"}, - {"createVariableInServiceMethod.json"}, - {"createVariableInServiceRemoteMethod.json"}, - {"createVariableWithUnionType.json"}, - {"createVariableWithIntersectionType.json"}, - {"createVariableWithIntersectionType2.json"}, - {"createVariableForOptionalFieldAccess1.json"}, - {"createVariableForOptionalFieldAccess2.json"}, - {"createVariableWithTypeDesc.json"}, - - // Tuple related - {"createVariableWithTuple1.json"}, - - // Create variables of function/invocable type - {"createVariableWithFunctionType1.json"}, - {"createVariableWithFunctionType2.json"}, - - {"createVariableWithFunctionCall1.json"}, - {"createVariableWithFunctionCall2.json"}, - {"createVariableWithRemoteMethodInvocation.json"}, - - // Async send action - {"createVarInSendAction1.json"}, - - // Create variable with check - {"createVariableWithCheck1.json"}, - {"createVariableWithCheck2.json"}, - {"createVariableWithCheck3.json"}, - {"createVariableWithCheck4.json"}, - {"createVariableWithCheck5.json"}, - {"createVariableWithCheck6.json"}, - {"createVariableWithCheck7.json"} - }; - } - - @DataProvider(name = "negative-test-data-provider") - public Object[][] negativeDataProvider() { - return new Object[][]{ - {"createVariableNegative1.json"}, - {"createVariableNegative2.json"}, - {"createVariableNegative3.json"}, - {"createVariableNegative4.json"}, - {"createVariableNegative5.json"}, - {"createVariableNegative6.json"}, - {"createVariableNegative7.json"} - }; - } -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVarInSendAction1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVarInSendAction1.json deleted file mode 100644 index aa906dac015e..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVarInSendAction1.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "position": { - "line": 9, - "character": 11 - }, - "source": "createVarInSendAction1.bal", - "expected": [ - { - "title": "Create variable and type guard", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 8 - }, - "end": { - "line": 9, - "character": 8 - } - }, - "newText": "error? unionResult = " - }, - { - "range": { - "start": { - "line": 9, - "character": 15 - }, - "end": { - "line": 9, - "character": 15 - } - }, - "newText": "\n if unionResult is error {\n\n }" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVarInSendAction1.bal", - 128 - ] - }, - "resolvable": false - }, - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 8 - }, - "end": { - "line": 9, - "character": 8 - } - }, - "newText": "error? unionResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVarInSendAction1.bal", - 128 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableForOptionalFieldAccess1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableForOptionalFieldAccess1.json deleted file mode 100644 index 080b788fe5af..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableForOptionalFieldAccess1.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 6, - "character": 4 - }, - "source": "createVariableForOptionalFieldAccess1.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 4 - } - }, - "newText": "int? unionResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableForOptionalFieldAccess1.bal", - 81 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableForOptionalFieldAccess2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableForOptionalFieldAccess2.json deleted file mode 100644 index c06085737374..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableForOptionalFieldAccess2.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 8, - "character": 4 - }, - "source": "createVariableForOptionalFieldAccess2.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 8, - "character": 4 - }, - "end": { - "line": 8, - "character": 4 - } - }, - "newText": "T t = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableForOptionalFieldAccess2.bal", - 89 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInClassMethod.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInClassMethod.json deleted file mode 100644 index dbbf1a6d18b3..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInClassMethod.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "position": { - "line": 7, - "character": 8 - }, - "source": "createVariableInClassMethod.bal", - "expected": [ - { - "title": "Create variable and type guard", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 8 - }, - "end": { - "line": 7, - "character": 8 - } - }, - "newText": "int|error intWithError = " - }, - { - "range": { - "start": { - "line": 7, - "character": 28 - }, - "end": { - "line": 7, - "character": 28 - } - }, - "newText": "\n if intWithError is int {\n\n }" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInClassMethod.bal", - 133 - ] - }, - "resolvable": false - }, - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 8 - }, - "end": { - "line": 7, - "character": 8 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 7, - "character": 8 - }, - "end": { - "line": 7, - "character": 8 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 6, - "character": 27 - }, - "end": { - "line": 6, - "character": 27 - } - }, - "newText": " returns error?" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInClassMethod.bal", - 142 - ] - }, - "resolvable": false - }, - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 8 - }, - "end": { - "line": 7, - "character": 8 - } - }, - "newText": "int|error intWithError = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInClassMethod.bal", - 133 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInServiceMethod.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInServiceMethod.json deleted file mode 100644 index 8b549ac578aa..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInServiceMethod.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "position": { - "line": 10, - "character": 8 - }, - "source": "createVariableInServiceMethod.bal", - "expected": [ - { - "title": "Create variable and type guard", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 10, - "character": 8 - }, - "end": { - "line": 10, - "character": 8 - } - }, - "newText": "int|error intWithError = " - }, - { - "range": { - "start": { - "line": 10, - "character": 28 - }, - "end": { - "line": 10, - "character": 28 - } - }, - "newText": "\n if intWithError is int {\n\n }" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInServiceMethod.bal", - 240 - ] - }, - "resolvable": false - }, - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 10, - "character": 8 - }, - "end": { - "line": 10, - "character": 8 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 10, - "character": 8 - }, - "end": { - "line": 10, - "character": 8 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 9, - "character": 39 - }, - "end": { - "line": 9, - "character": 39 - } - }, - "newText": " returns error?" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInServiceMethod.bal", - 249 - ] - }, - "resolvable": false - }, - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 10, - "character": 8 - }, - "end": { - "line": 10, - "character": 8 - } - }, - "newText": "int|error intWithError = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInServiceMethod.bal", - 240 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInServiceRemoteMethod.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInServiceRemoteMethod.json deleted file mode 100644 index 17452029d5a7..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableInServiceRemoteMethod.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "position": { - "line": 14, - "character": 8 - }, - "source": "createVariableInServiceMethod.bal", - "expected": [ - { - "title": "Create variable and type guard", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 14, - "character": 8 - }, - "end": { - "line": 14, - "character": 8 - } - }, - "newText": "int|error intWithError = " - }, - { - "range": { - "start": { - "line": 14, - "character": 28 - }, - "end": { - "line": 14, - "character": 28 - } - }, - "newText": "\n if intWithError is int {\n\n }" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInServiceMethod.bal", - 325 - ] - }, - "resolvable": false - }, - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 14, - "character": 8 - }, - "end": { - "line": 14, - "character": 8 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 14, - "character": 8 - }, - "end": { - "line": 14, - "character": 8 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 13, - "character": 42 - }, - "end": { - "line": 13, - "character": 42 - } - }, - "newText": " returns error?" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInServiceMethod.bal", - 334 - ] - }, - "resolvable": false - }, - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 14, - "character": 8 - }, - "end": { - "line": 14, - "character": 8 - } - }, - "newText": "int|error intWithError = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableInServiceMethod.bal", - 325 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative1.json deleted file mode 100644 index 66b4631d29b2..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative1.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "position": { - "line": 2, - "character":16 - }, - "source": "createVariableNegative1.bal", - "expected": [ - { - "title": "Create variable" - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative2.json deleted file mode 100644 index 9cbb2c9d0809..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative2.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "position": { - "line": 3, - "character": 27 - }, - "source": "createVariableNegative2.bal", - "expected": [ - { - "title": "Create variable" - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative3.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative3.json deleted file mode 100644 index 453898d02b0f..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative3.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "position": { - "line": 3, - "character": 16 - }, - "source": "createVariableNegative2.bal", - "expected": [ - { - "title": "Create variable" - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative4.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative4.json deleted file mode 100644 index f1b4564b0011..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative4.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "position": { - "line": 25, - "character": 4 - }, - "source": "createVariableWithCheck.bal", - "expected": [ - { - "title": "Create variable" - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative5.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative5.json deleted file mode 100644 index 9aa60879fc04..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative5.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "position": { - "line": 7, - "character": 10 - }, - "source": "createVariableNegative3.bal", - "expected": [ - { - "title": "Create variable" - } - ], - "description": "Negative test for create variable code action when the type is compilation error" -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative6.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative6.json deleted file mode 100644 index 83dc8893f10d..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative6.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "position": { - "line": 7, - "character": 10 - }, - "source": "createVariableNegative3.bal", - "expected": [ - { - "title": "Create variable and type guard" - } - ], - "description": "Negative test for create variable and type guard code action when the type is compilation error" -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative7.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative7.json deleted file mode 100644 index 3205beac3fd2..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableNegative7.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "position": { - "line": 7, - "character": 10 - }, - "source": "createVariableNegative3.bal", - "expected": [ - { - "title": "Create variable and check error" - } - ], - "description": "Negative test for create variable and check error code action when the type is compilation error" -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck1.json deleted file mode 100644 index 6c8696d4cffe..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck1.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "position": { - "line": 5, - "character": 4 - }, - "source": "createVariableWithCheck.bal", - "description": "Parent function has no return type", - "expected": [ - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 4 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 4, - "character": 50 - }, - "end": { - "line": 4, - "character": 50 - } - }, - "newText": " returns error?" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithCheck.bal", - 144 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck2.json deleted file mode 100644 index 079320423da4..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck2.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "position": { - "line": 9, - "character": 4 - }, - "source": "createVariableWithCheck.bal", - "description": "Parent function has union return type with no error member", - "expected": [ - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 4 - }, - "end": { - "line": 9, - "character": 4 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 9, - "character": 4 - }, - "end": { - "line": 9, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 8, - "character": 71 - }, - "end": { - "line": 8, - "character": 89 - } - }, - "newText": "returns int|string|error" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithCheck.bal", - 256 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck3.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck3.json deleted file mode 100644 index 8a240c24462c..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck3.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "position": { - "line": 13, - "character": 4 - }, - "source": "createVariableWithCheck.bal", - "description": "Parent function has union return type with error member", - "expected": [ - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 13, - "character": 4 - }, - "end": { - "line": 13, - "character": 4 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 13, - "character": 4 - }, - "end": { - "line": 13, - "character": 4 - } - }, - "newText": "check " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithCheck.bal", - 369 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck4.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck4.json deleted file mode 100644 index 3f25a3d27053..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck4.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "position": { - "line": 17, - "character": 4 - }, - "source": "createVariableWithCheck.bal", - "description": "Parent function has error return type", - "expected": [ - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 17, - "character": 4 - }, - "end": { - "line": 17, - "character": 4 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 17, - "character": 4 - }, - "end": { - "line": 17, - "character": 4 - } - }, - "newText": "check " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithCheck.bal", - 472 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck5.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck5.json deleted file mode 100644 index 44343647d8d6..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck5.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "position": { - "line": 21, - "character": 4 - }, - "source": "createVariableWithCheck.bal", - "description": "Parent function has return type other than error", - "expected": [ - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 21, - "character": 4 - }, - "end": { - "line": 21, - "character": 4 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 21, - "character": 4 - }, - "end": { - "line": 21, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 20, - "character": 60 - }, - "end": { - "line": 20, - "character": 74 - } - }, - "newText": "returns string|error" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithCheck.bal", - 584 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck6.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck6.json deleted file mode 100644 index 76ee2ce3e1c3..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck6.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "position": { - "line": 29, - "character": 4 - }, - "source": "createVariableWithCheck.bal", - "description": "Parent function has undefined return type", - "expected": [ - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 29, - "character": 4 - }, - "end": { - "line": 29, - "character": 4 - } - }, - "newText": "int intWithError = " - }, - { - "range": { - "start": { - "line": 29, - "character": 4 - }, - "end": { - "line": 29, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 28, - "character": 62 - }, - "end": { - "line": 28, - "character": 73 - } - }, - "newText": "returns abc|error" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithCheck.bal", - 783 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck7.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck7.json deleted file mode 100644 index 15cdce07ca7a..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithCheck7.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "position": { - "line": 1, - "character": 7 - }, - "source": "createVariableWithCheck2.bal", - "description": "Create variable with check error for a function call that returns a user defined error", - "expected": [ - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "json data = " - }, - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 0, - "character": 22 - }, - "end": { - "line": 0, - "character": 22 - } - }, - "newText": " returns error?" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithCheck2.bal", - 49 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionCall1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionCall1.json deleted file mode 100644 index a42450b6b3fb..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionCall1.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "position": { - "line": 9, - "character": 7 - }, - "source": "createVariableWithFunctionCall1.bal", - "expected": [ - { - "title": "Create variable with 'record {}'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 4 - }, - "end": { - "line": 9, - "character": 4 - } - }, - "newText": "record {} rec = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithFunctionCall1.bal", - 136 - ] - }, - "resolvable": false - }, - { - "title": "Create variable with 'map'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 4 - }, - "end": { - "line": 9, - "character": 4 - } - }, - "newText": "map rec = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithFunctionCall1.bal", - 135 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionCall2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionCall2.json deleted file mode 100644 index 902506ab35dc..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionCall2.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "position": { - "line": 11, - "character": 7 - }, - "source": "createVariableWithFunctionCall2.bal", - "expected": [ - { - "title": "Create variable with 'record {|int a;|}'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 11, - "character": 4 - }, - "end": { - "line": 11, - "character": 4 - } - }, - "newText": "record {|int a;|} rec = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithFunctionCall2.bal", - 172 - ] - }, - "resolvable": false - }, - { - "title": "Create variable with 'json'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 11, - "character": 4 - }, - "end": { - "line": 11, - "character": 4 - } - }, - "newText": "json rec = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithFunctionCall2.bal", - 159 - ] - }, - "resolvable": false - }, - { - "title": "Create variable with 'map'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 11, - "character": 4 - }, - "end": { - "line": 11, - "character": 4 - } - }, - "newText": "map rec = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithFunctionCall2.bal", - 163 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionType1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionType1.json deleted file mode 100644 index 0e854fd51882..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionType1.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 2, - "character": 5 - }, - "source": "createVariableWithFunctionType1.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 2, - "character": 4 - }, - "end": { - "line": 2, - "character": 4 - } - }, - "newText": "(function () returns int)[] funcResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithFunctionType1.bal", - 58 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionType2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionType2.json deleted file mode 100644 index 947b45a93b84..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithFunctionType2.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 4, - "character": 6 - }, - "source": "createVariableWithFunctionType1.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 4, - "character": 4 - }, - "end": { - "line": 4, - "character": 4 - } - }, - "newText": "(function () returns ())[] functionResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithFunctionType1.bal", - 70 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithIntersectionType.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithIntersectionType.json deleted file mode 100644 index 0b8d54a03951..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithIntersectionType.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 7, - "character": 4 - }, - "source": "createVariableWithIntersectionType.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "(Foo & readonly)|int|(string[] & readonly) recordIntersectionResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithIntersectionType.bal", - 229 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithIntersectionType2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithIntersectionType2.json deleted file mode 100644 index 075645c4bae3..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithIntersectionType2.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 9, - "character": 4 - }, - "source": "createVariableWithIntersectionType.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 4 - }, - "end": { - "line": 9, - "character": 4 - } - }, - "newText": "Foo & readonly intersectionValue = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithIntersectionType.bal", - 230 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithRemoteMethodInvocation.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithRemoteMethodInvocation.json deleted file mode 100644 index 107657493b15..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithRemoteMethodInvocation.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "position": { - "line": 22, - "character": 12 - }, - "source": "createVariable9.bal", - "expected": [ - { - "title": "Create variable and type guard", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 22, - "character": 4 - }, - "end": { - "line": 22, - "character": 4 - } - }, - "newText": "HelloReply|E1 sayHello = " - }, - { - "range": { - "start": { - "line": 22, - "character": 38 - }, - "end": { - "line": 22, - "character": 38 - } - }, - "newText": "\n if sayHello is HelloReply {\n\n }" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable9.bal", - 389 - ] - }, - "resolvable": false - }, - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 22, - "character": 4 - }, - "end": { - "line": 22, - "character": 4 - } - }, - "newText": "HelloReply sayHello = " - }, - { - "range": { - "start": { - "line": 22, - "character": 4 - }, - "end": { - "line": 22, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 21, - "character": 22 - }, - "end": { - "line": 21, - "character": 22 - } - }, - "newText": " returns error?" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable9.bal", - 401 - ] - }, - "resolvable": false - }, - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 22, - "character": 4 - }, - "end": { - "line": 22, - "character": 4 - } - }, - "newText": "HelloReply|E1 sayHello = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable9.bal", - 389 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithTuple1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithTuple1.json deleted file mode 100644 index 5754af8d4a03..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithTuple1.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "position": { - "line": 1, - "character": 7 - }, - "source": "createVariableWithTuple1.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "[int, string...]|error tuple = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithTuple1.bal", - 52 - ] - }, - "resolvable": false - }, - { - "title": "Create variable and type guard", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "[int, string...]|error tuple = " - }, - { - "range": { - "start": { - "line": 1, - "character": 15 - }, - "end": { - "line": 1, - "character": 15 - } - }, - "newText": "\n if tuple is [int, string...] {\n\n }" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithTuple1.bal", - 52 - ] - }, - "resolvable": false - }, - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "[int, string...] tuple = " - }, - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 0, - "character": 22 - }, - "end": { - "line": 0, - "character": 22 - } - }, - "newText": " returns error?" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithTuple1.bal", - 61 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithTypeDesc.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithTypeDesc.json deleted file mode 100644 index e6d2f7131dfb..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithTypeDesc.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 5, - "character": 3 - }, - "source": "createVariableWithTypeDesc.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 5, - "character": 3 - }, - "end": { - "line": 5, - "character": 3 - } - }, - "newText": "typedesc:TypeId[]? & readonly typeIds = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithTypeDesc.bal", - 113 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithUnionType.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithUnionType.json deleted file mode 100644 index f719b9226442..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/createVariableWithUnionType.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 5, - "character": 4 - }, - "source": "createVariableWithUnionType.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 4 - } - }, - "newText": "int|float number = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithUnionType.bal", - 97 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/ignoreReturnValueCodeAction.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/ignoreReturnValueCodeAction.json deleted file mode 100644 index 9918cd475dcc..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/ignoreReturnValueCodeAction.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "position": { - "line": 20, - "character": 3 - }, - "source": "createVariable.bal", - "expected": [ - { - "title": "Ignore return value", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 20, - "character": 3 - }, - "end": { - "line": 20, - "character": 3 - } - }, - "newText": "_ \u003d " - } - ] - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction1.json deleted file mode 100644 index e3fddd0dd15b..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction1.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "position": { - "line": 3, - "character": 4 - }, - "source": "testproject/main.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 3, - "character": 4 - }, - "end": { - "line": 3, - "character": 4 - } - }, - "newText": "module2:Country country = " - }, - { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 0, - "character": 0 - } - }, - "newText": "import testproject.module2;\n" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "testproject/main.bal", - 111 - ] - }, - "resolvable": false - }, - { - "title": "Ignore return value", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 3, - "character": 4 - }, - "end": { - "line": 3, - "character": 4 - } - }, - "newText": "_ = " - } - ], - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction2.json deleted file mode 100644 index c6db36559dda..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction2.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "position": { - "line": 7, - "character": 4 - }, - "source": "testproject/main.bal", - "expected": [ - { - "title": "Create variable and type guard", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "module2:Country|error countryWithError = " - }, - { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 0, - "character": 0 - } - }, - "newText": "import testproject.module2;\n" - }, - { - "range": { - "start": { - "line": 7, - "character": 34 - }, - "end": { - "line": 7, - "character": 34 - } - }, - "newText": "\n if countryWithError is module2:Country {\n\n }" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "testproject/main.bal", - 180 - ] - }, - "resolvable": false - }, - { - "title": "Create variable and check error", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "module2:Country countryWithError = " - }, - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "check " - }, - { - "range": { - "start": { - "line": 6, - "character": 31 - }, - "end": { - "line": 6, - "character": 31 - } - }, - "newText": " returns error?" - }, - { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 0, - "character": 0 - } - }, - "newText": "import testproject.module2;\n" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "testproject/main.bal", - 189 - ] - }, - "resolvable": false - }, - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "module2:Country|error countryWithError = " - }, - { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 0, - "character": 0 - } - }, - "newText": "import testproject.module2;\n" - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "testproject/main.bal", - 180 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction3.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction3.json deleted file mode 100644 index 0e43df0adedc..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/projectVariableAssignmentRequiredCodeAction3.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "position": { - "line": 11, - "character": 4 - }, - "source": "testproject/modules/module1/module1.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 11, - "character": 4 - }, - "end": { - "line": 11, - "character": 4 - } - }, - "newText": "module2:Country country = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "testproject/modules/module1/module1.bal", - 272 - ] - }, - "resolvable": false - }, - { - "title": "Ignore return value", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 11, - "character": 4 - }, - "end": { - "line": 11, - "character": 4 - } - }, - "newText": "_ = " - } - ], - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction1.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction1.json deleted file mode 100644 index e45a8b216ef5..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction1.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 20, - "character": 3 - }, - "source": "createVariable.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 20, - "character": 3 - }, - "end": { - "line": 20, - "character": 3 - } - }, - "newText": "int twoIntegers = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable.bal", - 369 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction10.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction10.json deleted file mode 100644 index 36037a555575..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction10.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 3, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 3, - "character": 4 - }, - "end": { - "line": 3, - "character": 4 - } - }, - "newText": "boolean booleanResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 51 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction11.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction11.json deleted file mode 100644 index bb5825c5341e..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction11.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 4, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 4, - "character": 4 - }, - "end": { - "line": 4, - "character": 4 - } - }, - "newText": "xml:Element element = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 65 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction12.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction12.json deleted file mode 100644 index 09e2bfa5bfac..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction12.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 5, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable with 'json'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 4 - } - }, - "newText": "json mappingResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 77 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction13.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction13.json deleted file mode 100644 index 51aed81cac33..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction13.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 5, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable with 'map'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 4 - } - }, - "newText": "map mappingResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 84 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction14.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction14.json deleted file mode 100644 index 56394d079f51..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction14.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 5, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable with 'record {|string a; string b;|}'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 4 - } - }, - "newText": "record {|string a; string b;|} mappingResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 103 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction15.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction15.json deleted file mode 100644 index a8b0c75d0543..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction15.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 6, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable with 'json'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 4 - } - }, - "newText": "json mappingResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 97 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction16.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction16.json deleted file mode 100644 index b9043b8f0182..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction16.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 6, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable with 'record {|string a; int b;|}'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 4 - } - }, - "newText": "record {|string a; int b;|} mappingResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 120 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction17.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction17.json deleted file mode 100644 index 7d73c3878393..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction17.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 6, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable with 'map'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 4 - } - }, - "newText": "map mappingResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 101 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction18.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction18.json deleted file mode 100644 index 8da18a689972..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction18.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 7, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "function (string x, string y, int... args) returns () functionResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 165 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction19.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction19.json deleted file mode 100644 index e99a8a7c756b..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction19.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 9, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 4 - }, - "end": { - "line": 9, - "character": 4 - } - }, - "newText": "string stringResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 174 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction2.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction2.json deleted file mode 100644 index 79e7e924aa1c..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction2.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 22, - "character": 3 - }, - "source": "createVariable.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 22, - "character": 3 - }, - "end": { - "line": 22, - "character": 3 - } - }, - "newText": "string color = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable.bal", - 427 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction20.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction20.json deleted file mode 100644 index 75039a1457c1..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction20.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 6, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 4 - } - }, - "newText": "string remove = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 91 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction21.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction21.json deleted file mode 100644 index 192b24817481..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction21.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 7, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable with 'Tuple'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "[[int, int, int], [int, int, int], [int, int, int]] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 155 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction22.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction22.json deleted file mode 100644 index 2884759200c6..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction22.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 7, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable with 'int[][]'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 4 - } - }, - "newText": "int[][] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 111 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction23.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction23.json deleted file mode 100644 index 0a9a636c6562..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction23.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 8, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable with '[int, string, int][]'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 8, - "character": 4 - }, - "end": { - "line": 8, - "character": 4 - } - }, - "newText": "[int, string, int][] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 166 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction24.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction24.json deleted file mode 100644 index 5cc25540f86b..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction24.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 8, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable with 'Tuple'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 8, - "character": 4 - }, - "end": { - "line": 8, - "character": 4 - } - }, - "newText": "[[int, string, int], [int, string, int], [int, string, int]] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 206 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction25.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction25.json deleted file mode 100644 index 78cdd37d448c..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction25.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 9, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 9, - "character": 4 - }, - "end": { - "line": 9, - "character": 4 - } - }, - "newText": "[[int, string, int], [boolean, float]] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 228 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction26.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction26.json deleted file mode 100644 index dae7e1e6707d..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction26.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 10, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 10, - "character": 4 - }, - "end": { - "line": 10, - "character": 4 - } - }, - "newText": "[int, string] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 234 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction27.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction27.json deleted file mode 100644 index 17d71942df02..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction27.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 11, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable with 'int[]'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 11, - "character": 4 - }, - "end": { - "line": 11, - "character": 4 - } - }, - "newText": "int[] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 239 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction28.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction28.json deleted file mode 100644 index 7f01818f081e..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction28.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 11, - "character": 4 - }, - "source": "createVariable4.bal", - "expected": [ - { - "title": "Create variable with 'Tuple'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 11, - "character": 4 - }, - "end": { - "line": 11, - "character": 4 - } - }, - "newText": "[int, int, int] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable4.bal", - 249 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction29.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction29.json deleted file mode 100644 index a8791f69fcdb..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction29.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 39, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 39, - "character": 4 - }, - "end": { - "line": 39, - "character": 4 - } - }, - "newText": "stream query = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 616 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction3.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction3.json deleted file mode 100644 index f9f3245b4ef3..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction3.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 23, - "character": 3 - }, - "source": "createVariable.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 23, - "character": 3 - }, - "end": { - "line": 23, - "character": 3 - } - }, - "newText": "Apple appleResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable.bal", - 442 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction30.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction30.json deleted file mode 100644 index 733d77ffbf29..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction30.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 41, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 41, - "character": 4 - }, - "end": { - "line": 41, - "character": 4 - } - }, - "newText": "stream streamResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 721 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction31.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction31.json deleted file mode 100644 index dd08e41b0b5e..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction31.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 42, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 42, - "character": 4 - }, - "end": { - "line": 42, - "character": 4 - } - }, - "newText": "int intResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 736 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction32.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction32.json deleted file mode 100644 index 145b8e8c2de5..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction32.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 44, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable with 'record {|string name; int age; record {|int maths; int physics; int chemistry;|} grades; string city; string country;|}'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 44, - "character": 4 - }, - "end": { - "line": 44, - "character": 4 - } - }, - "newText": "record {|string name; int age; record {|int maths; int physics; int chemistry;|} grades; string city; string country;|} mappingResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 929 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction33.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction33.json deleted file mode 100644 index 1f4b7e542014..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction33.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 68, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable with 'json[]'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 68, - "character": 4 - }, - "end": { - "line": 68, - "character": 4 - } - }, - "newText": "json[] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 1436 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction34.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction34.json deleted file mode 100644 index b0e2a2fec054..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction34.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 68, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable with 'record {|string firstName; string lastName; string deptAccess; int age;|}[]'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 68, - "character": 4 - }, - "end": { - "line": 68, - "character": 4 - } - }, - "newText": "record {|string firstName; string lastName; string deptAccess; int age;|}[] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 1505 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction35.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction35.json deleted file mode 100644 index de87b56ce024..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction35.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 68, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable with 'map[]'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 68, - "character": 4 - }, - "end": { - "line": 68, - "character": 4 - } - }, - "newText": "map[] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 1440 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction36.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction36.json deleted file mode 100644 index e7baf306af9e..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction36.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 68, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable with 'Person[]'", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 68, - "character": 4 - }, - "end": { - "line": 68, - "character": 4 - } - }, - "newText": "Person[] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 1438 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction37.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction37.json deleted file mode 100644 index 858baf3c50a9..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction37.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 82, - "character": 20 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 82, - "character": 20 - }, - "end": { - "line": 82, - "character": 20 - } - }, - "newText": "int intResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 1926 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction38.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction38.json deleted file mode 100644 index 534739b5b783..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction38.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 85, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 85, - "character": 4 - }, - "end": { - "line": 85, - "character": 4 - } - }, - "newText": "object {public isolated function iterator() returns object {public isolated function next() returns record {|int value;|}?;};} objectResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 2077 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction39.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction39.json deleted file mode 100644 index 191d9fdc39b8..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction39.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 86, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 86, - "character": 4 - }, - "end": { - "line": 86, - "character": 4 - } - }, - "newText": "object {public isolated function iterator() returns object {public isolated function next() returns record {|int value;|}?;};} objectResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 2091 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction4.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction4.json deleted file mode 100644 index cae46aa073b2..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction4.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 24, - "character": 3 - }, - "source": "createVariable.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 24, - "character": 3 - }, - "end": { - "line": 24, - "character": 3 - } - }, - "newText": "Grapes grapes = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable.bal", - 459 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction40.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction40.json deleted file mode 100644 index 934ca85152e8..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction40.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 88, - "character": 4 - }, - "source": "createVariable5.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 88, - "character": 4 - }, - "end": { - "line": 88, - "character": 4 - } - }, - "newText": "future futureResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable5.bal", - 1992 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction41.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction41.json deleted file mode 100644 index a42230a47155..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction41.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 14, - "character": 10 - }, - "source": "createVariable6.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 14, - "character": 4 - }, - "end": { - "line": 14, - "character": 4 - } - }, - "newText": "File|error file = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable6.bal", - 271 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction42.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction42.json deleted file mode 100644 index b4b1fcd35fce..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction42.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 2, - "character": 4 - }, - "source": "createVariable7.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 2, - "character": 4 - }, - "end": { - "line": 2, - "character": 4 - } - }, - "newText": "object {public isolated function next() returns record {|int value;|}?;} iterator = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable7.bal", - 127 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction43.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction43.json deleted file mode 100644 index f05a980e370b..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction43.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 3, - "character": 4 - }, - "source": "createVariable7.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 3, - "character": 4 - }, - "end": { - "line": 3, - "character": 4 - } - }, - "newText": "record {|int value;|}? next = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable7.bal", - 95 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction44.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction44.json deleted file mode 100644 index a4ca48af0a48..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction44.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 1, - "character": 4 - }, - "source": "createVariable8.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "byte[] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable8.bal", - 36 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction45.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction45.json deleted file mode 100644 index d793183a6939..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction45.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 2, - "character": 4 - }, - "source": "createVariable8.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 2, - "character": 4 - }, - "end": { - "line": 2, - "character": 4 - } - }, - "newText": "byte[] listResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable8.bal", - 73 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction46.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction46.json deleted file mode 100644 index 82a880dee745..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction46.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "position": { - "line": 2, - "character": 17 - }, - "source": "createVariableWithMethodCall1.bal", - "description": "Test create variable code action with lang lib method", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 2, - "character": 4 - }, - "end": { - "line": 2, - "character": 4 - } - }, - "newText": "[int, string][] enumerate = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariableWithMethodCall1.bal", - 108 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction5.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction5.json deleted file mode 100644 index bf46221470ce..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction5.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 29, - "character": 4 - }, - "source": "createVariable2.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 29, - "character": 4 - }, - "end": { - "line": 29, - "character": 4 - } - }, - "newText": "byte[] bytes = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable2.bal", - 572 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction6.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction6.json deleted file mode 100644 index d88611facc9e..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction6.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 24, - "character": 47 - }, - "source": "createVariable2.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 24, - "character": 4 - }, - "end": { - "line": 24, - "character": 4 - } - }, - "newText": "int length = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable2.bal", - 435 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction7.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction7.json deleted file mode 100644 index 457bcdd2ffe2..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction7.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 25, - "character": 33 - }, - "source": "createVariable2.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 25, - "character": 4 - }, - "end": { - "line": 25, - "character": 4 - } - }, - "newText": "string print = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable2.bal", - 492 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction8.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction8.json deleted file mode 100644 index 3e8790b0c527..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction8.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 1, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 1, - "character": 4 - }, - "end": { - "line": 1, - "character": 4 - } - }, - "newText": "int intResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 32 - ] - }, - "resolvable": false - } - ] -} diff --git a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction9.json b/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction9.json deleted file mode 100644 index bbb7aa6ca93c..000000000000 --- a/language-server/modules/langserver-core/src/test/resources/codeaction/create-variable/config/variableAssignmentRequiredCodeAction9.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "position": { - "line": 2, - "character": 4 - }, - "source": "createVariable3.bal", - "expected": [ - { - "title": "Create variable", - "kind": "quickfix", - "edits": [ - { - "range": { - "start": { - "line": 2, - "character": 4 - }, - "end": { - "line": 2, - "character": 4 - } - }, - "newText": "string stringResult = " - } - ], - "command": { - "title": "Rename variable", - "command": "ballerina.action.rename", - "arguments": [ - "createVariable3.bal", - 42 - ] - }, - "resolvable": false - } - ] -}