Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/vs/platform/update/common/positronVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ export interface IPositronVersion {
*
* @param version - The version string to parse.
*/
export function parse(version: string): IPositronVersion {
export function parse(version: string): IPositronVersion | undefined {
if (!version || version.length === 0) {
return undefined;
}
if (!POSITRON_VERSION_REGEX.test(version)) {
throw new Error('Version format must be YYYY.MM.patch-build');
throw new Error(`Invalid version '${version}'; format must be YYYY.MM.patch-build`);
}
const [year, month, patchBuild] = version.split('.');
const [patch, build] = patchBuild.split('-').map(Number);
Expand Down Expand Up @@ -56,6 +59,21 @@ export function compare(v1: string, v2: string): number {
const p1 = parse(v1);
const p2 = parse(v2);

// Handle empty versions
if (p1 === undefined && p2 === undefined) {
// Both versions are empty
return 0;
}
if (p1 === undefined) {
// Only v1 is empty; v2 is valid, so v1 < v2
return -1;
}
if (p2 === undefined) {
// Only v2 is empty; v1 is valid, so v1 > v2
return 1;
}

// Compare year, month, patch, and build
if (p1.year !== p2.year) {
return p1.year - p2.year;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,12 @@ class ConfigurationDefaultOverridesContribution extends Disposable implements IW
const allProperties = this.configurationRegistry.getConfigurationProperties();
for (const property of properties) {
const schema = allProperties[property];
// --- Start Positron ---
// Some experimental settings don't have a schema at all.
if (!schema) {
continue;
}
// --- End Positron ---
if (!schema.experiment) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export class ExtensionsProposedApi {
const key = ExtensionIdentifier.toKey(k);
const proposalNames = value.filter(name => {
if (!allApiProposals[<ApiProposalName>name]) {
_logService.warn(`Via 'product.json#extensionEnabledApiProposals' extension '${key}' wants API proposal '${name}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`);
// --- Start Positron ---
// We can ignore these; Positron does not track or enforce API proposal permissions.
// _logService.warn(`Via 'product.json#extensionEnabledApiProposals' extension '${key}' wants API proposal '${name}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`);
// --- End Positron ---
return false;
}
return true;
Expand All @@ -59,6 +62,13 @@ export class ExtensionsProposedApi {
}

updateEnabledApiProposals(extensions: IExtensionDescription[]): void {
// --- Start Positron ---
// Positron does not track or enforce API proposal permissions.
if (extensions.length > 0) {
return;
}
// --- End Positron ---

for (const extension of extensions) {
this.doUpdateEnabledApiProposals(extension);
}
Expand Down