Comments (11)
This should now work fine in Atom - it will be some time however before github.com picks up the latest. I'll see what we can do to get that expedited.
from language-csharp.
@damieng we finally managed to get Microsoft's grammar play well with GitHub. Here is a pull request with a working demo on Github Lightshow Heroku App. #116 Hope our assistance could help GitHub continue being the best service for hosting open-source projects! 😹
from language-csharp.
Hey Andrew.
We've actually switched language-csharp over to an official Microsoft supplied grammar that has support for these alas github.com has not been able to upgrade to it yet as it uses some extensions the github highlighter does not support (named groups).
We're looking at whether we can manually or automatically change the grammar here so it can still work for github.com
from language-csharp.
Hello, Damien!
Could you please provide more info with examples describing what an unsupported named group is and how it should be replaced in order to support GitHub highlighters? Perhaps, the community and I can do all the routine work or write a script that will parse and fix all that stuff for you!
We love C# and we love GitHub, but we are quite disappointed with how current highlighter works. So we'll be glad to provide you any help we can 😸
from language-csharp.
@worldbeater I'm also disappointed (C# is my fave language). Our options right now are:
-
Go back to the old grammar and try and improve it in parallel with Microsoft's efforts. This was tricky in the past as the textmate grammar syntax is an unwieldy beast anyway. We'd probably want to fork this repo from the old one so Atom can keep using the Microsoft effort and we'd switch linguist over.
-
Figure out some kind of conversion between this and PCRE. I've tried doing this by hand and got nowhere fast. I suspect the older version of PCRE that GitHub supports might be missing the features we need entirely given my attempts.
-
Switch GitHub's linguist grammar for C# over to a textmate grammar - if somebody is maintaining one still.
-
Hold out for changes to linguist to support different syntax engines such as Oniguruma or tree-sitter.
from language-csharp.
Waiting for changes in GitHub internals can take time, so we can start working on existing C# TextMate bundle improvements. Some fixes already are here and here, other ones may not be so difficult to implement.
from language-csharp.
Careful pattern order, intelligent structure, and a little judicious repetition can all achieve the same effect as a named-group or a subroutine call. I've never needed these features in my grammars, ever.
I recently started work on a replacement JavaScript grammar for GitHub, which will include support for JSX and static Flow typing. I've barely spent much time on it and it's already showing improvement:
You'll see that what most users deem impossible without Oniguruma extensions are, in fact, possible without any extensions.
from language-csharp.
Figure out some kind of conversion between this and PCRE. I've tried doing this by hand and got nowhere fast. I suspect the older version of PCRE that GitHub supports might be missing the features we need entirely given my attempts.
@damieng Could you point to an example where these features were used? I don't know a single thing about C#, so I'm in the dark when it comes to how bad its highlighting is on GitHub...
from language-csharp.
I'm not saying that they're not possible without extensions - I'm saying that in order for us to switch to the official Microsoft-maintained C# grammar we'd need Oniguruma support or a reliable conversion.
I think if GitHub wants to continue to tap the grammars used in clients this is going to be more and more of a problem if they use those features.
Do you know what version of PCRE is available? The features being used appear to be named captures but my attempt at conversion was not successful when I tested it.
from language-csharp.
@damieng please check github-linguist/linguist#3291 (comment) (thanks a lot to John Gardner for providing info!) Perhaps, numbered groups instead of named groups can be used if (?&name)
captures are not working?
from language-csharp.
from language-csharp.
Related Issues (20)
- Some combination of braces, quotes and a comment containing the word "class" seems to invert "in string" state of highlighter
- `private` modifier on getter/setter not highlighted correctly HOT 1
- Some C# operator overloads breaking syntax highlighting after their appearance
- Stop taking over bash syntax. HOT 10
- Source code in strings confuses the parser
- Async Keyword Highlighting
- Parameters highlighting in constructors (Github)
- Single-line foreach breaks highlighter
- Update README, now that the @dotnet grammar is live
- Incorrect syntax highlighting when method name has prefix and argument has /* HOT 8
- Incorrect LINQ Syntax Highlighting HOT 5
- hola
- Failed to load a language-csharp package grammar HOT 1
- Failed to activate the language-csharp package HOT 1
- asp HOT 1
- C# syntax highlight glitch when using Tuple return HOT 4
- Failed to load a language-csharp package grammar HOT 3
- Add Razor support HOT 1
- Failed to load a language-csharp package grammar HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-csharp.