Community
    • Login

    Custom AutoComplete file for XML language

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    13 Posts 5 Posters 11.3k 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.
    • Jim DaileyJ
      Jim Dailey
      last edited by

      @Cronos-Umbra
      You post looks like it includes some double quotation marks that are not in the ASCII character set. That may be the problem. Try this instead:

      <?xml version="1.0" encoding="Windows-1252" ?>
      <NotepadPlus>
      <AutoComplete language="C++">
      <Environment ignoreCase="no" startFunc="(" stopFunc=")" paramSeparator="," terminal=";" additionalWordChar = "."/>
      <KeyWord name="abs" func="yes">
      <Overload retVal="int" descr="Returns absolute value of given integer">
      <Param name="int number" />
      </Overload>
      </KeyWord>
      </AutoComplete>
      </NotepadPlus>
      
      1 Reply Last reply Reply Quote 0
      • Cronos UmbraC
        Cronos Umbra
        last edited by Cronos Umbra

        Did not work.

        I add a new XML with this content.
        C:\Program Files (x86)\Notepad++\plugins\APIs\my.xml

        The tool does not display in the list of languages.

        Can someone help me?

        I’m wanting to stop using noteped ++
        Is there a plugin that will help me with autocomplete?

        Claudia FrankC 1 Reply Last reply Reply Quote 0
        • Claudia FrankC
          Claudia Frank @Cronos Umbra
          last edited by

          @Cronos-Umbra

          do yu really have a language called my?
          C:\Program Files (x86)\Notepad++\plugins\APIs\ my.xml

          The xml name needs to match the language otherwise npp can’t know which xml needs to be loaded.

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 0
          • Cronos UmbraC
            Cronos Umbra
            last edited by

            @Claudia-Frank said:

            O nome xml precisa corresponder ao idioma, caso contrário o npp não pode saber qual xml precisa ser carregado.

            I want to create an XML to be able to configure any format.

            That would be the content.

            https://docs.polserver.com/pol099/index.php

            Claudia FrankC 1 Reply Last reply Reply Quote 0
            • Claudia FrankC
              Claudia Frank @Cronos Umbra
              last edited by

              @Cronos-Umbra

              I don’t understand you (Eu não entendo você).
              One xml which can be used by any language(Um XML que pode ser utilizado por qualquer linguagem)?
              If so, this doesn’t work (Se assim for, isso não funciona).

              Cheers
              Claudia

              1 Reply Last reply Reply Quote 0
              • Cronos UmbraC
                Cronos Umbra
                last edited by

                I noticed that does not work, thank you for your help.
                I created a fortran.xml and I will test it when I can, modified for my language.

                Do you know if there is any way to change the colors of keywords that exist in the text to a fortran.xml format for example?

                If you have some plugin I would like it.

                1 Reply Last reply Reply Quote 0
                • Cronos UmbraC
                  Cronos Umbra
                  last edited by

                  Can someone explain to me how to put a file userDefineLang.xml?

                  Someone could tell me step by step, what should I do to make it work?

                  Or send me some files ready, and show me the steps of how it should work?

                  Claudia FrankC 1 Reply Last reply Reply Quote 0
                  • Claudia FrankC
                    Claudia Frank @Cronos Umbra
                    last edited by

                    @Cronos-Umbra

                    Step 1: define the new language
                    Menu Language->Define your language…
                    open tab Keywords Lists
                    press Styker in 1st group
                    choose a foreground and background color if needed
                    put the word “testkeyword” (without quotes) into the textbox of 1st group
                    press Save As… button
                    put the name “test” in (without quotes)
                    check menu Language, you should see the language now

                    Step 2: define API file
                    Open a new file - menu File->New
                    Put the following content into the file

                    <?xml version="1.0" encoding="Windows-1252" ?>
                    <NotepadPlus>
                        <AutoComplete language="test">
                            <Environment ignoreCase="yes" startFunc="(" stopFunc=")" paramSeparator="," terminal=";" />
                            <KeyWord name="testkeyword" func="yes">
                                <Overload retVal="int" >
                                    <Param name="int i" />
                                    <Param name="int j" />
                                </Overload>
                            </KeyWord>
                        </AutoComplete>
                    </NotepadPlus>
                    

                    save it as C:\Program Files\Notepad++\plugins\APIs\test.xml

                    Step 3: Check Settings->Preferences->Atuo-Completion it should look like this

                    Step 4: use it
                    open a new file - menu File->New
                    check language - menu Language->test
                    type the word “testkeyword” (without quotes)
                    you should see the word in a list, use tab key to complete
                    press key “(” (without quotes) and you should see the hints

                    Cheers
                    Claudia

                    Emanuele AtzaE 1 Reply Last reply Reply Quote 2
                    • Cronos UmbraC
                      Cronos Umbra
                      last edited by

                      @Claudia-Frank said:

                      Claudia

                      Claudia :********************************** S2

                      1 Reply Last reply Reply Quote 0
                      • Emanuele AtzaE
                        Emanuele Atza @Claudia Frank
                        last edited by

                        @Claudia-Frank

                        Sorry forthe really late post

                        I follow what you have done but doesn’t work…
                        N++ doesn’t recognize the fuction and doesn’t show the hints

                        this is the fuction definition

                        <KeyWord name=“TestFuctionWord” func=“yes” />
                        <Overload retVal=“int” >
                        <Param name=“int Input” />
                        </Overload>
                        </KeyWord>

                        it recognize enerything else like number, operator, keyword, comment

                        and for Autocompleting the nameFuction?

                        Sorry for the bad english

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