-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cli highlighting improvements. (#2307)
a number of improvements to the cli highlighter. - better support for types - more support for various symbols `&|+-/%` - function highlighting! ![demo](https://github.com/GlareDB/glaredb/assets/21327470/39024a73-5aec-46c8-8e96-532568b36cdc)
- Loading branch information
1 parent
6835680
commit e7d2126
Showing
8 changed files
with
211 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
mod setup; | ||
|
||
use setup::DEFAULT_TIMEOUT; | ||
|
||
use crate::setup::make_cli; | ||
|
||
#[test] | ||
fn test_special_characters() { | ||
let mut cmd = make_cli(); | ||
|
||
let assert = cmd | ||
.timeout(DEFAULT_TIMEOUT) | ||
.args(&["-q", r#"select ';'"#]) | ||
.assert(); | ||
assert.success().stdout(predicates::str::contains( | ||
r#" | ||
┌───────────┐ | ||
│ Utf8(";") │ | ||
│ ── │ | ||
│ Utf8 │ | ||
╞═══════════╡ | ||
│ ; │ | ||
└───────────┘"# | ||
.trim_start(), | ||
)); | ||
} | ||
|
||
#[test] | ||
fn test_special_characters_2() { | ||
let mut cmd = make_cli(); | ||
|
||
let assert = cmd | ||
.timeout(DEFAULT_TIMEOUT) | ||
.args(&["-q", r#"select ";""#]) | ||
.assert(); | ||
assert.failure().stderr(predicates::str::contains( | ||
"Schema error: No field named \";\".", | ||
)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# https://github.com/GlareDB/glaredb/issues/2309 | ||
statement ok | ||
select ';'; | ||
|
||
statement ok | ||
select ';"'; | ||
|
||
statement error Schema error | ||
select ";"; |