Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add support for "yield", "sealed", and "permits" Java keywords #234

Merged
merged 2 commits into from
Sep 19, 2020

Conversation

sadikovi
Copy link
Contributor

@sadikovi sadikovi commented Sep 18, 2020

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

This PR adds support for JDK 13+ keywords:

  • yield
  • sealed
  • permits

yield keyword is similar to return, so it is handled as "keyword.control.java". sealed and permits are only for classes and interfaces: sealed keyword is a "storage.modifier.java" and permits is handled similar to extends and implements keywords.

Alternate Designs

No alternative designs were considered.

Benefits

Fixes highlighting of the aforementioned keywords.

Possible Drawbacks

Might potentially break class extends and implements scopes, but that would have to be a corner case not handled by unit tests.

Applicable Issues

Fixes #230
Fixes #232

@sadikovi sadikovi merged commit d99f040 into atom:master Sep 19, 2020
@sadikovi sadikovi deleted the add-more-keywords branch September 19, 2020 08:00
sadikovi added a commit that referenced this pull request Oct 3, 2020
### Requirements

* Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
* All new code requires tests to ensure against regressions

### Description of the Change

This PR adds `non-sealed` keyword as a follow-up to #234.
I also had to update the class pattern to capture `-` that is in the keyword.

### Alternate Designs

N/A.

### Benefits

Adds support for `non-sealed` keyword.

### Possible Drawbacks

N/A.

### Applicable Issues

Fixes #236
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Highlight keyword 'sealed' for Java 15 Highlight 'yield' keyword in switch statement
1 participant