├── .gitignore ├── Err.sublime-snippet ├── LICENSE.txt ├── Ok.sublime-snippet ├── README.md ├── Rust.JSON-tmLanguage ├── Rust.sublime-build ├── Rust.tmLanguage ├── RustComment.JSON-tmPreferences ├── RustComment.tmPreferences ├── RustIndent.JSON-tmPreferences ├── RustIndent.tmPreferences ├── RustSymbols.JSON-tmPreferences ├── RustSymbols.tmPreferences ├── Some.sublime-snippet ├── assert.sublime-snippet ├── const.sublime-snippet ├── do.sublime-snippet ├── enum.sublime-snippet ├── fail.sublime-snippet ├── fmt.sublime-snippet ├── fn.sublime-snippet ├── for.sublime-snippet ├── impl.sublime-snippet ├── loop.sublime-snippet ├── macro_rules.sublime-snippet ├── main.sublime-snippet ├── match.sublime-snippet ├── struct-tuple.sublime-snippet ├── struct.sublime-snippet ├── test.sublime-snippet ├── trait.sublime-snippet ├── type.sublime-snippet └── while.sublime-snippet /.gitignore: -------------------------------------------------------------------------------- 1 | *.cache 2 | -------------------------------------------------------------------------------- /Err.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | Err 4 | source.rust 5 | Err(…) 6 | 7 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. -------------------------------------------------------------------------------- /Ok.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ok 4 | source.rust 5 | Ok(…) 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deprecated 2 | 3 | This package is now maintained by @jhasse, at https://github.com/jhasse/sublime-rust. Please go there instead. 4 | -------------------------------------------------------------------------------- /Rust.JSON-tmLanguage: -------------------------------------------------------------------------------- 1 | { "name": "Rust", 2 | "scopeName": "source.rust", 3 | "fileTypes": ["rs", "rc"], 4 | "foldingStartMarker": "^.*\\bfn\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$", 5 | "foldingStopMarker": "^\\s*\\}", 6 | "patterns": [ 7 | {"name": "variable.other.source.rust", 8 | "match": "'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])" 9 | }, 10 | {"name": "string.quoted.single.source.rust", 11 | "begin": "'", 12 | "end": "'", 13 | "patterns": [ 14 | {"include": "#rust_escaped_character"} 15 | ] 16 | }, 17 | {"name": "string.quoted.double.source.rust", 18 | "begin": "\"", 19 | "end": "\"", 20 | "patterns": [ 21 | {"include": "#rust_escaped_character"} 22 | ] 23 | }, 24 | {"name": "meta.function.source.rust", 25 | "match": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]?[\\w\\:,+ \\'<>]*)\\s*(\\()", 26 | "captures": { 27 | "1": {"name": "keyword.source.rust"}, 28 | "2": {"name": "entity.name.function.source.rust"}, 29 | "3": {"name": "keyword.operator.rust"} 30 | } 31 | }, 32 | {"name": "keyword.source.rust", 33 | "match": "\\b(as|break|claim|const|copy|Copy|do|drop|else|extern|for|if|impl|in|let|loop|match|mod|mut|Owned|priv|pub|pure|ref|return|unsafe|use|while|mod|Send|static|trait|struct|enum|type)\\b" 34 | }, 35 | {"name": "storage.type.source.rust", 36 | "match": "\\b(Self|m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|Option|Either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b" 37 | }, 38 | {"name": "variable.language.source.rust", 39 | "match": "\\bself\\b" 40 | }, 41 | {"name": "constant.language.source.rust", 42 | "match": "\\b(true|false|Some|None|Left|Right|Ok|Err)\\b" 43 | }, 44 | {"name": "support.constant.source.rust", 45 | "match": "\\b(EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\\b" 46 | }, 47 | {"name": "comment.block.preprocessor.rust", 48 | "match": "^(\\w\\(\\w\\)*!)|(#\\[[\\w=\\(\\)_]+\\])$" 49 | }, 50 | {"name": "keyword.operator.rust", 51 | "match": "\\{|\\}" 52 | }, 53 | {"name": "keyword.operator.rust", 54 | "match": "\\[|\\]" 55 | }, 56 | {"name": "keyword.operator.rust", 57 | "match": "\\(|\\)" 58 | }, 59 | {"name": "constant.numeric.integer.source.rust", 60 | "match": "\\b(([0-9][0-9_]*)|([0-9][0-9_]*(u|u8|u16|u32|u64))|([0-9][0-9_]*(i|i8|i16|i32|i64)))\\b" 61 | }, 62 | {"name": "constant.numeric.hex.source.rust", 63 | "match": "\\b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(u|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(i|i8|i16|i32|i64)))\\b" 64 | }, 65 | {"name": "constant.numeric.binary.source.rust", 66 | "match": "\\b((0b[01_]+)|(0b[01_]+(u|u8|u16|u32|u64))|(0b[01_]+(i|i8|i16|i32|i64)))\\b" 67 | }, 68 | {"name": "constant.numeric.float.source.rust", 69 | "match": "([0-9][0-9_]*(f32|f64|f))|([0-9][0-9_]*([eE][+-]=[0-9_]+))|([0-9][0-9_]*([eE][+-]=[0-9_]+)(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+)|([0-9][0-9_]*\\.[0-9_]+(f32|f64|f))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+))|([0-9][0-9_]*\\.[0-9_]+%([eE][+-]=[0-9_]+)(f32|f64|f))" 70 | }, 71 | {"name": "comment.line.documentation.source.rust", 72 | "begin": "//!", 73 | "end": "$\\n" 74 | }, 75 | {"name": "comment.line.double-dash.source.rust", 76 | "begin": "//", 77 | "end": "$\\n" 78 | }, 79 | {"name": "comment.block.source.rust", 80 | "begin": "/\\*", 81 | "end": "\\*/" 82 | }, 83 | {"name": "keyword.operator.rust", 84 | "match": "(=>)|(->)|[-:=*,!.+|%/&~@<>;]" 85 | }, 86 | {"name": "support.function.rust", 87 | "match": "_" 88 | } 89 | ], 90 | "repository": { 91 | "rust_escaped_character": { 92 | "name": "constant.character.escape.source.rust", 93 | "match": "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)" 94 | } 95 | }, 96 | "uuid": "4339386b-4d67-4f0e-9e78-09ecbcddf71d" 97 | } 98 | -------------------------------------------------------------------------------- /Rust.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "cmd": ["rustc", "$file"], 3 | "selector": "source.rust", 4 | "file_regex": "^(.*?):([0-9]+):([0-9]+):\\s[0-9]+:[0-9]+\\s(.*)$", 5 | "osx": 6 | { 7 | "path": "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" 8 | }, 9 | 10 | "variants": [ 11 | { 12 | "selector": "source.rust", 13 | "cmd": ["./$file_base_name"], 14 | "name": "Run", 15 | "windows": 16 | { 17 | "cmd": ["$file_base_name.exe"] 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /Rust.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | rs 8 | rc 9 | 10 | foldingStartMarker 11 | ^.*\bfn\s*(\w+\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$ 12 | foldingStopMarker 13 | ^\s*\} 14 | name 15 | Rust 16 | patterns 17 | 18 | 19 | match 20 | '[a-zA-Z_][a-zA-Z0-9_]*(?=[^\']) 21 | name 22 | variable.other.source.rust 23 | 24 | 25 | begin 26 | ' 27 | end 28 | ' 29 | name 30 | string.quoted.single.source.rust 31 | patterns 32 | 33 | 34 | include 35 | #rust_escaped_character 36 | 37 | 38 | 39 | 40 | begin 41 | " 42 | end 43 | " 44 | name 45 | string.quoted.double.source.rust 46 | patterns 47 | 48 | 49 | include 50 | #rust_escaped_character 51 | 52 | 53 | 54 | 55 | captures 56 | 57 | 1 58 | 59 | name 60 | keyword.source.rust 61 | 62 | 2 63 | 64 | name 65 | entity.name.function.source.rust 66 | 67 | 3 68 | 69 | name 70 | keyword.operator.rust 71 | 72 | 73 | match 74 | \b(fn)\s+([a-zA-Z_][a-zA-Z0-9_]?[\w\:,+ \'<>]*)\s*(\() 75 | name 76 | meta.function.source.rust 77 | 78 | 79 | match 80 | \b(as|break|claim|const|copy|Copy|do|drop|else|extern|for|if|impl|in|let|loop|match|mod|mut|Owned|priv|pub|pure|ref|return|unsafe|use|while|mod|Send|static|trait|struct|enum|type)\b 81 | name 82 | keyword.source.rust 83 | 84 | 85 | match 86 | \b(Self|m32|m64|m128|f80|f16|f128|int|uint|float|char|bool|u8|u16|u32|u64|f32|f64|i8|i16|i32|i64|str|Option|Either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\b 87 | name 88 | storage.type.source.rust 89 | 90 | 91 | match 92 | \bself\b 93 | name 94 | variable.language.source.rust 95 | 96 | 97 | match 98 | \b(true|false|Some|None|Left|Right|Ok|Err)\b 99 | name 100 | constant.language.source.rust 101 | 102 | 103 | match 104 | \b(EXIT_FAILURE|EXIT_SUCCESS|RAND_MAX|EOF|SEEK_SET|SEEK_CUR|SEEK_END|_IOFBF|_IONBF|_IOLBF|BUFSIZ|FOPEN_MAX|FILENAME_MAX|L_tmpnam|TMP_MAX|O_RDONLY|O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_EXCL|O_TRUNC|S_IFIFO|S_IFCHR|S_IFBLK|S_IFDIR|S_IFREG|S_IFMT|S_IEXEC|S_IWRITE|S_IREAD|S_IRWXU|S_IXUSR|S_IWUSR|S_IRUSR|F_OK|R_OK|W_OK|X_OK|STDIN_FILENO|STDOUT_FILENO|STDERR_FILENO)\b 105 | name 106 | support.constant.source.rust 107 | 108 | 109 | match 110 | ^(\w\(\w\)*!)|(#\[[\w=\(\)_]+\])$ 111 | name 112 | comment.block.preprocessor.rust 113 | 114 | 115 | match 116 | \{|\} 117 | name 118 | keyword.operator.rust 119 | 120 | 121 | match 122 | \(|\) 123 | name 124 | keyword.operator.rust 125 | 126 | 127 | match 128 | \[|\] 129 | name 130 | keyword.operator.rust 131 | 132 | 133 | match 134 | \b(([0-9][0-9_]*)|([0-9][0-9_]*(u|u8|u16|u32|u64))|([0-9][0-9_]*(i|i8|i16|i32|i64)))\b 135 | name 136 | constant.numeric.integer.source.rust 137 | 138 | 139 | match 140 | \b((0x[a-fA-F0-9_]+)|(0x[a-fA-F0-9_]+(u|u8|u16|u32|u64))|(0x[a-fA-F0-9_]+(i|i8|i16|i32|i64)))\b 141 | name 142 | constant.numeric.hex.source.rust 143 | 144 | 145 | match 146 | \b((0b[01_]+)|(0b[01_]+(u|u8|u16|u32|u64))|(0b[01_]+(i|i8|i16|i32|i64)))\b 147 | name 148 | constant.numeric.binary.source.rust 149 | 150 | 151 | match 152 | ([0-9][0-9_]*(f32|f64|f))|([0-9][0-9_]*([eE][+-]=[0-9_]+))|([0-9][0-9_]*([eE][+-]=[0-9_]+)(f32|f64|f))|([0-9][0-9_]*\.[0-9_]+)|([0-9][0-9_]*\.[0-9_]+(f32|f64|f))|([0-9][0-9_]*\.[0-9_]+%([eE][+-]=[0-9_]+))|([0-9][0-9_]*\.[0-9_]+%([eE][+-]=[0-9_]+)(f32|f64|f)) 153 | name 154 | constant.numeric.float.source.rust 155 | 156 | 157 | begin 158 | //! 159 | end 160 | $\n 161 | name 162 | comment.line.documentation.source.rust 163 | 164 | 165 | begin 166 | // 167 | end 168 | $\n 169 | name 170 | comment.line.double-dash.source.rust 171 | 172 | 173 | begin 174 | /\* 175 | end 176 | \*/ 177 | name 178 | comment.block.source.rust 179 | 180 | 181 | match 182 | (=>)|(->)|[-:=*,!.+|%/&~@<>;] 183 | name 184 | keyword.operator.rust 185 | 186 | 187 | match 188 | _ 189 | name 190 | support.function.rust 191 | 192 | 193 | repository 194 | 195 | rust_escaped_character 196 | 197 | match 198 | \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.) 199 | name 200 | constant.character.escape.source.rust 201 | 202 | 203 | scopeName 204 | source.rust 205 | uuid 206 | 4339386b-4d67-4f0e-9e78-09ecbcddf71d 207 | 208 | 209 | -------------------------------------------------------------------------------- /RustComment.JSON-tmPreferences: -------------------------------------------------------------------------------- 1 | { "name": "Rust Comments", 2 | "scope": "source.rust", 3 | "settings": { 4 | "shellVariables": [{"name": "TM_COMMENT_START", "value": "// "}, 5 | {"name": "TM_COMMENT_START_2", "value": "/*"}, 6 | {"name": "TM_COMMENT_END_2", "value": "*/"}, 7 | {"name": "TM_COMMENT_DISABLE_INDENT", "value": "no"} 8 | ] 9 | }, 10 | "uuid": "e36d2f49-c7b0-42fe-b902-a0ed36a258ca" 11 | } -------------------------------------------------------------------------------- /RustComment.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Rust Comments 7 | scope 8 | source.rust 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | // 18 | 19 | 20 | name 21 | TM_COMMENT_START_2 22 | value 23 | /* 24 | 25 | 26 | name 27 | TM_COMMENT_END_2 28 | value 29 | */ 30 | 31 | 32 | name 33 | TM_COMMENT_DISABLE_INDENT 34 | value 35 | no 36 | 37 | 38 | 39 | uuid 40 | e36d2f49-c7b0-42fe-b902-a0ed36a258ca 41 | 42 | 43 | -------------------------------------------------------------------------------- /RustIndent.JSON-tmPreferences: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rust Indent", 3 | "scope": "source.rust", 4 | "settings": { 5 | "increaseIndentPattern": "^.*\\{[^}\"']*$", 6 | "decreaseIndentPattern": "^(.*\\*/)?\\s*\\}.*$" 7 | } 8 | } -------------------------------------------------------------------------------- /RustIndent.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Rust Indent 7 | scope 8 | source.rust 9 | settings 10 | 11 | decreaseIndentPattern 12 | ^(.*\*/)?\s*\}.*$ 13 | increaseIndentPattern 14 | ^.*\{[^}"']*$ 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /RustSymbols.JSON-tmPreferences: -------------------------------------------------------------------------------- 1 | { "name": "Rust Symbols", 2 | "scope": "entity.name.function.source.rust", 3 | "settings": {"showInSymbolList": 1}, 4 | "uuid": "d3270dd1-4ccd-428e-8dda-d3d20ee9fc7e" 5 | } -------------------------------------------------------------------------------- /RustSymbols.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Rust Symbols 7 | scope 8 | entity.name.function.source.rust 9 | settings 10 | 11 | showInSymbolList 12 | 1 13 | 14 | uuid 15 | d3270dd1-4ccd-428e-8dda-d3d20ee9fc7e 16 | 17 | 18 | -------------------------------------------------------------------------------- /Some.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | Some 4 | source.rust 5 | Some(…) 6 | 7 | -------------------------------------------------------------------------------- /assert.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | ast 6 | source.rust 7 | 8 | -------------------------------------------------------------------------------- /const.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | const 4 | source.rust 5 | const …: … = … 6 | 7 | -------------------------------------------------------------------------------- /do.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | do 6 | source.rust 7 | do … { … } 8 | 9 | -------------------------------------------------------------------------------- /enum.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | enum 6 | source.rust 7 | enum … { … } 8 | 9 | -------------------------------------------------------------------------------- /fail.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | fail 6 | source.rust 7 | 8 | -------------------------------------------------------------------------------- /fmt.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | fmt! 4 | source.rust 5 | fmt!("…") 6 | 7 | -------------------------------------------------------------------------------- /fn.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | fn 6 | source.rust 7 | fn …() { … } 8 | 9 | -------------------------------------------------------------------------------- /for.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | for 6 | source.rust 7 | for … { … } 8 | 9 | -------------------------------------------------------------------------------- /impl.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | impl 7 | source.rust 8 | impl … { … } 9 | 10 | -------------------------------------------------------------------------------- /loop.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | loop 6 | source.rust 7 | loop { … } 8 | 9 | -------------------------------------------------------------------------------- /macro_rules.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | (${3}) 4 | )]]> 5 | macro_rules 6 | source.rust 7 | macro_rules! … ( … ) 8 | 9 | -------------------------------------------------------------------------------- /main.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | main 6 | source.rust 7 | fn main() { … } 8 | 9 | -------------------------------------------------------------------------------- /match.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | match 6 | source.rust 7 | match … { … } 8 | 9 | -------------------------------------------------------------------------------- /struct-tuple.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | struct-tuple 4 | source.rust 5 | struct …(…) 6 | 7 | -------------------------------------------------------------------------------- /struct.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | struct 6 | source.rust 7 | struct … { … } 8 | 9 | -------------------------------------------------------------------------------- /test.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | test 7 | source.rust 8 | 9 | -------------------------------------------------------------------------------- /trait.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | trait 7 | source.rust 8 | trait … { … } 9 | 10 | -------------------------------------------------------------------------------- /type.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | type 4 | source.rust 5 | type … = … 6 | -------------------------------------------------------------------------------- /while.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | while 6 | source.rust 7 | while … { … } 8 | 9 | --------------------------------------------------------------------------------