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) Reference path in inheritance breaks highlighting #1947

Closed
svd-sea opened this issue Jan 22, 2019 · 6 comments · Fixed by #2378
Closed

(csharp) Reference path in inheritance breaks highlighting #1947

svd-sea opened this issue Jan 22, 2019 · 6 comments · Fixed by #2378
Labels
bug good first issue Should be easier for first time contributors help welcome Could use help from community language

Comments

@svd-sea
Copy link

svd-sea commented Jan 22, 2019

The following snippet breaks the highlighting:

public class AgentTryout : System.Windows.Forms.Form { }

without reference path, it works as expected:

public class AgentTryout : Form { }

@joshgoebel
Copy link
Member

What are you expecting that "System.Windows.Forms.Form" is a single title, or 4 titles separated by .s?

@joshgoebel joshgoebel added good first issue Should be easier for first time contributors bug help welcome Could use help from community labels Oct 7, 2019
@joshgoebel joshgoebel changed the title C# reference path in inheritance breaks highlighting [csharp] Reference path in inheritance breaks highlighting Oct 7, 2019
@joshgoebel
Copy link
Member

This is because we don't think TITLEs can contain .s... or it could be that the space between them can contain dots and you have 4 titles, hence my question.

{
        beginKeywords: 'class interface', end: /[{;=]/,
        illegal: /[^\s:,]/,
        contains: [
          hljs.TITLE_MODE,
          hljs.C_LINE_COMMENT_MODE,
          hljs.C_BLOCK_COMMENT_MODE
        ]
      },

@joshgoebel joshgoebel changed the title [csharp] Reference path in inheritance breaks highlighting (csharp) Reference path in inheritance breaks highlighting Oct 13, 2019
@xp44mm
Copy link
Contributor

xp44mm commented Oct 30, 2019

the class AgentTryout inherit from class System.Windows.Forms.Form. : represents inherit.

@xp44mm
Copy link
Contributor

xp44mm commented Oct 30, 2019

What are you expecting that "System.Windows.Forms.Form" is a single title, or 4 titles separated by .s?
the . same as javaScript.

@joshgoebel
Copy link
Member

I'd think a single title... I think all the .s being different colors would be annoying.

@svd-sea
Copy link
Author

svd-sea commented Oct 30, 2019

Sry for the late response. Maybe an example will help to clarify what the problem is. Here is my small quick and dirty test code: https://jsfiddle.net/sn5kd4ob/

The reference path breaks/disables the highlighting

joshgoebel added a commit to joshgoebel/highlight.js that referenced this issue Jan 31, 2020
joshgoebel added a commit that referenced this issue Feb 6, 2020
* enh(csharp) add generic modifiers
* enh(csharp) Allow reference path in class inheritance lists. Closes #1947.
* enh(csharp) Support `where` keyword as class constraint
taufik-nurrohman pushed a commit to taufik-nurrohman/highlight.js that referenced this issue Feb 18, 2020
…lightjs#2378)

* enh(csharp) add generic modifiers
* enh(csharp) Allow reference path in class inheritance lists. Closes highlightjs#1947.
* enh(csharp) Support `where` keyword as class constraint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Should be easier for first time contributors help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants