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

Scala fixes and features #6

Merged
merged 6 commits into from
Jun 18, 2015
Merged

Conversation

djspiewak
Copy link
Contributor

This PR adds an assortment of fixes for the Scala mode (including one performance bug fix!). I've been running with this mode as my primary mode for Scala across several non-trivial codebases for quite some time now, and it works much better than the original. The exact features are split out into individual commits, so if you don't want one (or more), we can rebase some things away. I do recommend taking the whole package though.

  • self isn't a keyword in Scala, though super and this are
  • Type lambdas (e.g. ({ type λ[α] = EitherT[Task, Throwable, α] })#λ) are a very common pattern in highly abstracted Scala. I added a bit of syntax highlighting which parses out the boilerplate and highlights it as a comment, while highlighting the rest as a type definition. This makes things FAR more readable. It only works for lambdas of up to arity-2 and only using greek letters (conventional).
  • The performance bug was in the new regex, which was overly greedy and could sometimes consume the entire file before backtracking.
  • Symbols now highlight the same way that they do in Ruby, which means that they highlight at all on Monokai
  • Triple quoted strings with extra closing quotes (which are valid) now highlight correctly. For example: """phooey"""".length now highlights as you would expect.
  • String interpolation was introduced in Scala 2.10. I've added support for highlighting in the same style as Ruby interpolated strings, though the regexes are a bit more complicated. Technically, it is possible to implement interpolation macros in Scala which will not highlight using this code, but they would be highly unconventional and I've never seen one. My regex covers all practical known cases.

sublimehq pushed a commit that referenced this pull request Jun 18, 2015
@sublimehq sublimehq merged commit efbcebd into sublimehq:master Jun 18, 2015
@djspiewak djspiewak deleted the feature/scala branch July 8, 2015 15:09
deathaxe pushed a commit to deathaxe/sublime-packages that referenced this pull request Dec 18, 2017
[Git] Config: Remove format-escapes
daxmc99 pushed a commit to daxmc99/Packages that referenced this pull request Jun 3, 2021
gitworkflows pushed a commit to gsoc2/Packages that referenced this pull request Apr 8, 2024
poetry [1] lock files are just toml files. I looked for other examples of
exact filenames in the matchers and for example makefile.in files are just
listed under file_extensions.

[1]: https://python-poetry.org/

(cherry picked from commit af016b1)

Co-authored-by: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
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.

None yet

2 participants