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

[C#] Expression-bodied methods are not parsed correctly #1496

Closed
rolfbjarne opened this issue Apr 9, 2018 · 4 comments · Fixed by #1497
Closed

[C#] Expression-bodied methods are not parsed correctly #1496

rolfbjarne opened this issue Apr 9, 2018 · 4 comments · Fixed by #1497

Comments

@rolfbjarne
Copy link
Contributor

See screenshot:

screenshot 2018-04-09 10 19 14

The expression body seems to prevent the syntax highlighting from detecting the end of the fenced code block.

Commenting out the constructor yields expected results:

screenshot 2018-04-09 10 20 04

I'm currently using a locally cloned version of the C# sublime syntax file (992c9b0)

@keith-hall
Copy link
Collaborator

Which syntax are you using to write your Markdown in? I'm guessing not a locally cloned version of the Markdown syntax from this PR #1274?

@rolfbjarne
Copy link
Contributor Author

I don't quite understand the question.

I'm using the tip of master as of a few minutes ago.

@keith-hall
Copy link
Collaborator

No problem, I'll try to explain better. You are writing fenced code blocks that contain C# code in a Markdown file. Probably it is a bug in the Markdown syntax you are using. If you were using the Markdown syntax from this repo, it wouldn't highlight the C# code at all. If you were using the Markdown syntax from the PR I referenced, it would work fine. So probably you need to report the bug elsewhere (i.e. on the relevant issues list for the Markdown syntax highlighting package you are using). Said syntax should probably make use of embed/escape actions as per the referenced PR, or use with_prototype to detect the end of the code fence, otherwise the problem you described will occur. Making changes to the C# syntax in an attempt to work around some third party package bug isn't desirable (to me at least - I contribute quite a lot to the C# and Markdown syntax definitions on this repo).

@keith-hall
Copy link
Collaborator

Sorry, I was concentrating on the wrong part of your issue... I'll see if I can make a fix so that the C# syntax will recognize expression bodied methods when used on a constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants