scala / vscode-scala-syntax

Visual Studio Code extension for syntax highlighting Scala sources
https://marketplace.visualstudio.com/items?itemName=scala-lang.scala
MIT License
74 stars 35 forks source link

Improve extends path syntax #143

Open nicolasstucki opened 4 years ago

nicolasstucki commented 4 years ago

@MaximeKjaer:

Two small things stand out to me here:

  1. The dots aren't highlighted. I think we should aim to highlight the dots in the qualified name as punctuation, like we do for qualified names in imports.
  2. The package names are highlighted as scala.source, whereas they are highlighted as entity.name.import.scala for imports. With my editor theme, package names show up as yellow in imports, and white in extends. Should we aim to unify the two? For instance, the package names in extends could be entity.name.scala.

Different highlightings for package names in import and extends

nicolasstucki commented 4 years ago

It seems to be simple to identify where to color the paths when we extend with extends or with but it might be trickier when we use the new , syntax.

class Foo extends Bar, Baz
MaximeKjaer commented 4 years ago

I think we may need the extends keyword to push us into a new state, say #parent-classes. Would there always be a clear end token to this state, like : or {, or could it end with a newline with the new syntax?