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

Relax the too restrictive begin expression for catch block #217

Merged
merged 2 commits into from
Nov 27, 2019
Merged

Relax the too restrictive begin expression for catch block #217

merged 2 commits into from
Nov 27, 2019

Conversation

Vigilans
Copy link
Contributor

@Vigilans Vigilans commented Nov 27, 2019

Description of the Change

Relax the too restrictive begin expression for catch block for following reasons:

  • The begin pattern is not suitable for dealing with multi-line pattern.
  • any comments between catch and ( would also break the highlighting.

Leave the catch keyword be would just be fine, since syntax highlighting should only be responsible for happy path.

Alternate Designs

Any other design would introduce new complexity.

Benefits

  • Can correctly highlight when caught exceptions are split in multiple lines
  • Can correctly highlight when '(' is placed in a new line after catch
  • Can correctly highlight when there is comment between catch and '('
  • Reduces the complexity

Possible Drawbacks

More like a right hightlight for wrong syntax in code.

Applicable Issues

Fix #205
FIx microsoft/vscode-java-pack#259

Copy link
Contributor

@sadikovi sadikovi left a comment

Choose a reason for hiding this comment

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

LGTM. Merging to master.

@sadikovi sadikovi merged commit b8ace40 into atom:master Nov 27, 2019
@Vigilans Vigilans deleted the vigilans/catch branch November 28, 2019 03:09
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.

Java try-catch command color display problem Java scopes break when there are many Exceptions with a newline
2 participants