Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rust] Tweak tmPreferences #3195

Merged
merged 3 commits into from
Jan 11, 2022

Conversation

deathaxe
Copy link
Collaborator

This commit applies some changes to Rust's tmPreferences to re-align them with the other packages.

We might want to discuss, whether we want to add entity.name.constant.rust to the symbol list as requested by #3193 as it would cause all global and local constant declarations to be indexed.

This commit renames all tmPreferences files to match the common naming
scheme used in all other packages.
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
@keith-hall
Copy link
Collaborator

There's an RFC for the scoping and indexing of constants at #458

@deathaxe
Copy link
Collaborator Author

I can't find something about indexing in it. What I have in mind is variables not to be scoped in general as those would cause too much noise. Rust scopes constants entity.name.constant in declarations only. So the only concern is whether local constant declarations (in functions) are of interest in a global index.

@deathaxe deathaxe merged commit ebd68b8 into sublimehq:master Jan 11, 2022
@deathaxe deathaxe deleted the pr/rust/tweak-preferences branch January 11, 2022 16:14
varungandhi-src pushed a commit to sourcegraph/Packages that referenced this pull request Jan 14, 2022
* [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
Comment on lines +15 to +23
struct MyStruct {
// @@@@@@@@ definition

const A = 0;
// @ definition

fn bar() {}
// @@@ definition
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually invalid syntax. What it should be is:

struct MyStruct {}
//     @@@@@@@@ definition

impl MyStruct {
    const A: i32 = 0;
//        @ definition

    fn bar() {}
//     @@@ definition
}

mitranim pushed a commit to mitranim/Packages that referenced this pull request Mar 25, 2022
* [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants