Skip to content

Commit 9c50be9

Browse files
authored
chore: add our own text-size (#235)
1 parent 310b643 commit 9c50be9

Some content is hidden

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

57 files changed

+1123
-332
lines changed

Cargo.lock

+39-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ enumflags2 = "0.7.10"
2424
ignore = "0.4.23"
2525
indexmap = { version = "2.6.0", features = ["serde"] }
2626
insta = "1.31.0"
27-
line_index = { path = "./lib/line_index", version = "0.0.0" }
2827
pg_query = "6.0.0"
2928
proc-macro2 = "1.0.66"
3029
quote = "1.0.33"
@@ -39,7 +38,6 @@ smallvec = { version = "1.13.2", features = ["union", "const_new
3938
sqlx = { version = "0.8.2", features = ["runtime-async-std", "tls-rustls", "postgres", "json"] }
4039
syn = "1.0.109"
4140
termcolor = "1.4.1"
42-
text-size = "1.1.1"
4341
tokio = { version = "1.40.0", features = ["full"] }
4442
toml = "0.8.19"
4543
tower-lsp = "0.20.0"
@@ -75,6 +73,7 @@ pglt_query_proto_parser = { path = "./crates/pglt_query_proto_parser", versi
7573
pglt_schema_cache = { path = "./crates/pglt_schema_cache", version = "0.0.0" }
7674
pglt_statement_splitter = { path = "./crates/pglt_statement_splitter", version = "0.0.0" }
7775
pglt_text_edit = { path = "./crates/pglt_text_edit", version = "0.0.0" }
76+
pglt_text_size = { path = "./crates/pglt_text_size", version = "0.0.0" }
7877
pglt_treesitter_queries = { path = "./crates/pglt_treesitter_queries", version = "0.0.0" }
7978
pglt_type_resolver = { path = "./crates/pglt_type_resolver", version = "0.0.0" }
8079
pglt_typecheck = { path = "./crates/pglt_typecheck", version = "0.0.0" }

crates/pglt_analyse/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ rustc-hash = { workspace = true }
2222
biome_deserialize = { workspace = true, optional = true }
2323
biome_deserialize_macros = { workspace = true, optional = true }
2424
enumflags2.workspace = true
25+
pglt_text_size.workspace = true
2526
schemars = { workspace = true, optional = true }
2627
serde = { workspace = true, features = ["derive"], optional = true }
27-
text-size.workspace = true
2828

2929
[features]
3030
serde = ["dep:serde", "dep:schemars", "dep:biome_deserialize", "dep:biome_deserialize_macros"]

crates/pglt_analyse/src/rule.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use pglt_diagnostics::{
55
Advices, Category, Diagnostic, DiagnosticTags, Location, LogCategory, MessageAndDescription,
66
Visit,
77
};
8+
use pglt_text_size::TextRange;
89
use std::cmp::Ordering;
910
use std::fmt::Debug;
10-
use text_size::TextRange;
1111

1212
use crate::{categories::RuleCategory, context::RuleContext, registry::RegistryVisitor};
1313

crates/pglt_commands/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ version = "0.0.0"
1212

1313

1414
[dependencies]
15-
anyhow = "1.0.62"
16-
async-std = "1.12.0"
17-
sqlx.workspace = true
18-
text-size.workspace = true
15+
anyhow = "1.0.62"
16+
async-std = "1.12.0"
17+
pglt_text_size.workspace = true
18+
sqlx.workspace = true
1919

2020
[lib]
2121
doctest = false

crates/pglt_completions/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ version = "0.0.0"
1414
[dependencies]
1515
async-std = "1.12.0"
1616

17-
text-size.workspace = true
17+
pglt_text_size.workspace = true
1818

1919

2020
pglt_schema_cache.workspace = true

crates/pglt_completions/src/complete.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use pglt_text_size::TextSize;
12
use serde::{Deserialize, Serialize};
2-
use text_size::TextSize;
33

44
use crate::{
55
builder::CompletionBuilder,

crates/pglt_configuration/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ pglt_analyse = { workspace = true }
2020
pglt_analyser = { workspace = true }
2121
pglt_console = { workspace = true }
2222
pglt_diagnostics = { workspace = true }
23+
pglt_text_size = { workspace = true }
2324
rustc-hash = { workspace = true }
2425
schemars = { workspace = true, features = ["indexmap1"], optional = true }
2526
serde = { workspace = true, features = ["derive"] }
2627
serde_json = { workspace = true, features = ["raw_value"] }
27-
text-size = { workspace = true }
2828
toml = { workspace = true }
2929

3030
[lib]

crates/pglt_console/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ version = "0.0.0"
1212

1313

1414
[dependencies]
15-
pglt_markup = { workspace = true }
16-
text-size = { workspace = true }
15+
pglt_markup = { workspace = true }
16+
pglt_text_size = { workspace = true }
1717

1818
schemars = { workspace = true, optional = true }
1919
serde = { workspace = true, optional = true, features = ["derive"] }

crates/pglt_console/src/markup.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::{
44
io,
55
};
66

7+
use pglt_text_size::TextSize;
78
use termcolor::{Color, ColorSpec};
8-
use text_size::TextSize;
99

1010
use crate::fmt::{Display, Formatter, MarkupElements, Write};
1111

crates/pglt_diagnostics/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ pglt_console = { workspace = true, features = ["serde_markup"] }
1919
pglt_diagnostics_categories = { workspace = true, features = ["serde"] }
2020
pglt_diagnostics_macros = { workspace = true }
2121
pglt_text_edit = { workspace = true }
22+
pglt_text_size.workspace = true
2223
schemars = { workspace = true, optional = true }
2324
serde = { workspace = true, features = ["derive"] }
2425
serde_json = { workspace = true }
2526
termcolor = { workspace = true }
26-
text-size.workspace = true
2727
unicode-width = { workspace = true }
2828

2929
[features]

crates/pglt_diagnostics/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ mod internal {
251251

252252
use pglt_console::{fmt, markup};
253253
use pglt_text_edit::TextEdit;
254-
use text_size::TextRange;
254+
use pglt_text_size::TextRange;
255255

256256
use crate::{
257257
Advices, Backtrace, Category, Diagnostic, DiagnosticTags, LineIndex, LineIndexBuf,

crates/pglt_diagnostics/src/display.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,8 @@ mod tests {
669669
use pglt_diagnostics::{DiagnosticTags, Severity};
670670
use pglt_diagnostics_categories::{Category, category};
671671
use pglt_text_edit::TextEdit;
672+
use pglt_text_size::{TextRange, TextSize};
672673
use serde_json::{from_value, json};
673-
use text_size::{TextRange, TextSize};
674674

675675
use crate::{self as pglt_diagnostics};
676676
use crate::{

crates/pglt_diagnostics/src/display/frame.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{
77
};
88

99
use pglt_console::{fmt, markup};
10-
use text_size::{TextLen, TextRange, TextSize};
10+
use pglt_text_size::{TextLen, TextRange, TextSize};
1111
use unicode_width::UnicodeWidthChar;
1212

1313
use crate::{

crates/pglt_diagnostics/src/display_github.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::display::frame::SourceFile;
22
use crate::{Diagnostic, Resource, Severity, diagnostic::internal::AsDiagnostic};
33
use pglt_console::{MarkupBuf, fmt, markup};
4+
use pglt_text_size::{TextRange, TextSize};
45
use std::io;
5-
use text_size::{TextRange, TextSize};
66

77
/// Helper struct for printing a diagnostic as markup into any formatter
88
/// implementing [pglt_console::fmt::Write].

0 commit comments

Comments
 (0)