Add `.slnx` to XML extensions
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
- Search results for each extension:
- [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):
- Sample source(s):
- [ ] I have included a change to the heuristics to distinguish my language from others using the same extension.
- [x] The new extension is used in hundreds of repositories on GitHub.com
Fix https://github.com/github-linguist/linguist/issues/7083
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
fyi @rainersigwald @davkean (https://github.com/dotnet/msbuild/issues/1730#issuecomment-2402460144 it was simpler than i thought 😉)
@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)
@lildude ok, but can you tell me why?
Sure... it's what you want 😉
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.
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. :)
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 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).
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
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.
@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
numbers are steadily growing. what's the popularity criteria of adding an extension to existing language, with no conflict? is it a fixed value?
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.