Skip to content

Commit

Permalink
Merge branch 'development' into US1001575-Implementation-of-RESETBR-s…
Browse files Browse the repository at this point in the history
…tatement-in-CICS
  • Loading branch information
ilidio-lopes authored Jan 9, 2025
2 parents 3f6285c + 813fa65 commit fed8ebc
Show file tree
Hide file tree
Showing 148 changed files with 7,699 additions and 2,726 deletions.
3 changes: 3 additions & 0 deletions clients/cobol-lsp-vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@
"items": {
"type": "string"
},
"default": [
"**"
],
"description": "Default list of local paths to search for copybooks",
"uniqueItems": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,58 @@ suite("Integration Test Suite: Copybooks", function () {
})
.timeout(helper.TEST_TIMEOUT)
.slow(1000);

suite("Default copybook configuration", () => {
suite("default configuration - local configuration path not set", () => {
suiteSetup(async () => {
await helper.updateConfig("default.json");
await helper.activate();
});

test("Local copybooks are resolved from local subfolders if no configuration is provided", async () => {
const editor = await helper.showDocument("USERC1N1.cbl");

let diagnostics: vscode.Diagnostic[] = [];
await helper.waitFor(() => {
diagnostics = vscode.languages.getDiagnostics(editor.document.uri);
return (
diagnostics.length > 0 &&
diagnostics.some((d) => d.message === "Errors inside the copybook")
);
});

assert.strictEqual(
diagnostics.filter((d) => d.message === "BOOK1N: Copybook not found")
.length,
0,
);
});
});

suite("local copybook path is configured", () => {
suiteSetup(async () => {
await helper.updateConfig("testing.json");
await helper.activate();
});

test("Only folder from configuration is used for local copybook resolution", async () => {
const editor = await helper.showDocument("USERC1N1.cbl");

let diagnostics: vscode.Diagnostic[] = [];
await helper.waitFor(() => {
diagnostics = vscode.languages.getDiagnostics(editor.document.uri);
return (
diagnostics.length > 0 &&
diagnostics.some((d) => d.message === "BOOK1N: Copybook not found")
);
});

assert.strictEqual(
diagnostics.filter((d) => d.message === "BOOK1N: Copybook not found")
.length,
1,
);
});
});
});
});

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>common</artifactId>
<groupId>org.eclipse.lsp.cobol</groupId>
<version>1.0.11</version>
<version>1.0.12</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public enum NodeType {
PARAGRAPH,
PARAGRAPH_NAME_NODE,
PERFORM,
PERFORM_UNTIL_NODE,
PROCEDURE_SECTION,
PROCEDURE_RETURNING,
PROCEDURE_USING,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2025 Broadcom.
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Broadcom, Inc. - initial API and implementation
*
*/
package org.eclipse.lsp.cobol.common.model.tree;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.eclipse.lsp.cobol.common.model.Locality;
import org.eclipse.lsp.cobol.common.model.NodeType;

/** The class represents perform until clause. */
@ToString(callSuper = true)
@Getter
@EqualsAndHashCode(callSuper = true)
public class PerformUntilNode extends Node {

private final boolean untilExit;

public PerformUntilNode(Locality location, boolean untilExit) {
super(location, NodeType.PERFORM_UNTIL_NODE);
this.untilExit = untilExit;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2024 Broadcom.
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Broadcom, Inc. - initial API and implementation
*
*/

package org.eclipse.lsp.cobol.common.model.tree.statements;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.eclipse.lsp.cobol.common.model.Locality;
import org.eclipse.lsp.cobol.common.model.tree.Node;

import java.util.List;

/** This class implements the logic for SET TO statement. */
@EqualsAndHashCode(callSuper = true)
@Getter
public class SetToStatement extends StatementNode {
boolean address;
List<Node> receivingFields;
Node sendingField;

public SetToStatement(boolean address, Locality locality, List<Node> receivingFields, Node sendingField) {
super(locality);
this.address = address;
this.receivingFields = receivingFields;
this.sendingField = sendingField;
}
}
2 changes: 1 addition & 1 deletion server/engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
<version>${maven.surefire.plugin.version}</version>
<configuration>
<parallel>all</parallel>
<argLine>${argLine} -Dperformance.log.path=${project.build.directory}/perf.csv -javaagent:${org.mockito:mockito-core:jar}</argLine>
<argLine>${argLine} -Dperformance.log.path=${project.build.directory}/perf.csv</argLine>
<systemPropertyVariables>
<property>
<name>filesToTestPath</name>
Expand Down
Loading

0 comments on commit fed8ebc

Please sign in to comment.