This commit is contained in:
Anton-4 2022-02-26 11:05:40 +01:00
parent 26556c631b
commit b46ef4d68d
No known key found for this signature in database
GPG key ID: C954D6E0F9C0ABFD
3 changed files with 19 additions and 26 deletions

10
cli_utils/Cargo.lock generated
View file

@ -897,6 +897,12 @@ version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0"
[[package]]
name = "dunce"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541"
[[package]]
name = "either"
version = "1.6.1"
@ -2504,6 +2510,7 @@ dependencies = [
name = "roc_builtins"
version = "0.1.0"
dependencies = [
"dunce",
"roc_collections",
"roc_module",
"roc_region",
@ -2518,6 +2525,7 @@ dependencies = [
"bumpalo",
"roc_builtins",
"roc_collections",
"roc_error_macros",
"roc_module",
"roc_parse",
"roc_problem",
@ -2587,6 +2595,7 @@ dependencies = [
"roc_builtins",
"roc_can",
"roc_collections",
"roc_error_macros",
"roc_module",
"roc_parse",
"roc_region",
@ -2760,6 +2769,7 @@ dependencies = [
"roc_can",
"roc_collections",
"roc_constrain",
"roc_error_macros",
"roc_module",
"roc_mono",
"roc_parse",

View file

@ -47,36 +47,21 @@ pub struct UnderlineEnd {
#[derive(Debug)]
pub enum Attribute {
// Rust does not yet support types for enum variants so we have to do it like this
Caret {
caret: Caret,
},
Caret { caret: Caret },
SelectionStart {
selection_start: SelectionStart,
},
SelectionEnd {
selection_end: SelectionEnd,
},
SelectionStart { selection_start: SelectionStart },
SelectionEnd { selection_end: SelectionEnd },
HighlightStart {
highlight_start: HighlightStart,
},
HighlightEnd {
highlight_end: HighlightEnd,
},
HighlightStart { highlight_start: HighlightStart },
HighlightEnd { highlight_end: HighlightEnd },
Underline {
underline_spec: UnderlineSpec,
},
Underline { underline_spec: UnderlineSpec },
}
#[derive(Debug)]
pub enum UnderlineSpec {
Partial{
start: usize,
end: usize,
},
Full
Partial { start: usize, end: usize },
Full,
}
#[derive(Debug, Default)]

View file

@ -147,9 +147,7 @@ fn markup_to_wgpu_helper<'a>(
for attribute in &attributes.all {
match attribute {
Attribute::Underline {
underline_spec: _,
} => {
Attribute::Underline { underline_spec: _ } => {
// TODO use underline_spec
let top_left_coords = (
code_style.txt_coords.x + (txt_row_col.1 as f32) * char_width,