Add file_extensions to Sublime syntax file (#878)

This commit is contained in:
Frederick Zhang 2021-06-24 18:24:12 +10:00 committed by GitHub
parent 8557a6c6b3
commit 9dc2385c64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 0 deletions

16
Cargo.lock generated
View File

@ -218,6 +218,7 @@ dependencies = [
"test-utilities",
"unicode-width",
"which",
"yaml-rust",
]
[[package]]
@ -232,6 +233,12 @@ version = "0.2.97"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
[[package]]
name = "linked-hash-map"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
[[package]]
name = "log"
version = "0.4.14"
@ -617,3 +624,12 @@ name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]

View File

@ -46,6 +46,7 @@ features = ["derive"]
executable-path = "1.0.0"
pretty_assertions = "0.7.0"
which = "4.0.0"
yaml-rust = "0.4.5"
# Until github.com/rust-lang/cargo/pull/7333 makes it into stable,
# this version-less dev-dependency will interfere with publishing

View File

@ -2,6 +2,7 @@
---
# http://www.sublimetext.com/docs/syntax.html
name: Just
file_extensions: [Justfile, just]
scope: source.just
contexts:
main:

View File

@ -14,3 +14,4 @@ pub(crate) use just::unindent;
pub(crate) use libc::{EXIT_FAILURE, EXIT_SUCCESS};
pub(crate) use test_utilities::{assert_stdout, tempdir, tmptree};
pub(crate) use which::which;
pub(crate) use yaml_rust::YamlLoader;

View File

@ -26,4 +26,5 @@ mod search;
mod shebang;
mod shell;
mod string;
mod sublime_syntax;
mod working_directory;

7
tests/sublime_syntax.rs Normal file
View File

@ -0,0 +1,7 @@
use crate::common::*;
#[test]
fn parse() {
let yaml = fs::read_to_string("extras/just.sublime-syntax").unwrap();
YamlLoader::load_from_str(&yaml).unwrap();
}