vscode#Extension TypeScript Examples
The following examples show how to use
vscode#Extension.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ALLangServerProxy.ts From vscode-alxmldocumentation with MIT License | 6 votes |
/**
* Get actual AL Language extension.
*/
public GetALExtension() : Extension<any> | undefined {
let storeVersion = extensions.getExtension('ms-dynamics-smb.al');
let vsixVersion = extensions.getExtension('Microsoft.al');
if ((storeVersion) && (vsixVersion)) {
if (storeVersion.isActive) {
return storeVersion;
}
if (vsixVersion.isActive) {
return vsixVersion;
}
return storeVersion;
}
if (storeVersion) {
return storeVersion;
}
return vsixVersion;
}
Example #2
Source File: UpgradeSettings.ts From dendron with GNU Affero General Public License v3.0 | 6 votes |
async execute(_opts: UpgradeSettingsCommandOpts) {
const ctx = "Upgrade:execute";
L.info({ ctx });
const wsRoot = (await DendronExtension.workspaceRoots())[0];
const newConfig = await WorkspaceConfig.update(wsRoot!);
this.L.info({ ctx, newConfig });
// vscode doesn't let us uninstall extensions
// tell user to uninstall extensions we no longer want
const badExtensions: Extension<any>[] =
(newConfig.extensions.unwantedRecommendations
?.map((ext) => {
return extensions.getExtension(ext);
})
.filter(Boolean) as Extension<any>[]) || [];
this.L.info({ ctx, badExtensions });
if (!_.isEmpty(badExtensions)) {
const msg = [
"Manual action needed!",
"The following extensions need to be uninstalled: ",
]
.concat([
badExtensions.map((ext) => ext.packageJSON.displayName).join(", "),
])
.concat([
"- Reload the window afterwards and Dendron will offer to install the Dendron version of the extension",
]);
window.showWarningMessage(msg.join(" "));
}
return { configUpdate: newConfig };
}
Example #3
Source File: DoExport.ts From vscode-alxmldocumentation with MIT License | 5 votes |
private extension!: Extension<any>;
Example #4
Source File: extension.ts From plugin-vscode with Apache License 2.0 | 5 votes |
public extension: Extension<any>;
Example #5
Source File: DrawioExtensionApi.ts From vscode-drawio with GNU General Public License v3.0 | 5 votes |
constructor(private readonly api: Extension<DrawioExtensionApi>) {}