C# file incorrectly marked as Smalltalk #5636
-
I have this file in my repo that's being marked as Smalltalk instead of C#. Why is that? I understand that the file in question is very strange and certainly not idiomatic C# (I have a particular strange use-case in mind); I'm just wondering what in particular is causing the misidentification. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It'll be because the final step in the detection process, the classifier, has determined the content looks more like SmallTalk than C#. This is quite common for small files as there's less likely to be anything in the files that match the samples used to train the classifier. So why did we get this far? It's because both languages share the The only solution is to use an override to force the language, use a C# namespace (so the heuristic catches it) or leave it to the classifier if you plan on adding more to the file; the more content in the file, the more likely the classifier will get it right. |
Beta Was this translation helpful? Give feedback.
It'll be because the final step in the detection process, the classifier, has determined the content looks more like SmallTalk than C#. This is quite common for small files as there's less likely to be anything in the files that match the samples used to train the classifier.
So why did we get this far? It's because both languages share the
.cs
extension and your files content didn't match the heuristic we have to try and differentiate the languages so things fell through to the classifier.The only solution is to use an override to force the language, use a C# namespace (so the heuristic catches it) or leave it to the classifier if you plan on adding more to the file; the more content in…