1- import { workspace , commands } from 'vscode' ;
1+ import { workspace , commands , window } from 'vscode' ;
22import { newLogger } from '@dbux/common/src/log/logger' ;
33import { initMemento , get as mementoGet , set as mementoSet } from './memento' ;
44import { initInstallId } from './installId' ;
@@ -9,6 +9,8 @@ import { initPreActivateView } from './preActivateView/preActivateNodeProvider';
99import { registerCommand } from './commands/commandUtil' ;
1010import initLang from './lang' ;
1111import { getCurrentResearch } from './research/Research' ;
12+ import { activateWorkshopSession , isValidCode } from './workshop/Workshop' ;
13+ import { showInformationMessage } from './codeUtil/codeModals' ;
1214
1315/** @typedef {import('./dialogs/dialogController').DialogController } DialogController */
1416
@@ -107,6 +109,20 @@ async function ensureActivate(context) {
107109 */
108110function initPreActivateCommand ( context ) {
109111 registerCommand ( context , 'dbux.doActivate' , async ( ) => ensureActivate ( context ) ) ;
112+
113+ registerCommand ( context , 'dbux.doWorkshopActivate' , async ( ) => {
114+ const code = await window . showInputBox ( {
115+ ignoreFocusOut : true ,
116+ placeHolder : 'Enter Workshop Code'
117+ } ) ;
118+ if ( isValidCode ( code ) ) {
119+ activateWorkshopSession ( code ) ;
120+ await ensureActivate ( context ) ;
121+ }
122+ else {
123+ await showInformationMessage ( `Workshop code ${ code } is invalid` ) ;
124+ }
125+ } ) ;
110126}
111127
112128function registerErrorHandler ( ) {
0 commit comments