@@ -12,6 +12,7 @@ import { ext } from '../shared/extensionGlobals'
12
12
import { mostRecentVersionKey , pluginVersion } from './constants'
13
13
import { readFileAsString } from './filesystemUtilities'
14
14
import { getLogger } from './logger'
15
+ import { VSCODE_EXTENSION_ID , EXTENSION_ALPHA_VERSION } from './extensions'
15
16
16
17
const localize = nls . loadMessageBundle ( )
17
18
@@ -156,9 +157,9 @@ export function setMostRecentVersion(context: vscode.ExtensionContext): void {
156
157
}
157
158
158
159
/**
159
- * Publishes a toast with a link to the welcome page
160
+ * Shows a message with a link to the quickstart page.
160
161
*/
161
- async function promptQuickStart ( ) : Promise < void > {
162
+ async function showQuickstartPrompt ( ) : Promise < void > {
162
163
const view = localize ( 'AWS.command.quickStart' , 'View Quick Start' )
163
164
const prompt = await vscode . window . showInformationMessage (
164
165
localize (
@@ -174,18 +175,33 @@ async function promptQuickStart(): Promise<void> {
174
175
}
175
176
176
177
/**
177
- * Checks if a user is new to this version
178
- * If so, pops a toast with a link to a quick start page
178
+ * Shows a "new version" or "alpha version" message.
179
+ *
180
+ * - If extension version is "alpha", shows a warning message.
181
+ * - If extension version was not previously run on this machine, shows a toast
182
+ * with a link to the quickstart page.
183
+ * - Otherwise does nothing.
179
184
*
180
185
* @param context VS Code Extension Context
181
186
*/
182
- export function toastNewUser ( context : vscode . ExtensionContext ) : void {
187
+ export function showWelcomeMessage ( context : vscode . ExtensionContext ) : void {
188
+ const version = vscode . extensions . getExtension ( VSCODE_EXTENSION_ID . awstoolkit ) ?. packageJSON . version
189
+ if ( version === EXTENSION_ALPHA_VERSION ) {
190
+ vscode . window . showWarningMessage (
191
+ localize (
192
+ 'AWS.startup.toastIfAlpha' ,
193
+ 'AWS Toolkit PREVIEW. (To get the latest STABLE version, uninstall this version.)'
194
+ )
195
+ )
196
+ return
197
+ }
198
+
183
199
try {
184
200
if ( isDifferentVersion ( context ) ) {
185
201
setMostRecentVersion ( context )
186
202
// the welcome toast should be nonblocking.
187
203
// tslint:disable-next-line: no-floating-promises
188
- promptQuickStart ( )
204
+ showQuickstartPrompt ( )
189
205
}
190
206
} catch ( err ) {
191
207
// swallow error and don't block extension load
0 commit comments