• Login
Community
  • Login

Custom AutoComplete file for XML language

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
13 Posts 5 Posters 11.4k 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.
  • J
    Jim Dailey
    last edited by Jan 9, 2017, 4:44 PM

    @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
    • C
      Cronos Umbra
      last edited by Cronos Umbra Jan 9, 2017, 5:48 PM Jan 9, 2017, 5:46 PM

      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?

      C 1 Reply Last reply Jan 9, 2017, 6:39 PM Reply Quote 0
      • C
        Claudia Frank @Cronos Umbra
        last edited by Jan 9, 2017, 6:39 PM

        @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
        • C
          Cronos Umbra
          last edited by Jan 9, 2017, 7:01 PM

          @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

          C 1 Reply Last reply Jan 9, 2017, 7:27 PM Reply Quote 0
          • C
            Claudia Frank @Cronos Umbra
            last edited by Jan 9, 2017, 7:27 PM

            @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
            • C
              Cronos Umbra
              last edited by Jan 9, 2017, 8:03 PM

              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
              • C
                Cronos Umbra
                last edited by Jan 9, 2017, 9:13 PM

                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?

                C 1 Reply Last reply Jan 9, 2017, 11:26 PM Reply Quote 0
                • C
                  Claudia Frank @Cronos Umbra
                  last edited by Jan 9, 2017, 11:26 PM

                  @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

                  E 1 Reply Last reply Mar 23, 2019, 12:03 PM Reply Quote 2
                  • C
                    Cronos Umbra
                    last edited by Jan 10, 2017, 12:05 AM

                    @Claudia-Frank said:

                    Claudia

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

                    1 Reply Last reply Reply Quote 0
                    • E
                      Emanuele Atza @Claudia Frank
                      last edited by Mar 23, 2019, 12:03 PM

                      @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