@@ -100,55 +100,14 @@ async function doActivate(context: vscode.ExtensionContext, createLc: CreateLang
100
100
} ;
101
101
}
102
102
else {
103
- const versionsUrl = 'https://cdn.jsdelivr.net/gh/vuejs/language-tools/insiders.json' ;
104
103
item . text = '🚀 Vue - Official Insiders' ;
105
104
item . detail = 'Installed' ;
106
- item . busy = true ;
107
- const currentVersion = context . extension . packageJSON . version ;
108
- fetch ( versionsUrl )
109
- . then ( res => res . json ( ) )
110
- . then ( ( { versions } : { versions : { version : string ; date : string ; } [ ] ; } ) => {
111
- item . command = {
112
- title : 'Select Version' ,
113
- command : 'vue-insiders.selectVersion' ,
114
- arguments : [ { versions } ] ,
115
- } ;
116
- if ( versions . length && versions [ 0 ] . version !== currentVersion ) {
117
- item . command . title = 'Update' ;
118
- item . detail = 'New version available' ;
119
- item . severity = vscode . LanguageStatusSeverity . Warning ;
120
- }
121
- } )
122
- . catch ( ( ) => {
123
- item . detail = 'Failed to fetch versions' ;
124
- } )
125
- . finally ( ( ) => {
126
- item . busy = false ;
127
- } ) ;
128
- vscode . commands . registerCommand ( 'vue-insiders.selectVersion' , async ( { versions } : { versions : { version : string ; date : string ; } [ ] ; } ) => {
129
- const items = versions . map < vscode . QuickPickItem > ( version => ( {
130
- label : version . version ,
131
- description : version . date + ( version . version === currentVersion ? ' (current)' : '' ) ,
132
- } ) ) ;
133
- if ( ! items . some ( item => item . description ?. endsWith ( '(current)' ) ) ) {
134
- items . push ( {
135
- label : '' ,
136
- kind : vscode . QuickPickItemKind . Separator ,
137
- } , {
138
- label : currentVersion ,
139
- description : '(current)' ,
140
- } ) ;
141
- }
142
- const selected = await vscode . window . showQuickPick (
143
- items ,
144
- {
145
- canPickMany : false ,
146
- placeHolder : 'Select a version' ,
147
- } ) ;
148
- if ( ! selected || selected . label === currentVersion ) {
149
- return ;
150
- }
151
- const updateUrl = `https://github.com/volarjs/insiders/releases/tag/v${ selected . label } ` ;
105
+ item . command = {
106
+ title : 'Changelog' ,
107
+ command : 'vue-insiders.checkUpdate' ,
108
+ } ;
109
+ vscode . commands . registerCommand ( 'vue-insiders.checkUpdate' , ( ) => {
110
+ const updateUrl = 'https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md' ;
152
111
vscode . env . openExternal ( vscode . Uri . parse ( updateUrl ) ) ;
153
112
} ) ;
154
113
}
0 commit comments