Skip to content

Commit

Permalink
improve completion plugin menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
dlqqq committed Jan 19, 2024
1 parent aad63dd commit 9a4d43f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/jupyter-ai/src/completions/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const completionPlugin: JupyterFrontEndPlugin<void> = {
enabled: !jaiIcpSettings.enabled
});
},
label: 'Enable Jupyternaut Completions',
label: 'Enable completions by Jupyternaut',
isToggled: () => {
return provider.isEnabled();
}
Expand All @@ -159,12 +159,16 @@ export const completionPlugin: JupyterFrontEndPlugin<void> = {
label: () => {
const language = findCurrentLanguage();
return language
? `Enable Completions in ${displayName(language)}`
: 'Enable Completions for <language>';
? `Disable completions for ${displayName(language)} files`
: 'Disable completions for <language> files';
},
isToggled: () => {
const language = findCurrentLanguage();
return !!language && provider.isLanguageEnabled(language.name);
return !!language && !provider.isLanguageEnabled(language.name);
},
isVisible: () => {
const language = findCurrentLanguage();
return !!language;
},
isEnabled: () => {
const language = findCurrentLanguage();
Expand Down

0 comments on commit 9a4d43f

Please sign in to comment.