Skip to content

Commit

Permalink
fix: Hide info from activity bar (#4018)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Jan 7, 2025
1 parent a0e6728 commit 58dbdac
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@
"id": "cspell-info-explorer",
"title": "Spell Checker Info",
"icon": "resources/dark/check_circle.svg"
},
{
"id": "cspell-regexp-explorer",
"title": "Regular Expressions",
"contextualTitle": "Spell Checker",
"icon": "resources/dark/check_circle.svg"
}
],
"panel": [
Expand All @@ -235,14 +241,15 @@
{
"type": "webview",
"id": "cSpellInfoView",
"name": "Spell Checker",
"visibility": "hidden"
},
"when": "cSpell.context.displayCSpellInfo",
"name": "Spell Checker"
}
],
"cspell-regexp-explorer": [
{
"id": "cSpellRegExpView",
"name": "Regular Expressions",
"when": "config.cSpell.experimental.enableRegexpView",
"visibility": "hidden"
"when": "config.cSpell.experimental.enableRegexpView"
}
],
"cspellPanel": [
Expand Down Expand Up @@ -347,6 +354,11 @@
"category": "Spell",
"title": "Show Spell Checker Configuration Info"
},
{
"command": "cSpell.hideCSpellInfo",
"category": "Spell",
"title": "Hide Spell Checker Configuration Info"
},
{
"command": "cSpell.toggleEnableForGlobal",
"category": "Spell",
Expand Down
15 changes: 13 additions & 2 deletions packages/client/src/commands.mts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
targetsForUri,
targetsFromConfigurationTarget,
} from './settings/targetHelpers.mjs';
import { setContext } from './storage/index.mjs';
import { about, rateTheSpellChecker, releaseNotes, reportIssue, sponsor, supportRequest } from './support/index.mjs';
import { experimentWithSymbols } from './symbolServer/index.mjs';
import { findNotebookCell } from './util/documentUri.js';
Expand Down Expand Up @@ -181,8 +182,9 @@ export const commandHandlers = {
'cspell.showActionsMenu': handlerResolvedLater,

'cSpell.openIssuesPanel': callCommand('cSpellIssuesViewByFile.focus'),
'cSpell.openFileInfoView': callCommand('cSpellInfoView.focus'),
'cSpell.displayCSpellInfo': callCommand('cSpellInfoView.focus'),
'cSpell.openFileInfoView': handleDisplayCSpellInfo,
'cSpell.displayCSpellInfo': handleDisplayCSpellInfo,
'cSpell.hideCSpellInfo': handleHideCSpellInfo,

'cSpell.experimental.executeDocumentSymbolProvider': handleCmdExperimentalExecuteDocumentSymbolProvider,

Expand Down Expand Up @@ -606,6 +608,15 @@ function callCommand<T>(command: string, calcArgs?: () => unknown[]): () => Prom
};
}

async function handleDisplayCSpellInfo() {
await setContext({ displayCSpellInfo: true });
await commands.executeCommand('cSpellInfoView.focus');
}

async function handleHideCSpellInfo() {
await setContext({ displayCSpellInfo: false });
}

function handleRestart() {
return handleErrors(di.getClient().restart(), 'handle restart server');
}
Expand Down

0 comments on commit 58dbdac

Please sign in to comment.