This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from zzzz465/feature/insider-detection
feature: add insider detection
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { container } from 'tsyringe' | ||
import { ExtensionContext } from 'vscode' | ||
import { ExtensionContextToken } from './extension' | ||
import * as vscode from 'vscode' | ||
|
||
export default async function checkInsider() { | ||
const insiderId = 'madeline.rwxml-language-server-insider' | ||
const search = 'rwxml' | ||
|
||
const insiderExtension = vscode.extensions.getExtension(insiderId) | ||
if (insiderExtension === undefined) { | ||
return | ||
} | ||
|
||
const res = await vscode.window.showInformationMessage( | ||
'RWXML: insider version is now deprecated. Please remove the insider version.', | ||
'Remove Insider Version', | ||
'No Thanks' | ||
) | ||
|
||
if (res === 'Remove Insider Version') { | ||
await vscode.commands.executeCommand('workbench.extensions.search', search) | ||
await vscode.commands.executeCommand('workbench.extensions.uninstallExtension', insiderId) | ||
|
||
const res2 = await vscode.window.showInformationMessage( | ||
'RWXML: Insider version removed, Please reload VSCode.', | ||
{ | ||
modal: false, | ||
}, | ||
'Reload VSCode', | ||
'Later' | ||
) | ||
|
||
if (res2 === 'Reload VSCode') { | ||
await vscode.commands.executeCommand('workbench.action.reloadWindow') | ||
} else { | ||
return | ||
} | ||
} else if (res === 'No Thanks') { | ||
return | ||
} else { | ||
// user canceled it | ||
return | ||
} | ||
} |