Skip to content

Commit 79be346

Browse files
committed
fix: don't search copybooks if no paths are specified
1 parent 23c5880 commit 79be346

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

clients/cobol-lsp-vscode-extension/src/services/Settings.ts

-12
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,6 @@ export class SettingsService {
244244
];
245245
const wsFolders = SettingsUtils.getWorkspaceFoldersPath(true);
246246

247-
// if no configuration for local or remote copybook paths is provided
248-
// use pattern for workspace folder and subfolders as a default value
249-
if (
250-
paths.length === 0 &&
251-
this.getCopybookConfigValues(PATHS_DSN, documentUri, dialectType)
252-
.length === 0 &&
253-
this.getCopybookConfigValues(PATHS_USS, documentUri, dialectType)
254-
.length === 0
255-
) {
256-
paths.push("**");
257-
}
258-
259247
return SettingsService.prepareLocalSearchFolders(paths, wsFolders);
260248
}
261249

clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.copybooks.test.ts

-32
Original file line numberDiff line numberDiff line change
@@ -173,38 +173,6 @@ suite("Integration Test Suite: Copybooks", function () {
173173
.slow(1000);
174174

175175
suite("Default local copybooks paths configuration", () => {
176-
suite("local or remote copybook paths not set", () => {
177-
suiteSetup(async () => {
178-
await helper.updateConfig("default.json");
179-
await helper.activate();
180-
});
181-
182-
test("Local copybooks are resolved from workspace subfolders if no configuration is provided", async () => {
183-
const editor = await helper.showDocument("USERC1N1.cbl");
184-
185-
let diagnostics: vscode.Diagnostic[] = [];
186-
await helper.waitFor(() => {
187-
diagnostics = vscode.languages.getDiagnostics(editor.document.uri);
188-
189-
return (
190-
diagnostics.length > 0 &&
191-
diagnostics.some(
192-
(d) => d.message === "Errors inside the copybook",
193-
) &&
194-
diagnostics.filter(
195-
(d) => d.message === "BOOK1N: Copybook not found",
196-
).length === 0
197-
);
198-
});
199-
200-
assert.strictEqual(
201-
diagnostics.filter((d) => d.message === "BOOK1N: Copybook not found")
202-
.length,
203-
0,
204-
);
205-
});
206-
});
207-
208176
suite("local copybook path is configured", () => {
209177
suiteSetup(async () => {
210178
await helper.updateConfig("testing.json");

0 commit comments

Comments
 (0)