Skip to content

Commit bfd1774

Browse files
committed
feat(docs): finish codegen
1 parent 918fee7 commit bfd1774

File tree

26 files changed

+902
-44
lines changed

26 files changed

+902
-44
lines changed

Cargo.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pglt_cli/src/cli_options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct CliOptions {
4848
#[bpaf(long("no-errors-on-unmatched"), switch)]
4949
pub no_errors_on_unmatched: bool,
5050

51-
/// Tell PGLSP to exit with an error code if some diagnostics emit warnings.
51+
/// Tell PgLT to exit with an error code if some diagnostics emit warnings.
5252
#[bpaf(long("error-on-warnings"), switch)]
5353
pub error_on_warnings: bool,
5454

@@ -86,7 +86,7 @@ pub struct CliOptions {
8686
fallback(Severity::default()),
8787
display_fallback
8888
)]
89-
/// The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing `--diagnostic-level=error` will cause PGLSP to print only diagnostics that contain only errors.
89+
/// The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing `--diagnostic-level=error` will cause PgLT to print only diagnostics that contain only errors.
9090
pub diagnostic_level: Severity,
9191
}
9292

crates/pglt_cli/src/commands/daemon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ fn setup_tracing_subscriber(log_path: Option<PathBuf>, log_file_name_prefix: Opt
230230
}
231231

232232
pub fn default_pglt_log_path() -> PathBuf {
233-
match env::var_os("PGLSP_LOG_PATH") {
233+
match env::var_os("PGLT_LOG_PATH") {
234234
Some(directory) => PathBuf::from(directory),
235235
None => pglt_fs::ensure_cache_dir().join("pglt-logs"),
236236
}

crates/pglt_cli/src/commands/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub enum PgltCommand {
7272
Start {
7373
/// Allows to change the prefix applied to the file name of the logs.
7474
#[bpaf(
75-
env("PGLSP_LOG_PREFIX_NAME"),
75+
env("PGLT_LOG_PREFIX_NAME"),
7676
long("log-prefix-name"),
7777
argument("STRING"),
7878
hide_usage,
@@ -83,7 +83,7 @@ pub enum PgltCommand {
8383

8484
/// Allows to change the folder where logs are stored.
8585
#[bpaf(
86-
env("PGLSP_LOG_PATH"),
86+
env("PGLT_LOG_PATH"),
8787
long("log-path"),
8888
argument("PATH"),
8989
hide_usage,
@@ -92,7 +92,7 @@ pub enum PgltCommand {
9292
log_path: PathBuf,
9393
/// Allows to set a custom file path to the configuration file,
9494
/// or a custom directory path to find `pglt.toml`
95-
#[bpaf(env("PGLSP_LOG_PREFIX_NAME"), long("config-path"), argument("PATH"))]
95+
#[bpaf(env("PGLT_LOG_PREFIX_NAME"), long("config-path"), argument("PATH"))]
9696
config_path: Option<PathBuf>,
9797
},
9898

@@ -109,7 +109,7 @@ pub enum PgltCommand {
109109
LspProxy {
110110
/// Allows to change the prefix applied to the file name of the logs.
111111
#[bpaf(
112-
env("PGLSP_LOG_PREFIX_NAME"),
112+
env("PGLT_LOG_PREFIX_NAME"),
113113
long("log-prefix-name"),
114114
argument("STRING"),
115115
hide_usage,
@@ -119,7 +119,7 @@ pub enum PgltCommand {
119119
log_prefix_name: String,
120120
/// Allows to change the folder where logs are stored.
121121
#[bpaf(
122-
env("PGLSP_LOG_PATH"),
122+
env("PGLT_LOG_PATH"),
123123
long("log-path"),
124124
argument("PATH"),
125125
hide_usage,
@@ -128,7 +128,7 @@ pub enum PgltCommand {
128128
log_path: PathBuf,
129129
/// Allows to set a custom file path to the configuration file,
130130
/// or a custom directory path to find `pglt.toml`
131-
#[bpaf(env("PGLSP_CONFIG_PATH"), long("config-path"), argument("PATH"))]
131+
#[bpaf(env("PGLT_CONFIG_PATH"), long("config-path"), argument("PATH"))]
132132
config_path: Option<PathBuf>,
133133
/// Bogus argument to make the command work with vscode-languageclient
134134
#[bpaf(long("stdio"), hide, hide_usage, switch)]
@@ -143,7 +143,7 @@ pub enum PgltCommand {
143143
RunServer {
144144
/// Allows to change the prefix applied to the file name of the logs.
145145
#[bpaf(
146-
env("PGLSP_LOG_PREFIX_NAME"),
146+
env("PGLT_LOG_PREFIX_NAME"),
147147
long("log-prefix-name"),
148148
argument("STRING"),
149149
hide_usage,
@@ -153,7 +153,7 @@ pub enum PgltCommand {
153153
log_prefix_name: String,
154154
/// Allows to change the folder where logs are stored.
155155
#[bpaf(
156-
env("PGLSP_LOG_PATH"),
156+
env("PGLT_LOG_PATH"),
157157
long("log-path"),
158158
argument("PATH"),
159159
hide_usage,
@@ -165,7 +165,7 @@ pub enum PgltCommand {
165165
stop_on_disconnect: bool,
166166
/// Allows to set a custom file path to the configuration file,
167167
/// or a custom directory path to find `pglt.toml`
168-
#[bpaf(env("PGLSP_CONFIG_PATH"), long("config-path"), argument("PATH"))]
168+
#[bpaf(env("PGLT_CONFIG_PATH"), long("config-path"), argument("PATH"))]
169169
config_path: Option<PathBuf>,
170170
},
171171
#[bpaf(command("__print_socket"), hide)]

crates/pglt_cli/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn command_name() -> String {
1515
.unwrap_or_else(|| String::from("pglt"))
1616
}
1717

18-
/// A diagnostic that is emitted when running PGLSP via CLI.
18+
/// A diagnostic that is emitted when running PgLT via CLI.
1919
///
2020
/// When displaying the diagnostic,
2121
#[derive(Debug, Diagnostic)]

crates/pglt_cli/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub use panic::setup_panic_handler;
3232
pub use reporter::{DiagnosticsPayload, Reporter, ReporterVisitor, TraversalSummary};
3333
pub use service::{open_transport, SocketTransport};
3434

35-
pub(crate) const VERSION: &str = match option_env!("PGLSP_VERSION") {
35+
pub(crate) const VERSION: &str = match option_env!("PGLT_VERSION") {
3636
Some(version) => version,
3737
None => env!("CARGO_PKG_VERSION"),
3838
};

crates/pglt_configuration/src/analyser/linter/rules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl std::str::FromStr for RuleGroup {
4646
#[cfg_attr(feature = "schema", derive(JsonSchema))]
4747
#[serde(rename_all = "camelCase", deny_unknown_fields)]
4848
pub struct Rules {
49-
#[doc = r" It enables the lint rules recommended by PGLSP. `true` by default."]
49+
#[doc = r" It enables the lint rules recommended by PgLT. `true` by default."]
5050
#[serde(skip_serializing_if = "Option::is_none")]
5151
pub recommended: Option<bool>,
5252
#[doc = r" It enables ALL rules. The rules that belong to `nursery` won't be enabled."]

crates/pglt_configuration/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use migrations::{
3434
use serde::{Deserialize, Serialize};
3535
use vcs::VcsClientKind;
3636

37-
pub const VERSION: &str = match option_env!("PGLSP_VERSION") {
37+
pub const VERSION: &str = match option_env!("PGLT_VERSION") {
3838
Some(version) => version,
3939
None => "0.0.0",
4040
};

crates/pglt_flags/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@ use std::sync::{LazyLock, OnceLock};
88

99
/// Returns `true` if this is an unstable build of PgLT
1010
pub fn is_unstable() -> bool {
11-
PGLSP_VERSION.deref().is_none()
11+
PGLT_VERSION.deref().is_none()
1212
}
1313

1414
/// The internal version of PgLT. This is usually supplied during the CI build
15-
pub static PGLSP_VERSION: LazyLock<Option<&str>> = LazyLock::new(|| option_env!("PGLSP_VERSION"));
15+
pub static PGLT_VERSION: LazyLock<Option<&str>> = LazyLock::new(|| option_env!("PGLT_VERSION"));
1616

1717
pub struct PgLTEnv {
1818
pub pglt_log_path: PgLTEnvVariable,
1919
pub pglt_log_prefix: PgLTEnvVariable,
2020
pub pglt_config_path: PgLTEnvVariable,
2121
}
2222

23-
pub static PGLSP_ENV: OnceLock<PgLTEnv> = OnceLock::new();
23+
pub static PGLT_ENV: OnceLock<PgLTEnv> = OnceLock::new();
2424

2525
impl PgLTEnv {
2626
fn new() -> Self {
2727
Self {
2828
pglt_log_path: PgLTEnvVariable::new(
29-
"PGLSP_LOG_PATH",
29+
"PGLT_LOG_PATH",
3030
"The directory where the Daemon logs will be saved.",
3131
),
3232
pglt_log_prefix: PgLTEnvVariable::new(
33-
"PGLSP_LOG_PREFIX_NAME",
33+
"PGLT_LOG_PREFIX_NAME",
3434
"A prefix that's added to the name of the log. Default: `server.log.`",
3535
),
3636
pglt_config_path: PgLTEnvVariable::new(
37-
"PGLSP_CONFIG_PATH",
37+
"PGLT_CONFIG_PATH",
3838
"A path to the configuration file",
3939
),
4040
}
@@ -71,7 +71,7 @@ impl PgLTEnvVariable {
7171
}
7272

7373
pub fn pglt_env() -> &'static PgLTEnv {
74-
PGLSP_ENV.get_or_init(PgLTEnv::new)
74+
PGLT_ENV.get_or_init(PgLTEnv::new)
7575
}
7676

7777
impl Display for PgLTEnv {

crates/pglt_fs/src/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ mod os;
1818
pub struct ConfigName;
1919

2020
impl ConfigName {
21-
const PGLSP_TOML: [&'static str; 1] = ["pglt.toml"];
21+
const PGLT_TOML: [&'static str; 1] = ["pglt.toml"];
2222

2323
pub const fn pglt_toml() -> &'static str {
24-
Self::PGLSP_TOML[0]
24+
Self::PGLT_TOML[0]
2525
}
2626

2727
pub const fn file_names() -> [&'static str; 1] {
28-
Self::PGLSP_TOML
28+
Self::PGLT_TOML
2929
}
3030
}
3131

0 commit comments

Comments
 (0)