Skip to content

Commit

Permalink
[Java] Scope classes support.class (#3741)
Browse files Browse the repository at this point in the history
This commit changes scope of classes to `support.class`.

Java decided to use `storage.type.class` as `support` scopes are said to be used
for types provided by (standard) libraries only. Thus `storage.type` would be
the scope for all user defined data types.

The truth according to TextMate's scope naming guidelines is exactly vice versa.

`storage.type` is meant for basic builtin data types of a language, such as
`int`, `char`, ...

`support.class`, `support.type`, ... however are meant for all kinds of custom
or user defined data types - not only those from standard libraries.

As such it makes very much sense most (all) other syntaxes use `support.class`
for `ClassTypes`.

This commit intents to make Java follow those rules, too, again.
  • Loading branch information
deathaxe authored May 13, 2023
1 parent 9b24794 commit 748179b
Show file tree
Hide file tree
Showing 2 changed files with 431 additions and 431 deletions.
24 changes: 12 additions & 12 deletions Java/Java.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ contexts:

receiver-unqualified-type:
- match: '{{identifier}}'
scope: storage.type.class.java
scope: support.class.java
push:
- receiver-unqualified-type-end
- maybe-array-modifiers
Expand All @@ -1984,7 +1984,7 @@ contexts:
receiver-qualified-type:
- meta_scope: meta.path.java
- match: '{{identifier}}'
scope: storage.type.class.java
scope: support.class.java
push:
- receiver-qualified-type-end
- qualified-object-type-arguments
Expand Down Expand Up @@ -2034,7 +2034,7 @@ contexts:
receiver-qualified-identifier-path:
- meta_scope: meta.path.java
- match: '{{id}}'
scope: storage.type.class.java
scope: support.class.java
push:
- receiver-qualified-identifier-accessor
- maybe-type-argument
Expand Down Expand Up @@ -2224,7 +2224,7 @@ contexts:
scope: punctuation.accessor.dot.java
set:
- match: '{{classcase_id}}'
scope: storage.type.class.java
scope: support.class.java
set:
- variable-namespace-meta
- maybe-object-type-child
Expand Down Expand Up @@ -2598,7 +2598,7 @@ contexts:

qualified-constant-class:
- match: '{{identifier}}'
scope: storage.type.class.java
scope: support.class.java
set:
- qualified-constant-class-accessor
- maybe-type-argument
Expand Down Expand Up @@ -2652,7 +2652,7 @@ contexts:

static-import-class:
- match: '{{identifier}}'
scope: storage.type.class.java
scope: support.class.java
set:
- static-import-class-accessor
- maybe-type-argument
Expand Down Expand Up @@ -2710,7 +2710,7 @@ contexts:

type-import-class:
- match: '{{identifier}}'
scope: storage.type.class.java
scope: support.class.java
set:
- type-import-class-accessor
- maybe-type-argument
Expand Down Expand Up @@ -2884,7 +2884,7 @@ contexts:
object-types:
# Popular JDK classes, generic type variable
- match: (?:UUID|UR[LI]|\p{Lu}){{break}}
scope: storage.type.class.java
scope: support.class.java
push:
- maybe-object-type-child
- maybe-array-modifiers
Expand All @@ -2894,7 +2894,7 @@ contexts:
scope: constant.other.java
# Classes
- match: '{{classcase_id}}'
scope: storage.type.class.java
scope: support.class.java
push:
- maybe-object-type-child
- maybe-array-modifiers
Expand All @@ -2912,7 +2912,7 @@ contexts:
scope: constant.other.java
pop: 1
- match: '{{classcase_id}}'
scope: storage.type.class.java
scope: support.class.java
set:
- maybe-object-type-child
- maybe-array-modifiers
Expand Down Expand Up @@ -2941,7 +2941,7 @@ contexts:

unqualified-object-type:
- match: '{{id}}'
scope: storage.type.class.java
scope: support.class.java
push:
- unqualiefied-object-type-end
- maybe-type-argument
Expand Down Expand Up @@ -2975,7 +2975,7 @@ contexts:

qualified-object-type-class:
- match: '{{identifier}}'
scope: storage.type.class.java
scope: support.class.java
push:
- qualified-object-type-end
- qualified-object-type-arguments
Expand Down
Loading

0 comments on commit 748179b

Please sign in to comment.