Skip to content

Commit ef2e03d

Browse files
committed
Use lexicographic comparison for calendar versions
1 parent 5f1287f commit ef2e03d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/vscode/src/host/hooks.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ class EmbeddedStatementRangeProvider implements HostStatementRangeProvider {
223223

224224
// TODO: Remove this once `apps/vscode/package.json` bumps to `"positron": "^2026.03.0"` or higher.
225225
// For now we avoid aggressive bumping due to https://github.com/posit-dev/positron/issues/11321.
226-
if (semver.lt(hooks.version, "2026.03.0")) {
226+
// We can't use `semver.lt()` because calendar versioning isn't compatible with semver due to the
227+
// leading `0` in `03`. Instead, we use lexicographic string comparison and rely on the year and
228+
// month to be zero padded so sorting always works correctly.
229+
if (hooks.version < "2026.03.0") {
227230
throw err;
228231
}
229232

0 commit comments

Comments
 (0)