Skip to content

Dotty error codes with single quotes highlight when not needed #52

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

Closed
ekrich opened this issue Sep 12, 2019 · 3 comments
Closed

Dotty error codes with single quotes highlight when not needed #52

ekrich opened this issue Sep 12, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@ekrich
Copy link

ekrich commented Sep 12, 2019

minimized code

[error] -- [E053] Reference Error: /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfig.scala:719:19 
[error] 719 |  def getEnum[T <: Enum[T]](enumClass: Class[T], path: String): T = {
[error]     |                   ^^^^^^^
[error]     |                   Enum does not take type parameters
[error] -- [E053] Reference Error: /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfig.scala:841:32 
[error] 841 |  private def getEnumValue[T <: Enum[T]](path: String,
[error]     |                                ^^^^^^^
[error]     |                                Enum does not take type parameters
[error] -- [E007] Type Mismatch Error: /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfig.scala:845:21 
[error] 845 |    try Enum.valueOf(enumClass, enumName)
[error]     |                     ^^^^^^^^^
[error]     |   Found:    Class[T](enumClass)
[error]     |   Required: Class[T']
[error]     |   
[error]     |   where:    T  is a type in method getEnumValue with bounds <: Enum
[error]     |             T' is a type variable with constraint <: Enum[LazyRef(T)]
[error] -- [E008] Member Not Found Error: /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfig.scala:851:37 
[error] 851 |          enumNames.add(enumConstant.name)
[error]     |                        ^^^^^^^^^^^^^^^^^
[error]     |      value name is not a member of T
[error]     |      
[error]     |      where:    T is a type in method getEnumValue with bounds <: Enum
[error] -- [E053] Reference Error: /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfig.scala:829:23 
[error] 829 |  def getEnumList[T <: Enum[T]](enumClass: Class[T],
[error]     |                       ^^^^^^^
[error]     |                       Enum does not take type parameters
[error] -- Error: /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfigObject.scala:22:37 

Screenshot 2019-10-03 at 14 35 11

expectation

When wrapping Scala errors surrounded by triple ticks and Scala language, Dotty errors like above that have embedded single ticks across multiple lines would not have extra highlighting.

@ekrich
Copy link
Author

ekrich commented Sep 12, 2019

Originally reported here scala/scala3#7195

nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 22, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 22, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 22, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 22, 2019
@nicolasstucki nicolasstucki added the enhancement New feature or request label Sep 22, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 23, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 23, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 23, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 23, 2019
nicolasstucki added a commit to nicolasstucki/vscode-scala-syntax that referenced this issue Sep 23, 2019
@nicolasstucki
Copy link
Contributor

After #61 the red background only spans until the end of the line where the opening ' is located.

@nicolasstucki
Copy link
Contributor

Fixed in scala/scala3#7511. The error messages will not contain ' anymore. There is no point trying to highlight command line outputs correctly in vscode-scala-syntax as that is not valid Scala code.

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

No branches or pull requests

2 participants