Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ simple_logger = { path = "crates/simple_logger" }
string-offset = { path = "crates/string-offset" }
sum_tree = { path = "crates/sum_tree" }
syntax_tree = { path = "crates/syntax_tree" }
tree_sitter_pascal = { path = "crates/tree_sitter_pascal" }
ui_components = { path = "crates/ui_components" }
vim = { path = "crates/vim" }
virtual-fs = { path = "crates/virtual_fs" }
Expand Down
2 changes: 2 additions & 0 deletions app/src/ai/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,8 @@ impl ProgrammingLanguage {
"vue" => Some("vue"),
"dockerfile" | "docker" | "containerfile" => Some("dockerfile"),
"markdown" | "md" => Some("md"),
"pascal" | "pas" | "delphi" | "objectpascal" | "object-pascal" | "objpas"
| "freepascal" | "fpc" => Some("pas"),
_ => None,
},
Self::Shell(ShellType::PowerShell) => Some("ps1"),
Expand Down
5 changes: 5 additions & 0 deletions app/src/ai/agent/mod_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ fn test_programming_language_to_extension() {
("starlark", "bzl"),
("objective-c", "m"),
("objc", "m"),
("pascal", "pas"),
// Common markdown code-fence aliases.
("rs", "rs"),
("golang", "go"),
Expand All @@ -294,6 +295,10 @@ fn test_programming_language_to_extension() {
("containerfile", "dockerfile"),
("markdown", "md"),
("md", "md"),
("delphi", "pas"),
("objectpascal", "pas"),
("freepascal", "pas"),
("pas", "pas"),
];
for (token, expected_extension) in cases {
let language = ProgrammingLanguage::from((*token).to_string());
Expand Down
1 change: 1 addition & 0 deletions crates/languages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ serde.workspace = true
serde_yaml.workspace = true
rust-embed.workspace = true
arborium.workspace = true
tree_sitter_pascal.workspace = true
lazy_static.workspace = true
warp_editor = { path = "../editor" }
warp_util.workspace = true
5 changes: 4 additions & 1 deletion crates/languages/grammars/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ You can find this information on language specific documentation and style guide

Another place to look is at Zed's config.toml files, e.g.: https://github.com/zed-industries/zed/blob/85bdd9329b550475aae34340e50abd4e79f2dd82/crates/languages/src/python/config.toml

**Note:** We don't use custom highlights.scm files - we use arborium's bundled highlighting queries instead.
**Note:** We normally don't use custom highlights.scm files - we use arborium's bundled highlighting queries instead.

## highlights.scm
Only for languages arborium has no grammar for, which currently means Pascal alone (its grammar is vendored in `crates/tree_sitter_pascal`). `load_language` falls back to `grammars/<lang>/highlights.scm` when `get_arborium_highlight_query` has no entry for the language. Warp's highlighter applies every capture and does not evaluate query predicates, so a query written for another editor needs its `#match?`/`#eq?`-gated rules removed rather than copied across - otherwise their captures apply unconditionally.

## indents.scm
This controls how we know when a cursor should be indented relative to the previous line.
Expand Down
11 changes: 11 additions & 0 deletions crates/languages/grammars/pascal/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
display_name: "Pascal"
indent_unit:
space: 2
comment_prefix: "//"
brackets:
- start: "("
end: ")"
- start: "["
end: "]"
- start: "'"
end: "'"
Loading