Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    languagesstyles
    2 Posts 2 Posters 3.0k Views 2 Watching
    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 Offline
      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 Offline
        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors