Auto Language detection via Hint



  • is there some feature for detecting the language settings to choice NOT based on file extension?

    i want something like… scan the first 3 lines, and look for a specific string marker and then parse it for a language identifier

    eg. in C languages
    /*
    n+±lang: .C
    */



  • Hi AJ Baxter,

    what you can do is writing a python script which can do it.
    Something like

    for i in range(1,3):
        identifier = editor.getLine(i)
        if identifier == 'something to compare':
            notepad.setLangType(LANGTYPE.CPP)
            ...
    

    If you know how it can be identified and you are willing to go this way let me know.
    Btw. what needs to be done, reagrding python script plugin installation and creation
    of script can you read here.

    Cheers
    Claudia


Log in to reply