Skip to content

fix: don't hide commands in web ui and show path to cp folder if we can't open it. #2548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 11 additions & 22 deletions clients/cobol-lsp-vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,68 +101,57 @@
{
"command": "cobol-lsp.cpy-manager.fetch-copybook",
"category": "COBOL",
"title": "Fetch Copybook",
"when": "!isWeb"
"title": "Fetch Copybook"
},
{
"command": "cobol-lsp.cpy-manager.goto-settings",
"category": "COBOL",
"title": "Open Copybook Location Settings",
"when": "!isWeb"
"title": "Open Copybook Location Settings"
},
{
"command": "cobol-lsp.serverRuntime.goto-settings",
"category": "COBOL",
"title": "Open Server Runtime Settings",
"when": "!isWeb"
"title": "Open Server Runtime Settings"
},
{
"command": "cobol-lsp.dialects.goto-settings",
"category": "COBOL",
"title": "Open Dialect Settings",
"when": "!isWeb"
"title": "Open Dialect Settings"
},
{
"command": "cobol-lsp.commentLine.toggle",
"category": "COBOL",
"title": "Toggle COBOL Line Comment",
"when": "!isWeb"
"title": "Toggle COBOL Line Comment"
},
{
"command": "cobol-lsp.commentLine.comment",
"category": "COBOL",
"title": "Add COBOL Line Comment",
"when": "!isWeb"
"title": "Add COBOL Line Comment"
},
{
"command": "cobol-lsp.commentLine.uncomment",
"category": "COBOL",
"title": "Remove COBOL Line Comment",
"when": "!isWeb"
"title": "Remove COBOL Line Comment"
},
{
"command": "cobol-lsp.clear.downloaded.copybooks",
"category": "COBOL",
"title": "Clear Downloaded Copybooks",
"when": "!isWeb"
"title": "Clear Downloaded Copybooks"
},
{
"command": "cobol-lsp.analysis.runAnalysis",
"category": "COBOL",
"title": "Run Analysis in CLI",
"when": "!isWeb"
"title": "Run Analysis in CLI"
},
{
"command": "cobol-lsp.snippets.insertSnippets",
"title": "Insert COBOL Snippet",
"category": "Snippets",
"when": "!isWeb"
"category": "Snippets"
},
{
"command": "cobol-lsp.open.copybook.internalfolder",
"title": "Open Copybooks Internal Folder",
"category": "COBOL",
"when": "!isWeb"
"category": "COBOL"
}
]
},
Expand Down
16 changes: 12 additions & 4 deletions clients/cobol-lsp-vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,18 @@ function registerCommands(
);
try {
await vscode.workspace.fs.createDirectory(copybookFolder);
await vscode.commands.executeCommand(
"revealFileInOS",
copybookFolder,
);
if (
(await vscode.commands.getCommands()).includes("revealFileInOS")
) {
await vscode.commands.executeCommand(
"revealFileInOS",
copybookFolder,
);
} else {
vscode.window.showInformationMessage(
"Internal copybooks folder: '" + copybookFolder + "'",
);
}
} catch (error) {
vscode.window.showErrorMessage(FAIL_CREATE_COPYBOOK_FOLDER_MSG);
outputChannel.appendLine(
Expand Down
Loading