linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add `.slnx` to XML extensions

Open kasperk81 opened this issue 1 year ago • 7 comments

Description

Checklist:

  • [x] I am adding a new extension to a language.
    • [x] The new extension is used in hundreds of repositories on GitHub.com
      • Search results for each extension:
        • https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.slnx+solution
    • [x] I have included a real-world usage sample for all extensions added in this PR:
      • Sample source(s):
        • https://github.com/visose/Robots/blob/aa2be4ba40947b950b79d68fae3e22f32a0184c2/Robots.slnx
      • Sample license(s):
    • [ ] I have included a change to the heuristics to distinguish my language from others using the same extension.

Fix https://github.com/github-linguist/linguist/issues/7083

kasperk81 avatar Oct 09 '24 15:10 kasperk81

cc @visose fyi, i've used your slnx file as a sample for syntax highlighting support. https://github.com/visose/Robots/blob/aa2be4ba40947b950b79d68fae3e22f32a0184c2/Robots.slnx

kasperk81 avatar Oct 09 '24 15:10 kasperk81

fyi @rainersigwald @davkean (https://github.com/dotnet/msbuild/issues/1730#issuecomment-2402460144 it was simpler than i thought 😉)

kasperk81 avatar Oct 09 '24 15:10 kasperk81

@lildude ok, but can you tell me why? there is an existing .sln, i'm adding .slnx next to it https://github.com/github-linguist/linguist/tree/main/samples/Microsoft%20Visual%20Studio%20Solution this is from vs library open sourced last week https://github.com/microsoft/vs-solutionpersistence (handles both .sln and .slnx)

kasperk81 avatar Oct 14 '24 16:10 kasperk81

@lildude ok, but can you tell me why?

Sure... it's what you want 😉

Screenshot 2024-10-14 at 17 52 58

As you're adding the extension to the XML language entry, you're saying these files are XML and should be highlighted as XML and as such, the sample needs to go into the XML language directory. This is why the tests were failing.

lildude avatar Oct 14 '24 16:10 lildude

Ah, I didn't realize that the samples are structured per language, and "Microsoft Visual Studio Solution" is treated as a language. The new format, however, is based on the XML language. :)

kasperk81 avatar Oct 14 '24 17:10 kasperk81

You need to add this to the list of no-root-tag entries in the test too:

https://github.com/github-linguist/linguist/blob/f164d13fa618023ecf2d8f2ed9a6ce5fae731346/test/test_strategies.rb#L176-L194

This will exclude the sample from the XML strategy testing which is what is failing here (we're not using the strategy to detect the language).

lildude avatar Oct 14 '24 17:10 lildude

@lildude the search indicator is only going to improve significantly until https://github.com/dotnet/sdk/issues/40913 is resolved (support for slnx in dotnet sdk which is scheduled for .NET 9 release 2 which usually happen at the end of Feb). Rest assured, it is happening; the whole community was waiting for new solution format for a very long time https://github.com/dotnet/msbuild/issues/1730 and VS has just added its support (as a preview feature).

kasperk81 avatar Oct 14 '24 18:10 kasperk81

Hello @lildude just wondering if you and your team had had the chance of taking a look into this. .NET 9.0.200 has been out now and the use of .slnx files has increased in popularity

edvilme avatar Feb 26 '25 17:02 edvilme

Hello @lildude just wondering if you and your team had had the chance of taking a look into this.

No. I only review pending popularity PRs when I make a new release which happens approximately every 3-4 months.

lildude avatar Feb 27 '25 08:02 lildude

@edvilme i hope visual studio will take this out of preview so more people can join. today everyone in a team has to enable preview feature to even get slnx open the solution in vs which i think is holding back the masses

kasperk81 avatar Feb 27 '25 12:02 kasperk81

numbers are steadily growing. what's the popularity criteria of adding an extension to existing language, with no conflict? is it a fixed value?

kasperk81 avatar May 05 '25 06:05 kasperk81

i hope visual studio will take this out of preview so more people can join.

VS 2022 17.14 has taken it out of preview.

kasperk81 avatar May 19 '25 22:05 kasperk81