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

Format type annotation as part of the type, not part of the modifiers list #649

Merged
merged 1 commit into from
Aug 24, 2021

Conversation

copybara-service[bot]
Copy link

Format type annotation as part of the type, not part of the modifiers list

Given e.g. @Deprecated @Nullable Object foo() {}, prefer this:

@Deprecated
@Nullable Object foo() {}

instead of:

@Deprecated
@Nullable
Object foo() {}

The implementation is complicated by the fact that the AST doesn't store
source position information for modifiers, and there's no requirement that
declaration annotations, modifiers, and type annotations appear in any
particular order in source.

To work around this, we examine the token stream to figure out the ordering
of the modifiers and annotations.

#5

@google-cla google-cla bot added the cla: yes label Aug 24, 2021
@copybara-service copybara-service bot force-pushed the test_392459885 branch 3 times, most recently from c268537 to a4c75f6 Compare August 24, 2021 23:08
… list

Given e.g. `@Deprecated @nullable Object foo() {}`, prefer this:

```
@deprecated
@nullable Object foo() {}
```

instead of:

```
@deprecated
@nullable
Object foo() {}
```

The implementation is complicated by the fact that the AST doesn't store
source position information for modifiers, and there's no requirement that
declaration annotations, modifiers, and type annotations appear in any
particular order in source.

To work around this, we examine the token stream to figure out the ordering
of the modifiers and annotations.

#5

PiperOrigin-RevId: 392769609
@copybara-service copybara-service bot merged commit 1a87579 into master Aug 24, 2021
@copybara-service copybara-service bot deleted the test_392459885 branch August 24, 2021 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant