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

Fix underscore in class names#200

Merged
sadikovi merged 2 commits intoatom:masterfrom
sadikovi:underscore-1
Jun 15, 2019
Merged

Fix underscore in class names#200
sadikovi merged 2 commits intoatom:masterfrom
sadikovi:underscore-1

Conversation

@sadikovi
Copy link
Contributor

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

I updated patterns that relate to storage types to include underscore wherever it was missing; also updated variable pattern to capture storage types with underscore.

Added unit test.

Alternate Designs

No alternative designs were considered.

Benefits

Fixes issue of having package and class names that start with underscore.

Possible Drawbacks

I had to comment out line 832 in java-spec.coffee, "_1" value is now highlighted as storage.type.java. I will open issue to fix this later. Should not affect anything else, as far as I am concerned.

Applicable Issues

Fixes #198


{tokens} = grammar.tokenizeLine '_1'
expect(tokens[0]).toEqual value: '_1', scopes: ['source.java']
# TODO: Fix this test, currently it has a scope of "storage.type.java", because it starts with underscore.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably a valid type anyway in Java, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it could be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me check quickly.

Choose a reason for hiding this comment

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

It at least appears to be a valid Identifier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I checked, it is a valid class name. I think I am going to remove the test.

@sadikovi sadikovi merged commit 17b28d2 into atom:master Jun 15, 2019
@sadikovi sadikovi deleted the underscore-1 branch June 15, 2019 11:46
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.

Underscore "_" not recognized inside type qualifier

4 participants