mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from master
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
// Broadcast communication constants
|
||||
|
||||
export const EXTENSION_LOG_BROADCAST_CHANNEL = 'vscode:extensionLog';
|
||||
|
||||
@@ -2,8 +2,32 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IExtensionManifest } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
|
||||
export const MANIFEST_CACHE_FOLDER = 'CachedExtensions';
|
||||
export const USER_MANIFEST_CACHE_FILE = 'user';
|
||||
export const BUILTIN_MANIFEST_CACHE_FILE = 'builtin';
|
||||
|
||||
const uiExtensions = new Set<string>();
|
||||
uiExtensions.add('msjsdiag.debugger-for-chrome');
|
||||
|
||||
export function isUIExtension(manifest: IExtensionManifest, configurationService: IConfigurationService): boolean {
|
||||
const extensionId = getGalleryExtensionId(manifest.publisher, manifest.name);
|
||||
const configuredUIExtensions = configurationService.getValue<string[]>('_workbench.uiExtensions') || [];
|
||||
if (configuredUIExtensions.length) {
|
||||
if (configuredUIExtensions.indexOf(extensionId) !== -1) {
|
||||
return true;
|
||||
}
|
||||
if (configuredUIExtensions.indexOf(`-${extensionId}`) !== -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
switch (manifest.extensionKind) {
|
||||
case 'ui': return true;
|
||||
case 'workspace': return false;
|
||||
default: return uiExtensions.has(extensionId) || !manifest.main;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import pkg from 'vs/platform/node/package';
|
||||
@@ -16,7 +15,7 @@ export interface IParsedVersion {
|
||||
minorMustEqual: boolean;
|
||||
patchBase: number;
|
||||
patchMustEqual: boolean;
|
||||
preRelease: string;
|
||||
preRelease: string | null;
|
||||
}
|
||||
|
||||
export interface INormalizedVersion {
|
||||
@@ -36,7 +35,7 @@ export function isValidVersionStr(version: string): boolean {
|
||||
return (version === '*' || VERSION_REGEXP.test(version));
|
||||
}
|
||||
|
||||
export function parseVersion(version: string): IParsedVersion {
|
||||
export function parseVersion(version: string): IParsedVersion | null {
|
||||
if (!isValidVersionStr(version)) {
|
||||
return null;
|
||||
}
|
||||
@@ -58,6 +57,9 @@ export function parseVersion(version: string): IParsedVersion {
|
||||
}
|
||||
|
||||
let m = version.match(VERSION_REGEXP);
|
||||
if (!m) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
hasCaret: m[1] === '^',
|
||||
hasGreaterEquals: m[1] === '>=',
|
||||
@@ -71,7 +73,7 @@ export function parseVersion(version: string): IParsedVersion {
|
||||
};
|
||||
}
|
||||
|
||||
export function normalizeVersion(version: IParsedVersion): INormalizedVersion {
|
||||
export function normalizeVersion(version: IParsedVersion | null): INormalizedVersion | null {
|
||||
if (!version) {
|
||||
return null;
|
||||
}
|
||||
@@ -104,14 +106,14 @@ export function normalizeVersion(version: IParsedVersion): INormalizedVersion {
|
||||
}
|
||||
|
||||
export function isValidVersion(_version: string | INormalizedVersion, _desiredVersion: string | INormalizedVersion): boolean {
|
||||
let version: INormalizedVersion;
|
||||
let version: INormalizedVersion | null;
|
||||
if (typeof _version === 'string') {
|
||||
version = normalizeVersion(parseVersion(_version));
|
||||
} else {
|
||||
version = _version;
|
||||
}
|
||||
|
||||
let desiredVersion: INormalizedVersion;
|
||||
let desiredVersion: INormalizedVersion | null;
|
||||
if (typeof _desiredVersion === 'string') {
|
||||
desiredVersion = normalizeVersion(parseVersion(_desiredVersion));
|
||||
} else {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { INormalizedVersion, IParsedVersion, IReducedExtensionDescription, isValidExtensionVersion, isValidVersion, isValidVersionStr, normalizeVersion, parseVersion } from 'vs/platform/extensions/node/extensionValidator';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user