Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    languagesstyles
    2 Posts 2 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A StodA
      A Stod
      last edited by

      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.

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @A Stod
        last edited by

        @A-Stod

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

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors