From 892198300854139d15561e01153a52fdb7ef696a Mon Sep 17 00:00:00 2001 From: psteinroe Date: Tue, 28 Oct 2025 09:35:06 +0100 Subject: [PATCH 1/2] fix(env): version --- crates/pgt_env/src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/pgt_env/src/lib.rs b/crates/pgt_env/src/lib.rs index 03a47298f..93d7116d5 100644 --- a/crates/pgt_env/src/lib.rs +++ b/crates/pgt_env/src/lib.rs @@ -15,12 +15,8 @@ pub fn is_unstable() -> bool { VERSION == "0.0.0" } -/// The internal version of Postgres Language Server. This is usually supplied during the CI build -pub static PGLS_VERSION: LazyLock> = - LazyLock::new(|| option_env!("PGLS_VERSION").or(option_env!("PGT_VERSION"))); - -/// The version of Postgres Tools with fallback logic -pub const VERSION: &str = match option_env!("PGT_VERSION") { +/// The version of Postgres Language Server. This is usually supplied during the CI build +pub const VERSION: &str = match option_env!("PGLS_VERSION").or(option_env!("PGT_VERSION")) { Some(version) => version, None => match option_env!("CARGO_PKG_VERSION") { Some(pkg_version) => pkg_version, From 6d4827d5eaa921bc42851118ea9c084ea73af433 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Tue, 28 Oct 2025 09:39:23 +0100 Subject: [PATCH 2/2] progress --- crates/pgt_env/src/lib.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/pgt_env/src/lib.rs b/crates/pgt_env/src/lib.rs index 93d7116d5..14de584a2 100644 --- a/crates/pgt_env/src/lib.rs +++ b/crates/pgt_env/src/lib.rs @@ -8,19 +8,22 @@ use pgt_console::fmt::{Display, Formatter}; use pgt_console::{DebugDisplay, KeyValuePair, markup}; use std::env; -use std::sync::{LazyLock, OnceLock}; +use std::sync::OnceLock; /// Returns `true` if this is an unstable build of Postgres Language Server pub fn is_unstable() -> bool { VERSION == "0.0.0" } -/// The version of Postgres Language Server. This is usually supplied during the CI build -pub const VERSION: &str = match option_env!("PGLS_VERSION").or(option_env!("PGT_VERSION")) { +/// The version of Postgres Language Server. This is usually supplied during the CI build. +pub const VERSION: &str = match option_env!("PGLS_VERSION") { Some(version) => version, - None => match option_env!("CARGO_PKG_VERSION") { - Some(pkg_version) => pkg_version, - None => "0.0.0", + None => match option_env!("PGT_VERSION") { + Some(version) => version, + None => match option_env!("CARGO_PKG_VERSION") { + Some(pkg_version) => pkg_version, + None => "0.0.0", + }, }, };