Skip to content

Fix #2957 single quote highlighting and refactor #2995

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

Merged
merged 3 commits into from
Aug 18, 2017

Conversation

maxov
Copy link
Contributor

@maxov maxov commented Aug 18, 2017

Hi all, this is my first PR so please let me know if I'm doing anything wrong.

This fixes #2957, here's a picture of how things are highlighted now:

screen shot 2017-08-18 at 9 16 31 am

And it does actually highlight as little as possible for characters:
screen shot 2017-08-18 at 9 37 16 am

I also did a tiny refactor because Chars.isLineBreakChar did the same thing as some logic in the syntax highlighter.

@maxov maxov force-pushed the symbol-syntax-highlighting branch from ad2172f to 09d48b3 Compare August 18, 2017 16:22
@maxov maxov changed the title Fix single quote highlighting and refactor Fix #2957 single quote highlighting and refactor Aug 18, 2017
@felixmulder
Copy link
Contributor

Hey @maxov - LGTM for the most part. Restarted the CI for your last commit.

Regarding your example with:

scala> 'a'toString

Are you writing: 'a'.toString but the highlighter is eating up the dot?

@maxov
Copy link
Contributor Author

maxov commented Aug 18, 2017

@felixmulder No, that is valid Scala syntax. It is postfix operator notation that also works in previous versions of scala. I use it as a test to make sure that the 'a' is not getting highlighted as two symbol literals side by side.

@felixmulder
Copy link
Contributor

Unary postfix is valid, yes, we know this :)

If there are inconsistencies in the highlighting, then the most common symptom is: things get eaten up. Since we don't have tests for this - I needed to ask you.

@felixmulder felixmulder merged commit 9f5711f into scala:master Aug 18, 2017
@maxov
Copy link
Contributor Author

maxov commented Aug 18, 2017

I see, thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dotty Repl highlighting does not work for Symbol literals
2 participants