Associate more file extensions with Clojure

Fixes #31
ida_star
Wilfred Hughes 2021-09-05 19:43:47 +07:00
parent 34a5bd768d
commit d29bd46969
2 changed files with 12 additions and 6 deletions

@ -4,6 +4,10 @@
Added TypeScript parser and TSX parser.
The following extensions are now associated with Clojure: `.bb`,
`.boot`, `.clj`, `.cljc`, `.clje`, `.cljs`, `.cljx`, `.edn`, `.joke`
and `.joker`.
Fixed an issue with parsing integer values in CSS with units,
e.g. `123px`.

@ -42,12 +42,14 @@ pub fn from_extension(extension: &OsStr) -> Option<TreeSitterConfig> {
// TODO: find a nice way to extract name and extension information
// from the package.json in these parsers.
match extension.to_string_lossy().borrow() {
"clj" => Some(TreeSitterConfig {
name: "Clojure",
language: unsafe { tree_sitter_clojure() },
atom_nodes: (vec![]).into_iter().collect(),
open_delimiter_tokens: (vec!["{", "(", "["]).into_iter().collect(),
}),
"bb" | "boot" | "clj" | "cljc" | "clje" | "cljs" | "cljx" | "edn" | "joke" | "joker" => {
Some(TreeSitterConfig {
name: "Clojure",
language: unsafe { tree_sitter_clojure() },
atom_nodes: (vec![]).into_iter().collect(),
open_delimiter_tokens: (vec!["{", "(", "["]).into_iter().collect(),
})
}
"css" => Some(TreeSitterConfig {
name: "CSS",
language: unsafe { tree_sitter_css() },