Trying to import my own language definition/syntax highlighter



  • I’ve got N++ V7.6.3 (just checked, there is no updates available, so I’m hoping I’m current)

    I play a game that has it’s own scripting language. Some years back I wrote and used a syntax highlighter for this language (CRPL). I’ve returned to play some ore and write some more scripts, so after a week or so I wanted to import my syntax highlighter again. My memory is fuzzy, but I used the written-down directions

    Languages -> define your own language, -> import and then point to the xml file?

    This is how my file looks:
    https://i.imgur.com/jcKCA6O.png (start)
    https://i.imgur.com/Fd35GgS.png (end)

    sorry, I’m not very familiar with this forum and how to post/format things.

    Anyway, I just get a brief popup from N++ saying “import failed”

    https://i.imgur.com/zxu2Rg3.png

    So… any ideas where I am going off the rails?

    Thansk in advance.



  • welcome to the notepad++ community, @Karsten75

    the file you are trying to import to udl is an autoCompletion xml file, not an user defined language (udl) xml file.

    did you ever export your udl on your old setup to a specific xml file ?
    if not: do you have a copy of your old userDefineLang.xml file which contained CRPL back then ? (search your whole pc for a file of that name)

    please also provide us with your debug info, by going to the notepad++ menu ? > debug info... > copy debug info into clipboard and pasting it here.
    this will help to find your specific 7.6.3 folder locations, if you are able to find an old udl export, or your old userDefineLang.xml.

    ps: notepad++ 7.6.4 is the current version, but you will not see it as an auto update for technical reasons.
    auto update is provisionally scheduled after the upcoming 7.6.5 release, if no relevant issues are found.



  • @Karsten75
    as Meta Chuh has say the file you are trying to import is not a style xml file.
    i have made a syntax highlighter by myself today and look like this:

    <NotepadPlus>
    <UserLang name=“ZeroScript” ext=“zs” udlVersion=“2.1”>
    <Settings>
    <Global caseIgnored=“no” allowFoldOfComments=“yes” foldCompact=“no” forcePureLC=“0” decimalSeparator=“0” />
    <Prefix Keywords1=“no” Keywords2=“no” Keywords3=“no” Keywords4=“no” Keywords5=“no” Keywords6=“no” Keywords7=“no” Keywords8=“no” />
    </Settings>
    <KeywordLists>
    <Keywords name=“Comments”>00// 00# 01 02 03/* 04*/</Keywords>
    <Keywords name=“Numbers, prefix1”></Keywords>
    <Keywords name=“Numbers, prefix2”></Keywords>
    <Keywords name=“Numbers, extras1”></Keywords>
    <Keywords name=“Numbers, extras2”></Keywords>
    <Keywords name=“Numbers, suffix1”></Keywords>
    <Keywords name=“Numbers, suffix2”></Keywords>
    <Keywords name=“Numbers, range”></Keywords>


    <Keywords name=“Operators2”>- +</Keywords>
    <Keywords name=“Folders in code1, open”></Keywords>
    <Keywords name=“Folders in code1, middle”></Keywords>
    <Keywords name=“Folders in code1, close”></Keywords>
    <Keywords name=“Folders in code2, open”></Keywords>
    <Keywords name=“Folders in code2, middle”></Keywords>
    <Keywords name=“Folders in code2, close”></Keywords>
    <Keywords name=“Folders in comment, open”></Keywords>
    <Keywords name=“Folders in comment, middle”></Keywords>
    <Keywords name=“Folders in comment, close”></Keywords>
    <Keywords name=“Keywords1”>null</Keywords>
    <Keywords name=“Keywords2”>recipes.addShapeless recipes.addShaped recipes.remove furnace.addRecipe furnace.removeRecipe print</Keywords>
    <Keywords name=“Keywords3”>loottweaker.vanilla.loot.LootTables loottweaker.vanilla.loot.LootTable loottweaker.vanilla.loot.LootPool val .getPool Main.removeEntry Main.addItemEntry LootTables.getTable .addPool</Keywords>
    <Keywords name=“Keywords4”></Keywords>
    <Keywords name=“Keywords5”></Keywords>
    <Keywords name=“Keywords6”></Keywords>
    <Keywords name=“Keywords7”></Keywords>
    <Keywords name=“Keywords8”></Keywords>
    <Keywords name=“Delimiters”>00( 01 02) 03 04 05 06" 07 08" 09< 10 11> 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
    </KeywordLists>
    <Styles>
    <WordsStyle name=“DEFAULT” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“COMMENTS” fgColor=“0080FF” bgColor=“FFFFFF” fontName=“Calibri” fontStyle=“2” nesting=“117701887” />
    <WordsStyle name=“LINE COMMENTS” fgColor=“0000FF” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“117701887” />
    <WordsStyle name=“NUMBERS” fgColor=“FF8000” bgColor=“FFFFFF” fontName=“Times New Roman” fontStyle=“0” nesting=“0” />
    <WordsStyle name=“KEYWORDS1” fgColor=“80FF00” bgColor=“FFFFFF” fontName=“Times New Roman” fontStyle=“2” nesting=“0” />
    <WordsStyle name=“KEYWORDS2” fgColor=“FF00FF” bgColor=“FFFFFF” fontName="" fontStyle=“2” nesting=“0” />
    <WordsStyle name=“KEYWORDS3” fgColor=“FF00FF” bgColor=“FFFFFF” fontName=“Calibri” fontStyle=“2” nesting=“0” />
    <WordsStyle name=“KEYWORDS4” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“KEYWORDS5” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“KEYWORDS6” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“KEYWORDS7” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“KEYWORDS8” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“OPERATORS” fgColor=“FF0000” bgColor=“FFFFFF” fontName=“Times New Roman” fontStyle=“1” nesting=“0” />
    <WordsStyle name=“FOLDER IN CODE1” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“FOLDER IN CODE2” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“FOLDER IN COMMENT” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“DELIMITERS1” fgColor=“BB44B8” bgColor=“FFFFFF” fontName=“Times New Roman” fontStyle=“0” nesting=“117441791” />
    <WordsStyle name=“DELIMITERS2” fgColor=“80FFFF” bgColor=“FFFFFF” fontName=“Times New Roman” fontStyle=“1” nesting=“2” />
    <WordsStyle name=“DELIMITERS3” fgColor=“FF8040” bgColor=“FFFFFF” fontName=“Times New Roman” fontStyle=“0” nesting=“16777216” />
    <WordsStyle name=“DELIMITERS4” fgColor=“34CB43” bgColor=“FFFFFF” fontName=“Times New Roman” fontStyle=“0” nesting=“117441791” />
    <WordsStyle name=“DELIMITERS5” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“DELIMITERS6” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“DELIMITERS7” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    <WordsStyle name=“DELIMITERS8” fgColor=“000000” bgColor=“FFFFFF” fontName="" fontStyle=“0” nesting=“0” />
    </Styles>
    </UserLang>
    </NotepadPlus>

    and i’m trying my best to make autocomplete work but seems is impossible T.T

    sorryfor my badenglish



  • @Emanuele-Atza

    and i’m trying my best to make autocomplete work but seems is impossible T.T

    easiest way to test and creating your own autocomplete file, is by first duplicating any autoCompletion file, e.g.: %ProgramFiles(x86)%\Notepad++\autoCompletion\php.xml.
    (example path for an installed 32 bit notepad++ version 7.6.4)
    then rename this duplicated autocompletion file to ZeroScript.xml, restart notepad++ and start testing how it works with php syntax.
    then start replacing the autocompletion parts from ZeroScript.xml with everything you need for ZeroScript.



  • I am so sorry. Thank you all for the helpful replies. I could not find where I asked these questions, and I also didn’t get a notification by email. SO I never even knew that the question was answered.

    I’m still living in the dark ages of SMF forums :(

    I’m just going to sit here and wait for the 1,200 seconds before I can post this :( :( Sucks to be a newb



  • Hey, thanks for the upvotes, now I think I can post freely! ;)

    I’ll find out in a few seconds when I post my hilarious finding. :)


Log in to reply