You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regression: Emit notification to check CLI version against client (#2404)
The notification for the check is restored; now a notification is sent
regardless of mismatches between LSP & generators. Will not send a
notification if generators don't match, since then we don't have a
baseline to compare to.
Speculative downloading doesn't make a lot of sense either: download LSP
for previous version -> user changes version to match highest version ->
download missed. Since # of generators is small then probability of
failure is pretty close to 50%.
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Restores CLI version check notification and refactors version checking
logic for robustness.
>
> - **Behavior**:
> - Restores notification for CLI version check against client, sent
regardless of LSP & generator mismatches.
> - Skips notification if generators don't match, lacking a baseline for
comparison.
> - **Functions**:
> - Refactors `get_common_generator_version()` in `mod.rs` to centralize
version checking logic.
> - Introduces `send_generator_version()` in `did_save_text_document.rs`
to handle version notifications.
> - **Diagnostics**:
> - Updates `project_diagnostics()` in `diagnostics.rs` to handle
generator version mismatches.
> - **Misc**:
> - Removes speculative downloading logic.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for e0a91d9. You can
[customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->
---------
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
let major_minor = format!("{}.{}", version.major, version.minor);
1284
-
1285
-
// Track generators with this major.minor
1286
-
major_minor_versions
1287
-
.entry(major_minor.clone())
1288
-
.or_insert_with(Vec::new)
1289
-
.push(version_str);
1290
-
1291
-
// Track highest patch version for this major.minor
1292
-
highest_patch_by_major_minor
1293
-
.entry(major_minor)
1294
-
.and_modify(|highest_patch:&mutu64| {
1295
-
if version.patch > *highest_patch {
1296
-
*highest_patch = version.patch;
1297
-
}
1298
-
})
1299
-
.or_insert(version.patch);
1300
-
}else{
1301
-
tracing::warn!("Invalid semver version in generator: {}", version_str);
1302
-
// Consider how to handle invalid versions - for now, we ignore them for the check
1303
-
}
1265
+
common_version_up_to_patch(generators)
1266
+
}
1267
+
}
1268
+
1269
+
/// Given a set of SemVer version strings, match them to the same `major.minor`, returning an error otherwise. Invalid semver strings are ignored for the check.
0 commit comments