Community
    • Login

    JavaScript autocompletion function parameters not defined in javascript.xml

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 385 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.
    • BoltKeyB
      BoltKey
      last edited by BoltKey

      Other languages (like php) have function parameters defined in php.xml (in the autoCompletion directory) like

      <KeyWord name="array_push" func="yes">
      	<Overload retVal="int">
      		<Param name="array &amp;array"/>
      		<Param name="mixed var"/>
      		<Param name="[mixed ...]"/>
      	</Overload>
      </KeyWord>
      

      My javascript.xml only has keywords but not function parameters, like

      <KeyWord name="protected" />
      <KeyWord name="protocol" />
      <KeyWord name="prototype" />
      <KeyWord name="public" />
      <KeyWord name="push" />
      

      Is there a javascript.xml anywhere that includes function parameters for autocomplete?

      1 Reply Last reply Reply Quote 0
      • TroshinDVT
        TroshinDV
        last edited by

        @BoltKey said in JavaScript autocompletion function parameters not defined in javascript.xml:

        Is there a javascript.xml anywhere that includes function parameters for autocomplete?

        вы можете клонировать репозитарий https://github.com/notepad-plus-plus/notepad-plus-plus
        и отредактировать javascript.xml в директории:
        https://github.com/notepad-plus-plus/notepad-plus-plus/tree/master/PowerEditor/installer/APIs
        что-бы иметь возможности “autocompletion function parameters”.

        PeterJonesP 1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @TroshinDV
          last edited by

          @BoltKey said in JavaScript autocompletion function parameters not defined in javascript.xml:

          Is there a javascript.xml anywhere that includes function parameters for autocomplete?

          Not yet. Somebody would have to go through the effort of adding those, and submitting an issue and Pull Request to the codebase, to try to get that implemented.

          But as @TroshinDV says (translated)

          you can clone the repository https://github.com/notepad-plus-plus/notepad-plus-plus
          and edit the javascript.xml in the directory:
          https://github.com/notepad-plus-plus/notepad-plus-plus / tree / master / PowerEditor / installer / APIs
          to enable “autocompletion function parameters”.

          So that’s the way you would do it, if you wanted to contribute your solution to the entire userbase. Clone, edit, submit issue, submit pull request linked to that issue.

          For your own use, you don’t have the clone the repository. All you have to do is edit your local c:\program files\notepad++\autoCompletion\javascript.xml

          But again, until someone is willing to go through the extra effort involved to get it into the codebase, it won’t be available by default to the normal user. A few months back (7 months now!!! it might have felt like a slow year as it progressed, but looking back, it’s still disappearing), I finally decided that Perl needed someone’s effort; since no one else had stepped forward, I decided to do it. I downloaded Perl documentation that listed all of the builtin functions with their parameter options; then I used Notepad++'s regex search-and-replace to translate those into valid AutoComplete XML, then I made sure it worked in my local Notepad++, then I submitted the issue+PR (actually, I forgot to include an issue, which sometimes prevents the PR from being accepted, but I was fortunate). If someone followed a similar procedure for javascript, it could be made available to everyone.

          1 Reply Last reply Reply Quote 1
          • TroshinDVT
            TroshinDV
            last edited by TroshinDV

            @PeterJones said in JavaScript autocompletion function parameters not defined in javascript.xml:

            :

            These api-files can serve as a base for built-in help for language methods. If someone thread will fill them in and make the interface in the form of a tree and a text field.
            alt text
            And I would make a plugin with this interface.
            There is only one detail: not everyone understands English and it is desirable to distribute api files to directories with translations.
            Like “Api \ ru”, “Api \ fr”, etc.

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