Code Monkey home page Code Monkey logo

Comments (11)

damieng avatar damieng commented on August 17, 2024 3

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.

worldbeater avatar worldbeater commented on August 17, 2024 2

@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.

damieng avatar damieng commented on August 17, 2024

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.

worldbeater avatar worldbeater commented on August 17, 2024

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.

damieng avatar damieng commented on August 17, 2024

@worldbeater I'm also disappointed (C# is my fave language). Our options right now are:

  1. 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.

  2. 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.

  3. Switch GitHub's linguist grammar for C# over to a textmate grammar - if somebody is maintaining one still.

  4. Hold out for changes to linguist to support different syntax engines such as Oniguruma or tree-sitter.

from language-csharp.

worldbeater avatar worldbeater commented on August 17, 2024

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.

Alhadis avatar Alhadis commented on August 17, 2024

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.

Alhadis avatar Alhadis commented on August 17, 2024

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.

damieng avatar damieng commented on August 17, 2024

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.

worldbeater avatar worldbeater commented on August 17, 2024

@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.

damieng avatar damieng commented on August 17, 2024

from language-csharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.