microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Errors highlighting color #550

Closed rbaumi closed 5 years ago

rbaumi commented 8 years ago

Is it possible to change the color (or maybe the style) of errors highlighting? What I mean is the color of the Keywords from the theme.

Any way to change the color and / or mark it on the line number (like linter does)?

rbaumi commented 8 years ago

Ok, I could manage to do it by changing call in file typescript/listeners/idle.py, line 164 to:

view.add_regions(region_key, error_regions, "invalid.illegal", "",
    sublime.DRAW_SOLID_UNDERLINE)

Result:

It would be good if both color and mark style were a config option. Also would be nice to be able to allow for marking the whole line (start_offset variable).

zhengbli commented 8 years ago

Thanks for nivestigating! You are always welcome to send a PR :)

alexburner commented 7 years ago

Thanks for the patch @rbaumi, I can see errors now!

rgant commented 5 years ago

A work around for this is to add this to your .tmTheme in Sublime:

<dict>
  <key>name</key>
  <string>TypeScript Errors</string>
  <key>scope</key>
  <string>keyword</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#F92672</string>
  </dict>
</dict>
<dict>
  <key>name</key>
  <string>Keyword</string>
  <key>scope</key>
  <string>keyword.control, keyword.operator, keyword.other</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#cc99cc</string>
  </dict>
</dict>
betorobson commented 5 years ago

@rgant these change on .tmTheme should display erros with gutter and outline? I have tried it but I got any change :-(

rgant commented 5 years ago

I don't use GitGutter (weird I know) so I'm not 100% what you are talking about. My styles above only apply to the Sublime view of the file.

screen shot 2018-11-08 at 10 14 17

The pink squiggles in the screen shot above are scope "keyword" and are from TypeScript's error checking. The purple "import" and "from" are scope "keyword.control" (or "keyword.operator" or "keyword.other").

betorobson commented 5 years ago

I am looking for a way to display Typescript Erros with gutters and outline like this: screenshot from 2018-11-08 13-29-44

rgant commented 5 years ago

In order do do that you would need to change the icon parameter to the add_regions code for displaying the errors. See #681 where I am changing the scope parameter. add_regions documented here: https://www.sublimetext.com/docs/3/api_reference.html#sublime.View

rgant commented 5 years ago

I believe this is resolved by merging #681 and this issue can be closed.

orta commented 5 years ago

👍