repo_info_extractor icon indicating copy to clipboard operation
repo_info_extractor copied to clipboard

`.cls` File Extension mapped to APEX language?

Open jimbrig opened this issue 1 year ago • 2 comments

In the languagedetection module's analyzer.go script line 116, the file extension .cls is currently mapped to the APEX Language by SalesForce which I do not believe is the optimal choice.

Speaking for myself, I have used the .cls file extension for Visual Basic Class Definitions with VBA applications.

However, I did look into the languages.yml file extensions configuration for linguist and it does apply "apex" for .cls also...


References:

jimbrig avatar Jun 18 '23 03:06 jimbrig

Thanks for the detailed explanation. In some cases, an extension belongs to multiple languages. That is why we introduced content-based language detection. Currently, it is used for .m, .pl, and .sql. If you can send me an example content for a .cls file for Visual Basic I can implement the content-based detection for .cls files.

peti2001 avatar Aug 23 '23 12:08 peti2001

I tried the language detection package we use github.com/src-d/enry/v2 but it couldn't recognize the code I added as an example: MyClass.cls:

Public Class Person
    Private m_Name As String
    Private m_Age As Integer
    
    Public Property Name() As String
        Get
            Return m_Name
        End Get
        Set(ByVal value As String)
            m_Name = value
        End Set
    End Property
    
    Public Property Age() As Integer
        Get
            Return m_Age
        End Get
        Set(ByVal value As Integer)
            m_Age = value
        End Set
    End Property
    
    Public Sub SayHello()
        MsgBox("Hello, my name is " & m_Name & " and I am " & m_Age & " years old.")
    End Sub
End Class

Is this code incorrect or maybe the package is outdated?

peti2001 avatar Aug 23 '23 18:08 peti2001