Skip to content

Commit

Permalink
[Rust] Tweak tmPreferences (sublimehq#3195)
Browse files Browse the repository at this point in the history
* [Rust] Rename tmPreferences files

This commit renames all tmPreferences files to match the common naming
scheme used in all other packages.

* [Rust] Remove `name` field from tmPreferences files

* [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
  • Loading branch information
deathaxe authored and mitranim committed Mar 20, 2022
1 parent 5de82a6 commit 0885160
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Rust Comments</string>
<key>scope</key>
<string>source.rust</string>
<key>settings</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Rust Indent</string>
<key>scope</key>
<string>source.rust</string>
<key>settings</key>
Expand Down
16 changes: 0 additions & 16 deletions Rust/RustSymbols.tmPreferences

This file was deleted.

22 changes: 22 additions & 0 deletions Rust/Symbol List.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>
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
</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
32 changes: 32 additions & 0 deletions Rust/tests/symbols/syntax_test_symbols.rs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0885160

Please sign in to comment.