Adding language to style configurator via langs.xml and stylers.xml



  • Hello,

    I was trying to add SystemVerilog to the permanent list of languages in the Style configurator. I successfully modified the

    stylers.xml – to add the various styles for the language
    langs.xml – to add the KeywordClass 's for the SystemVerilog Keywords

    in the AppData folder and can see the new language in the list of Languages when I open the Style Configurator.

    My only issue is that when I select a Style (like KEYWORD1 or KEYWORD2) that has associated keywords (as defined by KeywordClass ’ s in the langs.xml file) I get an error that says:

    systemverilog is not defined in NppParameters::getLangIDFromStr()

    I defined the KeywordClass 's in the langs.xml file as follows (only an excerpt):

    	<Language name="systemverilog" ext="sv" commentLine="//" commentStart="/*" commentEnd="*/">
    		<Keywords name="instre1">begin case  endconfig endfunction endgenerate endprogram </Keywords>
            <Keywords name="type1">alias always always_comb always_ff and assert while wor xnor xor</Keywords>
            <Keywords name="type2">bit buf bufif0 byte type typedef union unsigned var virtual void</Keywords>
        </Language>
    

    Then in stylers.xml I defined the KEYWORDS highlight to look at these classes with:

         <WordsStyle name="INSTRUCTION WORD" styleID="5" fgColor="93C763" bgColor="293134" fontName="" fontStyle="1" fontSize="" keywordClass="instre1"/>
         <WordsStyle name="KEYWORD1" styleID="6" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="0" fontSize="" keywordClass="type1"/>
         <WordsStyle name="KEYWORD2" styleID="7" fgColor="E0E2E4" bgColor="293134" fontName="" fontStyle="0" fontSize="" keywordClass="type2"/>
    

    But again whenever I select INSTRUCTION WORD, KEYWORD1, or KEYWORD2 in the style configurator I get an error that says

    systemverilog is not defined in NppParameters::getLangIDFromStr()

    Any help would be appreciated.



  • @A-Stod

    afaik, user defined languages don’t work with stylers and langs.xml.
    They reside in userDefineLang.xml.

    Cheers
    Claudia


Log in to reply