Update Sublime syntax instructions (#1455)

This commit is contained in:
Nick Kocharhook 2023-01-02 09:44:06 +00:00 committed by GitHub
parent 66993e874d
commit bb5b962c3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 89 deletions

View File

@ -406,7 +406,7 @@ Kakoune supports `justfile` syntax highlighting out of the box, thanks to TeddyD
### Sublime Text ### Sublime Text
A syntax file for Sublime Text written by TonioGela is available in [extras/just.sublime-syntax](https://github.com/casey/just/blob/master/extras/just.sublime-syntax). The [Just package](https://github.com/nk9/just_sublime) by [nk9](https://github.com/nk9) with `just` syntax and some other tools is available on [PackageControl](https://packagecontrol.io/packages/Just).
### Other Editors ### Other Editors

View File

@ -1,79 +0,0 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
name: Just
file_extensions: [.justfile, just, justfile]
scope: source.just
contexts:
main:
- include: interpolate
- include: comments
- include: scripts
- include: strings
- include: assignments
- include: recipeDefinition
- include: recipeContent
- include: functions
- include: keywords
- include: attributes
assignments:
- match: '^(export\s+)?([a-zA-Z_][a-zA-Z0-9_-]*)\s*(:=)'
captures:
1: storage.modifier.just
2: variable.other.just
3: keyword.operator.assignment.just
comments:
- match: '#[^!].*'
scope: comment.line.just
interpolate:
- match: '(?<!\{)\{\{(?!\{)'
push:
- meta_scope: string.interpolated.just
- match: '\}\}'
pop: true
functions:
- match: \b(arch|os|os_family|env_var|env_var_or_default|invocation_directory|justfile|justfile_directory|just_executable|lowercase|quote|replace|trim|trim_end|trim_end_match|trim_end_matches|trim_start|trim_start_match|trim_start_matches|uppercase|absolute_path|extension|file_name|file_stem|parent_directory|without_extension|join|clean|path_exists|error|sha256|sha256_file|uuid|capitalize|uppercamelcase|lowercamelcase|snakecase|kebabcase|shoutysnakecase|titlecase|shoutykebabcase)\b(?=\()
scope: entity.name.function.just
keywords:
- match: \b(if|else|while)\b
scope: keyword.control.just
recipeDefinition:
- match: '^(@)?([a-zA-Z_][a-zA-Z0-9_-]*)\s*([\+\*])?([a-zA-Z0-9_]*)?\s*(=)?\s*([a-zA-Z0-9_-`''"]*):([\sa-zA-Z0-9_-]*).*$'
captures:
1: storage.modifier.just
2: entity.name.function.just
3: keyword.operator.just
4: variable.parameter.just
5: keyword.operator.just
6: string.interpolated.just
7: support.type.property-name.just
recipeContent:
- match: '^\s+([-@]*)'
captures:
1: storage.modifier.just
scripts:
- match: '\s#\!'
comment: The #! lines within a recipe.
push:
- meta_scope: support.type.property-name.just
- match: $
pop: true
strings:
- match: '`'
push:
- meta_scope: string.quoted.triple.just
- match: '`'
pop: true
- match: '"'
push:
- meta_scope: string.quoted.double.just
- match: '"'
pop: true
- match: "'"
push:
- meta_scope: string.quoted.single.just
- match: "'"
pop: true
attributes:
- match: '^\[.*?]'
scope: meta.annotation.identifier.just

View File

@ -24,7 +24,6 @@ pub(crate) use {
tempfile::TempDir, tempfile::TempDir,
temptree::{temptree, tree, Tree}, temptree::{temptree, tree, Tree},
which::which, which::which,
yaml_rust::YamlLoader,
}; };
#[macro_use] #[macro_use]
@ -78,7 +77,6 @@ mod shell;
mod show; mod show;
mod slash_operator; mod slash_operator;
mod string; mod string;
mod sublime_syntax;
mod subsequents; mod subsequents;
mod tempdir; mod tempdir;
mod undefined_variables; mod undefined_variables;

View File

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