Skip to content

chore: delete old crates, rename new ones, delete biome mentions #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 12 additions & 109 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ pg_inlay_hints = { path = "./crates/pg_inlay_hints", version = "0.0.0
pg_lexer = { path = "./crates/pg_lexer", version = "0.0.0" }
pg_lexer_codegen = { path = "./crates/pg_lexer_codegen", version = "0.0.0" }
pg_lint = { path = "./crates/pg_lint", version = "0.0.0" }
pg_lsp = { path = "./crates/pg_lsp", version = "0.0.0" }
pg_lsp_converters = { path = "./crates/pg_lsp_converters", version = "0.0.0" }
pg_lsp_new = { path = "./crates/pg_lsp_new", version = "0.0.0" }
pg_markup = { path = "./crates/pg_markup", version = "0.0.0" }
pg_query_ext = { path = "./crates/pg_query_ext", version = "0.0.0" }
pg_query_ext_codegen = { path = "./crates/pg_query_ext_codegen", version = "0.0.0" }
Expand All @@ -79,7 +79,6 @@ pg_treesitter_queries = { path = "./crates/pg_treesitter_queries", version =
pg_type_resolver = { path = "./crates/pg_type_resolver", version = "0.0.0" }
pg_typecheck = { path = "./crates/pg_typecheck", version = "0.0.0" }
pg_workspace = { path = "./crates/pg_workspace", version = "0.0.0" }
pg_workspace_new = { path = "./crates/pg_workspace_new", version = "0.0.0" }

pg_test_utils = { path = "./crates/pg_test_utils" }
# parser = { path = "./crates/parser", version = "0.0.0" }
Expand Down
4 changes: 2 additions & 2 deletions crates/pg_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ pg_console = { workspace = true }
pg_diagnostics = { workspace = true }
pg_flags = { workspace = true }
pg_fs = { workspace = true }
pg_lsp_new = { workspace = true }
pg_lsp = { workspace = true }
pg_text_edit = { workspace = true }
pg_workspace_new = { workspace = true }
pg_workspace = { workspace = true }
quick-junit = "0.5.0"
rayon = { workspace = true }
rustc-hash = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/pg_cli/src/changed.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::CliDiagnostic;
use pg_configuration::PartialConfiguration;
use pg_fs::FileSystem;
use pg_workspace_new::DynRef;
use pg_workspace::DynRef;
use std::ffi::OsString;

pub(crate) fn get_changed_files(
Expand Down
6 changes: 3 additions & 3 deletions crates/pg_cli/src/cli_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct CliOptions {
#[bpaf(long("verbose"), switch, fallback(false))]
pub verbose: bool,

/// Set the file path to the configuration file, or the directory path to find `biome.json` or `biome.jsonc`.
/// Set the file path to the configuration file, or the directory path to find `pglsp.toml`.
/// If used, it disables the default configuration file resolution.
#[bpaf(long("config-path"), argument("PATH"), optional)]
pub config_path: Option<String>,
Expand All @@ -44,7 +44,7 @@ pub struct CliOptions {
#[bpaf(long("no-errors-on-unmatched"), switch)]
pub no_errors_on_unmatched: bool,

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

Expand Down Expand Up @@ -82,7 +82,7 @@ pub struct CliOptions {
fallback(Severity::default()),
display_fallback
)]
/// The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing `--diagnostic-level=error` will cause Biome to print only diagnostics that contain only errors.
/// 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.
pub diagnostic_level: Severity,
}

Expand Down
5 changes: 1 addition & 4 deletions crates/pg_cli/src/commands/check.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// use super::{determine_fix_file_mode, FixFileModeOptions, LoadEditorConfig};
use crate::cli_options::CliOptions;
// use crate::commands::{get_files_to_process_with_cli_options, CommandRunner};
use crate::{CliDiagnostic, Execution, TraversalMode};
use pg_configuration::PartialConfiguration;
use pg_console::Console;
// use biome_deserialize::Merge;
use pg_fs::FileSystem;
use pg_workspace_new::{configuration::LoadedConfiguration, DynRef, Workspace, WorkspaceError};
use pg_workspace::{configuration::LoadedConfiguration, DynRef, Workspace, WorkspaceError};
use std::ffi::OsString;

use super::{get_files_to_process_with_cli_options, CommandRunner};
Expand Down
10 changes: 5 additions & 5 deletions crates/pg_cli/src/commands/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::{
CliDiagnostic, CliSession,
};
use pg_console::{markup, ConsoleExt};
use pg_lsp_new::ServerFactory;
use pg_workspace_new::{workspace::WorkspaceClient, TransportError, WorkspaceError};
use pg_lsp::ServerFactory;
use pg_workspace::{workspace::WorkspaceClient, TransportError, WorkspaceError};
use std::{env, fs, path::PathBuf};
use tokio::io;
use tokio::runtime::Runtime;
Expand Down Expand Up @@ -176,9 +176,9 @@ pub(crate) fn read_most_recent_log_file(
log_path: Option<PathBuf>,
log_file_name_prefix: String,
) -> io::Result<Option<String>> {
let biome_log_path = log_path.unwrap_or(default_pglsp_log_path());
let pglsp_log_path = log_path.unwrap_or(default_pglsp_log_path());

let most_recent = fs::read_dir(biome_log_path)?
let most_recent = fs::read_dir(pglsp_log_path)?
.flatten()
.filter(|file| file.file_type().is_ok_and(|ty| ty.is_file()))
.filter_map(|file| {
Expand Down Expand Up @@ -238,7 +238,7 @@ pub fn default_pglsp_log_path() -> PathBuf {

/// Tracing filter enabling:
/// - All spans and events at level info or higher
/// - All spans and events at level debug in crates whose name starts with `biome`
/// - All spans and events at level debug in crates whose name starts with `pglsp`
struct LoggingFilter;

/// Tracing filter used for spans emitted by `pglsp*` crates
Expand Down
2 changes: 1 addition & 1 deletion crates/pg_cli/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{CliDiagnostic, CliSession};
use pg_configuration::PartialConfiguration;
use pg_console::{markup, ConsoleExt};
use pg_fs::ConfigName;
use pg_workspace_new::configuration::create_config;
use pg_workspace::configuration::create_config;

pub(crate) fn init(mut session: CliSession) -> Result<(), CliDiagnostic> {
let fs = &mut session.app.fs;
Expand Down
8 changes: 4 additions & 4 deletions crates/pg_cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use bpaf::Bpaf;
use pg_configuration::{partial_configuration, PartialConfiguration};
use pg_console::Console;
use pg_fs::FileSystem;
use pg_workspace_new::configuration::{load_configuration, LoadedConfiguration};
use pg_workspace_new::settings::PartialConfigurationExt;
use pg_workspace_new::workspace::{FixFileMode, UpdateSettingsParams};
use pg_workspace_new::{DynRef, Workspace, WorkspaceError};
use pg_workspace::configuration::{load_configuration, LoadedConfiguration};
use pg_workspace::settings::PartialConfigurationExt;
use pg_workspace::workspace::{FixFileMode, UpdateSettingsParams};
use pg_workspace::{DynRef, Workspace, WorkspaceError};
use std::ffi::OsString;
use std::path::PathBuf;

Expand Down
2 changes: 1 addition & 1 deletion crates/pg_cli/src/commands/version.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use pg_console::fmt::Formatter;
use pg_console::{fmt, markup, ConsoleExt};
use pg_workspace_new::workspace::ServerInfo;
use pg_workspace::workspace::ServerInfo;

use crate::{CliDiagnostic, CliSession, VERSION};

Expand Down
12 changes: 6 additions & 6 deletions crates/pg_cli/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ use pg_diagnostics::adapters::{BpafError, IoError, SerdeJsonError};
use pg_diagnostics::{
Advices, Category, Diagnostic, Error, LogCategory, MessageAndDescription, Severity, Visit,
};
use pg_workspace_new::WorkspaceError;
use pg_workspace::WorkspaceError;
use std::process::{ExitCode, Termination};
use std::{env::current_exe, fmt::Debug};

fn command_name() -> String {
current_exe()
.ok()
.and_then(|path| Some(path.file_name()?.to_str()?.to_string()))
.unwrap_or_else(|| String::from("biome"))
.unwrap_or_else(|| String::from("pglsp"))
}

/// A diagnostic that is emitted when running biome via CLI.
/// A diagnostic that is emitted when running PGLSP via CLI.
///
/// When displaying the diagnostic,
#[derive(Debug, Diagnostic)]
Expand All @@ -42,13 +42,13 @@ pub enum CliDiagnostic {
FileCheck(FileCheck),
/// When an argument is higher than the expected maximum
OverflowNumberArgument(OverflowNumberArgument),
/// Wrapper for an underlying `biome_service` error
/// Wrapper for an underlying pglsp-service error
WorkspaceError(WorkspaceError),
/// Wrapper for an underlying `std::io` error
IoError(IoDiagnostic),
/// The daemon is not running
ServerNotRunning(ServerNotRunning),
/// The end configuration (`biome.json` + other options) is incompatible with the command
/// The end configuration (`pglsp.toml` + other options) is incompatible with the command
IncompatibleEndConfiguration(IncompatibleEndConfiguration),
/// No files processed during the file system traversal
NoFilesWereProcessed(NoFilesWereProcessed),
Expand Down Expand Up @@ -410,7 +410,7 @@ impl CliDiagnostic {
Self::ServerNotRunning(ServerNotRunning)
}

/// Emitted when the end configuration (`biome.json` file + CLI arguments + LSP configuration)
/// Emitted when the end configuration (`pglsp.toml` file + CLI arguments + LSP configuration)
/// results in a combination of options that doesn't allow to run the command correctly.
///
/// A reason needs to be provided
Expand Down
Loading
Loading