Skip to content

Commit efeabe8

Browse files
committed
progress
2 parents e90dfd9 + f113ec7 commit efeabe8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1446
-542
lines changed

.sqlx/query-b0163e58e9c646e3af524174081b74ab7e7938e9516ea21513265c49d304b6ea.json renamed to .sqlx/query-1cc58ddce2b52b5d6f6519cde339f258bce50342c2d5cce036dba4f9062cf811.json

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

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ biome_js_syntax = "0.5.7"
2323
biome_rowan = "0.5.7"
2424
biome_string_case = "0.5.8"
2525
bpaf = { version = "0.9.15", features = ["derive"] }
26+
criterion = "0.5"
2627
crossbeam = "0.8.4"
2728
enumflags2 = "0.7.11"
2829
ignore = "0.4.23"

crates/pgt_analyse/src/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl AnalyserRules {
4545
/// A set of information useful to the analyser infrastructure
4646
#[derive(Debug, Default)]
4747
pub struct AnalyserOptions {
48-
/// A data structured derived from the [`postgrestools.jsonc`] file
48+
/// A data structured derived from the [`postgres-language-server.jsonc`] file
4949
pub rules: AnalyserRules,
5050
}
5151

crates/pgt_analyser/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Let's assume that the rule we implement support the following options:
8181
- `threshold`: an integer between 0 and 255;
8282
- `behaviorExceptions`: an array of strings.
8383

84-
We would like to set the options in the `postgrestools.jsonc` configuration file:
84+
We would like to set the options in the `postgres-language-server.jsonc` configuration file:
8585

8686
```json
8787
{
@@ -143,9 +143,9 @@ We currently require implementing _serde_'s traits `Deserialize`/`Serialize`.
143143

144144
Also, we use other `serde` macros to adjust the JSON configuration:
145145

146-
- `rename_all = "camelCase"`: it renames all fields in camel-case, so they are in line with the naming style of the `postgrestools.jsonc`.
146+
- `rename_all = "camelCase"`: it renames all fields in camel-case, so they are in line with the naming style of the `postgres-language-server.jsonc`.
147147
- `deny_unknown_fields`: it raises an error if the configuration contains extraneous fields.
148-
- `default`: it uses the `Default` value when the field is missing from `postgrestools.jsonc`. This macro makes the field optional.
148+
- `default`: it uses the `Default` value when the field is missing from `postgres-language-server.jsonc`. This macro makes the field optional.
149149

150150
You can simply use a derive macros:
151151

crates/pgt_cli/src/cli_options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub struct CliOptions {
2222
#[bpaf(long("verbose"), switch, fallback(false))]
2323
pub verbose: bool,
2424

25-
/// Set the file path to the configuration file, or the directory path to find `postgrestools.jsonc`.
25+
/// Set the file path to the configuration file, or the directory path to find `postgres-language-server.jsonc`.
2626
/// If used, it disables the default configuration file resolution.
2727
#[bpaf(long("config-path"), argument("PATH"), optional)]
2828
pub config_path: Option<String>,

crates/pgt_cli/src/commands/init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ pub(crate) fn init(mut session: CliSession) -> Result<(), CliDiagnostic> {
88
let fs = &mut session.app.fs;
99
let config = &mut PartialConfiguration::init();
1010
create_config(fs, config)?;
11-
let file_created = ConfigName::pgt_jsonc();
11+
let file_created = ConfigName::pgls_jsonc();
1212
session.app.console.log(markup! {
1313
"
14-
Welcome to the Postgres Language Tools! Let's get you started...
14+
Welcome to the Postgres Language Server! Let's get you started...
1515
1616
"<Info><Emphasis>"Files created "</Emphasis></Info>"
1717

crates/pgt_cli/src/commands/mod.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::{
77
};
88
use bpaf::Bpaf;
99
use pgt_configuration::{PartialConfiguration, partial_configuration};
10-
use pgt_console::Console;
11-
use pgt_fs::FileSystem;
10+
use pgt_console::{Console, ConsoleExt, markup};
11+
use pgt_fs::{ConfigName, FileSystem};
1212
use pgt_workspace::PartialConfigurationExt;
1313
use pgt_workspace::configuration::{LoadedConfiguration, load_configuration};
1414
use pgt_workspace::workspace::{RegisterProjectFolderParams, UpdateSettingsParams};
@@ -58,7 +58,7 @@ pub enum PgtCommand {
5858
changed: bool,
5959

6060
/// Use this to specify the base branch to compare against when you're using the --changed
61-
/// flag and the `defaultBranch` is not set in your `postgrestools.jsonc`
61+
/// flag and the `defaultBranch` is not set in your `postgres-language-server.jsonc`
6262
#[bpaf(long("since"), argument("REF"))]
6363
since: Option<String>,
6464

@@ -93,7 +93,7 @@ pub enum PgtCommand {
9393
)]
9494
log_path: PathBuf,
9595
/// Allows to set a custom file path to the configuration file,
96-
/// or a custom directory path to find `postgrestools.jsonc`
96+
/// or a custom directory path to find `postgres-language-server.jsonc`
9797
#[bpaf(
9898
env("PGT_LOG_PREFIX_NAME"),
9999
env("PGLS_LOG_PREFIX_NAME"),
@@ -136,7 +136,7 @@ pub enum PgtCommand {
136136
)]
137137
log_path: PathBuf,
138138
/// Allows to set a custom file path to the configuration file,
139-
/// or a custom directory path to find `postgrestools.jsonc`
139+
/// or a custom directory path to find `postgres-language-server.jsonc`
140140
#[bpaf(
141141
env("PGT_CONFIG_PATH"),
142142
env("PGLS_CONFIG_PATH"),
@@ -201,7 +201,7 @@ pub enum PgtCommand {
201201
#[bpaf(long("stop-on-disconnect"), hide_usage)]
202202
stop_on_disconnect: bool,
203203
/// Allows to set a custom file path to the configuration file,
204-
/// or a custom directory path to find `postgrestools.jsonc`
204+
/// or a custom directory path to find `postgres-language-server.jsonc`
205205
#[bpaf(
206206
env("PGT_CONFIG_PATH"),
207207
env("PGLS_CONFIG_PATH"),
@@ -318,6 +318,19 @@ pub(crate) trait CommandRunner: Sized {
318318
let loaded_configuration =
319319
load_configuration(fs, cli_options.as_configuration_path_hint())?;
320320

321+
// Check for deprecated config filename
322+
if let Some(config_path) = &loaded_configuration.file_path {
323+
if let Some(file_name) = config_path.file_name().and_then(|n| n.to_str()) {
324+
if ConfigName::is_deprecated(file_name) {
325+
console.log(markup! {
326+
<Warn>"Warning: "</Warn>"You are using the deprecated config filename '"<Emphasis>"postgrestools.jsonc"</Emphasis>"'. \
327+
Please rename it to '"<Emphasis>"postgres-language-server.jsonc"</Emphasis>"'. \
328+
Support for the old filename will be removed in a future version.\n"
329+
});
330+
}
331+
}
332+
}
333+
321334
let configuration_path = loaded_configuration.directory_path.clone();
322335
let configuration = self.merge_configuration(loaded_configuration, fs, console)?;
323336
let vcs_base_path = configuration_path.or(fs.working_directory());

0 commit comments

Comments
 (0)