Skip to content

Error codes with single quote render poorly in Markdown #7195

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 10, 2019 · 7 comments
Closed

Error codes with single quote render poorly in Markdown #7195

ekrich opened this issue Sep 10, 2019 · 7 comments

Comments

@ekrich
Copy link
Contributor

ekrich commented Sep 10, 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 

expectation

My hope would be that error messages like above could be modified to render nicely in Markdown since many people use UIs like GitHub.

@smarter
Copy link
Member

smarter commented Sep 11, 2019

Syntax highlighting on github is controlled by https://github.com/scala/vscode-scala-syntax, so maybe the highlighter could be fixed instead.

@ekrich
Copy link
Contributor Author

ekrich commented Sep 11, 2019

Could the message just be T1 instead of T prime? Is the single tick significant?

@smarter
Copy link
Member

smarter commented Sep 12, 2019

The problem is that T1 could be the name of a different type parameter, the type parameter is called T and the tick is used to differentiate different parameters with the same name. Alternatively we could use Unicode subscripts to append a number, or colors.

@ekrich
Copy link
Contributor Author

ekrich commented Sep 12, 2019

Roger, so T prime means that it is T just not the same T - got it. Do you think we should create an issue for the syntax then and maybe leave this one here for reference for the time being or close this one?

@smarter
Copy link
Member

smarter commented Sep 12, 2019

We could close this one for now, and reopen if we can't fix syntax highlighting.

@ekrich
Copy link
Contributor Author

ekrich commented Sep 12, 2019

Created issue scala/vscode-scala-syntax#52

@nicolasstucki
Copy link
Contributor

nicolasstucki commented Sep 23, 2019

Possible fix scala/vscode-scala-syntax#59

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 7, 2019
This makes vscode-scala-syntax (and GitHub) highlight error messages correctly.

Now it will print
```scala
   |        where:    T  is a type in object B
   |                  T² is a type in object A
```
instead of
```scala
   |        where:    T  is a type in object B
   |                  T' is a type in object A
```
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 7, 2019
This makes vscode-scala-syntax (and GitHub) highlight error messages correctly.

Now it will print
```scala
   |        where:    T  is a type in object B
   |                  T² is a type in object A
```
instead of
```scala
   |        where:    T  is a type in object B
   |                  T' is a type in object A
```
anatoliykmetyuk added a commit that referenced this issue Nov 7, 2019
Fix #7195: Use superscripts instead of `'` for duplicated types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants