JavaScript autocompletion function parameters not defined in javascript.xml
-
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 &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?
-
@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”. -
@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.
-
@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.
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.