Skip to content
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

(csharp) highlight fail: in and out as generic variable modifier #2239

Closed
xp44mm opened this issue Oct 30, 2019 · 8 comments · Fixed by #2378
Closed

(csharp) highlight fail: in and out as generic variable modifier #2239

xp44mm opened this issue Oct 30, 2019 · 8 comments · Fixed by #2378
Labels
enhancement An enhancement or new feature help welcome Could use help from community language

Comments

@xp44mm
Copy link
Contributor

xp44mm commented Oct 30, 2019

this is the jsfiddle:

<pre>
<code class="C#">
interface IObserver&lt;in T&gt;
{
  void OnNext(T item);
  void OnCompleted();
  void OnError(Exception error);
}
interface IObservable&lt;out T&gt;
{
  IDisposable Subscribe(IObserver&lt;T&gt; observer);
}
</code>
</pre>

in and out should be keywords.

@xp44mm xp44mm changed the title C# highlight fail read: in and out as generic variable modifier C# highlight fail: in and out as generic variable modifier Oct 30, 2019
@joshgoebel
Copy link
Member

jsfiddle please. Having a fiddle makes it easier to track these issues if they remain open a while and also allows developers to see them visually and fix them faster.

You can fork my template:
https://jsfiddle.net/ajoshguy/a1kntyg4/

@joshgoebel joshgoebel added the needs reproduction Needs a reproducible example or sample label Oct 30, 2019
@xp44mm
Copy link
Contributor Author

xp44mm commented Oct 30, 2019

this is the reproduction:
https://jsfiddle.net/0yu49Lf5/

@joshgoebel joshgoebel changed the title C# highlight fail: in and out as generic variable modifier (cs) highlight fail: in and out as generic variable modifier Oct 30, 2019
@joshgoebel
Copy link
Member

I wonder if we even try to pattern match the <> at all...

@joshgoebel joshgoebel added good first issue Should be easier for first time contributors bug help welcome Could use help from community language and removed needs reproduction Needs a reproducible example or sample good first issue Should be easier for first time contributors labels Oct 30, 2019
@joshgoebel
Copy link
Member

@xp44mm If C# is your language this issue might be a great one to get your feet a little wet: #1947

@xp44mm
Copy link
Contributor Author

xp44mm commented Oct 30, 2019

maybe the highlightjs should split into two parts: tokenizer and render. people contribute their tokenizer will be easier.

@joshgoebel
Copy link
Member

joshgoebel commented Oct 30, 2019

If all you want is the CSS, it's pretty easy to build the tokenizer -> html side and then just use our stylesheets. We're talking about stuff like that, but I'd rather see our parser get more powerful than people write their own parser for every language, that would be a bore.

@joshgoebel joshgoebel changed the title (cs) highlight fail: in and out as generic variable modifier (csharp) highlight fail: in and out as generic variable modifier Oct 31, 2019
@joshgoebel
Copy link
Member

maybe the highlightjs should split into two parts: tokenizer and render. people contribute their tokenizer will be easier.

I'm not sure for most people contributing a lexer would be simpler than contributing a list of regex patterns to match...

Do you have a full JS tokenizer/lexer for C# though? If so I'd be interested in exploring how someone MIGHT integrate such a thing as a plugin. But my original point stands that if one has a parse tree already just turning it into HTML is the EASY part... you could simply wrap Highlight.js fairly easily. (though you don't need it at all at that point, just the CSS files)

@joshgoebel
Copy link
Member

What else are " generic variable modifier"s supported on other than interfaces?

Are in and out the only modifiers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants