1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-09-21 18:09:09 +03:00

Merge remote-tracking branch 'dead10ck/fix-rust-solarized'

This commit is contained in:
Maxime Coste 2021-05-18 21:02:10 +10:00
commit db24a78e2c
13 changed files with 71 additions and 3 deletions

View File

@ -46,7 +46,9 @@ add-highlighter shared/rust/line_doctest/code default-region ref rust
add-highlighter shared/rust/line_code_rest region ^\h*//[!/]\h*``` ^\h*//[!/]\h*```$ fill documentation # reset invalid doctest
add-highlighter shared/rust/line_comment2 region //[!/]{2} $ fill comment
add-highlighter shared/rust/line_doc region //[!/] $ fill documentation
add-highlighter shared/rust/line_comment1 region // $ fill comment
add-highlighter shared/rust/line_comment1 region // $ group
add-highlighter shared/rust/line_comment1/comment fill comment
add-highlighter shared/rust/line_comment1/todo regex (TODO|NOTE|FIXME): 1:meta
add-highlighter shared/rust/block_comment2 region -recurse /\*\*\* /\*\*\* \*/ fill comment
add-highlighter shared/rust/block_doc region -recurse /\*\* /\*\* \*/ regions
@ -60,7 +62,9 @@ add-highlighter shared/rust/block_doc/doctest/inner/comment regex ^\h*\* 0:docum
add-highlighter shared/rust/block_doc/doctest/inner/code ref rust
add-highlighter shared/rust/block_doc/code_rest region ``` ``` fill documentation
add-highlighter shared/rust/block_doc/doc default-region fill documentation
add-highlighter shared/rust/block_comment1 region -recurse /\* /\* \*/ fill comment
add-highlighter shared/rust/block_comment1 region -recurse /\* /\* \*/ group
add-highlighter shared/rust/block_comment1/comment fill comment
add-highlighter shared/rust/block_comment1/todo regex (TODO|NOTE|FIXME): 1:meta
add-highlighter shared/rust/macro_attributes region -recurse "\[" "#!?\[" "\]" regions
add-highlighter shared/rust/macro_attributes/ default-region fill meta
@ -82,8 +86,9 @@ add-highlighter shared/rust/code/question_mark regex \? 0:meta
add-highlighter shared/rust/code/function_call regex _?[a-zA-Z]\w*\s*(?=\() 0:function
add-highlighter shared/rust/code/generic_function_call regex _?[a-zA-Z]\w*\s*(?=::<) 0:function
add-highlighter shared/rust/code/function_declaration regex (?:fn\h+)(_?\w+)(?:<[^>]+?>)?\( 1:function
add-highlighter shared/rust/code/keywords regex \b(?:let|as|fn|return|match|if|else|loop|for|in|while|break|continue|box|where|impl|dyn|unsafe|async|await|mod|crate|use|extern|trait|struct|enum|union|type|default)\b 0:keyword
add-highlighter shared/rust/code/keywords regex \b(?:as|break|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|pub|return|self|Self|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|try)\b 0:keyword
add-highlighter shared/rust/code/storage regex \b(move|mut|ref|static|const)\b 0:type
add-highlighter shared/rust/code/pub_with_scope regex \b(pub)\h*(\()\h*(crate|super|self|in\h+[\w:]+)\h*(\)) 1:keyword 2:meta 4:meta
# after let can be an arbitrary pattern match
add-highlighter shared/rust/code/macro regex \b\w+! 0:meta
# the number literals syntax is defined here:

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,4 @@
let foo = "bar";
let mut foo = "bar";
let (foo, bar) = ("baz", "quux");
let (mut foo, mut bar) = ("baz", "quux");

View File

@ -0,0 +1,3 @@
source "%val{runtime}/colors/default.kak"
source "%val{runtime}/rc/filetype/rust.kak"
set buffer filetype rust

View File

@ -0,0 +1,7 @@
ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }'
ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "l" }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "et" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "=" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"bar\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ";\u000a" }], [{ "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "let" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "mut" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "=" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"bar\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ";\u000a" }], [{ "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "let" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(foo, bar) " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "=" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " (" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"baz\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ", " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"quux\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }], [{ "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "let" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "(" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "mut" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " foo, " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "mut" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " bar) " }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "=" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " (" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"baz\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ", " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"quux\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": ");\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }'
ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }'
ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }'
ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }'
ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }'
ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }'

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,17 @@
// bare
pub
// with scope
pub(crate)
pub (crate)
pub(super)
pub(self)
pub(in ::foo)
pub(in foo)
pub(in foo::bar)
pub(in foo::bar::baz)
// not valid pub expression, parens not colored
pub(crat)
pub(in)
spub(crate)

View File

@ -0,0 +1,3 @@
source "%val{runtime}/colors/default.kak"
source "%val{runtime}/rc/filetype/rust.kak"
set buffer filetype rust

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,9 @@
// TODO: some totally awesome comment
// NOTE: some note
// FIXME: fix some bug
/*
* TODO: some totally awesome comment
* NOTE: some note
* FIXME: fix some bug
*/

View File

@ -0,0 +1,3 @@
source "%val{runtime}/colors/default.kak"
source "%val{runtime}/rc/filetype/rust.kak"
set buffer filetype rust

View File

@ -0,0 +1,7 @@
ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }'
ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "/" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/ " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "TODO" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": ": some totally awesome comment" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "NOTE" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": ": some note" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "// " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "FIXME" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": ": fix some bug" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "/*\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "TODO" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": ": some totally awesome comment\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "NOTE" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": ": some note\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " * " }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "FIXME" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": ": fix some bug\u000a" }], [{ "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": " */" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }'
ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }'
ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }'
ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }'
ui_out '{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] }'
ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }'