atom / language-java

Java package for Atom
Other
62 stars 58 forks source link

Update scope for object properties #225

Closed sadikovi closed 4 years ago

sadikovi commented 4 years ago

Requirements

Description of the Change

This PR removes usage of variable.other.property.java, replaces it with variable.other.object.property.java.

Having variable.other.property.java does not make sense since there is no property call without an object/instance. This change unifies object with properties in terms of scope, see below:

Before

object.property1.property2

// would result in 
// object => [variable.other.object.java]
// property1 => [variable.other.object.property.java]
// property2 => [variable.other.property.java]

After

object.property1.property2

// would result in 
// object => [variable.other.object.java]
// property1 => [variable.other.object.property.java]
// property2 => [variable.other.object.property.java]

The same is applicable for object.property: Before:

[variable.other.object.java].[variable.other.property.java]

After:

[variable.other.object.java].[variable.other.object.property.java]

Alternate Designs

None were considered.

Benefits

Makes the grammar consistent, all properties get scope variable.other.object.property.java. Allows syntax highlighting to rely on the fact that all properties will have this scope.

Possible Drawbacks

Could potentially break syntax highlighting that relies on separation between trailing and non-trailing properties.

Applicable Issues

Closes #224