Closed arturhun closed 4 years ago
@arturhun, depending on whether you have HighlightJS or Prism selected as your syntax highlighter script this will change.
The selection is made in Stylesheet-Settings
The two scripts use different style sheets and can be customized by modifying CSS for individual elements or as a whole: Customizing-HTML-Preview
Why would all the Scripts be disabled/greyed out?
@arturhun, the syntax highlighting scripts are available only in JavaFX preview browser.
ℹ️ The syntax highlighting in the text editor injected language is controlled by the settings for the language and not markdown, just like injected language in Java strings.
The typescript highlighting can be changed under Editor > Color Scheme > TypeScript.
The ts
language is not recognized as any language so there is no highlighting.
@vsch
OK, let's put aside ts
- let's talk typescript
then.
Not sure I understand what happens - my main framework and language has long been Angular/TypeScript - I would have probably gone crazy if my TS interfaces had the highlighting wrong, marking half of it red as in the first example. :)
I got my TS scheme set like so:
So something is screwing the types coloring for markdown.
@arturhun, I am not familiar with typescript but it seems you need some imports to define the types. The injected fragment is parsed by the IDE as is so any undefined types would be highlighted as red.
To confirm you can create a typescript file with the same content as your fenced code to see if it also highlights the types as error.
This is a limitation of the way the IDE syntax highlights injected languages.
To confirm you can create a typescript file with the same content as your fenced code to see if it also highlights the types as error.
This is exactly why I rasie the problem - pasted existing TS code, formatted just fine, and saw it mangled in markdown. Types like string or number are basic, provided by the language service, not imported.
OK, looks like I will have to live with that. Thanks.
@arturhun, then there is something about injected language processing by typescript plugin that is missing which is included if the code comes from a typescript file.
I will look into it to see if there is an issue with either markdown or typescript plugin that should be addressed.
@arturhun, I don't use typescript so don't know what configuration would affect the error highlighting.
Without changing WebStorm 2019.2 defaults for typescript, I created a typescript file and a markdown file with fenced code. No issues with error highlighting:
Anything other than editor colors that is changed from defaults for typescript in your project?
Both variants not satisfying my eyes :) Could we have it improved please?