From f7dc9083829b4d7483595d632542fbba3b46692c Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 10 Jan 2022 20:51:01 +0100 Subject: [PATCH 1/3] [Rust] Rename tmPreferences files This commit renames all tmPreferences files to match the common naming scheme used in all other packages. --- Rust/{RustComment.tmPreferences => Comments.tmPreferences} | 0 .../{RustIndent.tmPreferences => Indentation Rules.tmPreferences} | 0 Rust/{RustSymbols.tmPreferences => Symbol List.tmPreferences} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Rust/{RustComment.tmPreferences => Comments.tmPreferences} (100%) rename Rust/{RustIndent.tmPreferences => Indentation Rules.tmPreferences} (100%) rename Rust/{RustSymbols.tmPreferences => Symbol List.tmPreferences} (100%) diff --git a/Rust/RustComment.tmPreferences b/Rust/Comments.tmPreferences similarity index 100% rename from Rust/RustComment.tmPreferences rename to Rust/Comments.tmPreferences diff --git a/Rust/RustIndent.tmPreferences b/Rust/Indentation Rules.tmPreferences similarity index 100% rename from Rust/RustIndent.tmPreferences rename to Rust/Indentation Rules.tmPreferences diff --git a/Rust/RustSymbols.tmPreferences b/Rust/Symbol List.tmPreferences similarity index 100% rename from Rust/RustSymbols.tmPreferences rename to Rust/Symbol List.tmPreferences From e8875af05aea1e73f648f7cbe4203d3633bb1758 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 10 Jan 2022 21:07:42 +0100 Subject: [PATCH 2/3] [Rust] Remove `name` field from tmPreferences files --- Rust/Comments.tmPreferences | 2 -- Rust/Indentation Rules.tmPreferences | 2 -- Rust/Symbol List.tmPreferences | 2 -- 3 files changed, 6 deletions(-) diff --git a/Rust/Comments.tmPreferences b/Rust/Comments.tmPreferences index 5ea948fd99..25af7328dc 100644 --- a/Rust/Comments.tmPreferences +++ b/Rust/Comments.tmPreferences @@ -1,8 +1,6 @@ - name - Rust Comments scope source.rust settings diff --git a/Rust/Indentation Rules.tmPreferences b/Rust/Indentation Rules.tmPreferences index d3795b322e..a725703cdf 100644 --- a/Rust/Indentation Rules.tmPreferences +++ b/Rust/Indentation Rules.tmPreferences @@ -1,8 +1,6 @@ - name - Rust Indent scope source.rust settings diff --git a/Rust/Symbol List.tmPreferences b/Rust/Symbol List.tmPreferences index e1382e38c8..97a9957b7e 100644 --- a/Rust/Symbol List.tmPreferences +++ b/Rust/Symbol List.tmPreferences @@ -1,8 +1,6 @@ - name - Rust Symbols scope entity.name.function.rust, entity.name.macro.rust, entity.name.struct.rust, entity.name.enum.rust, entity.name.module.rust, entity.name.type.rust, entity.name.impl.rust, entity.name.trait.rust settings From f350d48003ec0a7e404741784a769d971fad415a Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 10 Jan 2022 21:12:11 +0100 Subject: [PATCH 3/3] [Rust] Tweak Symbol List This commit... 1. removes the following entries, which are defined in Default/Symbol List.tmPreferences: - `entity.name.enum` - `entity.name.function` - `entity.name.type` 2. adds: - `entity.name.constant.rust` - `entity.name.union` 3. adds a simple test for each symbol kind --- Rust/Symbol List.tmPreferences | 10 ++++++- Rust/tests/symbols/syntax_test_symbols.rs | 32 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 Rust/tests/symbols/syntax_test_symbols.rs diff --git a/Rust/Symbol List.tmPreferences b/Rust/Symbol List.tmPreferences index 97a9957b7e..ff71ccd049 100644 --- a/Rust/Symbol List.tmPreferences +++ b/Rust/Symbol List.tmPreferences @@ -2,7 +2,15 @@ scope - entity.name.function.rust, entity.name.macro.rust, entity.name.struct.rust, entity.name.enum.rust, entity.name.module.rust, entity.name.type.rust, entity.name.impl.rust, entity.name.trait.rust + + entity.name.constant.rust, + entity.name.impl.rust, + entity.name.macro.rust, + entity.name.module.rust, + entity.name.struct.rust, + entity.name.trait.rust, + entity.name.union.rust + settings showInSymbolList diff --git a/Rust/tests/symbols/syntax_test_symbols.rs b/Rust/tests/symbols/syntax_test_symbols.rs new file mode 100644 index 0000000000..b3ed1d3087 --- /dev/null +++ b/Rust/tests/symbols/syntax_test_symbols.rs @@ -0,0 +1,32 @@ +// SYNTAX TEST "Packages/Rust/Rust.sublime-syntax" + +fn foo() {} +// @@@ definition + +enum MyEnum {} +// @@@@@@ definition + +macro_rules! my_macro [] +// @@@@@@@@ definition + +mod my_mod { } +// @@@@@@ definition + +struct MyStruct { +// @@@@@@@@ definition + + const A = 0; +// @ definition + + fn bar() {} +// @@@ definition +} + +trait MyTrait {} +// @@@@@@@ definition + +type MyType; +// @@@@@@ definition + +union Union {} +// @@@@@ definition