Git Product home page Git Product logo

sourcemod-npp-docs's Introduction

Docs screenshot

SourceMod-Npp-Docs

GitHub release Donate
Here the new API docs with all (I hope) function, define, enum, methodmap and fixed xml structure. Docs were generated by reworked generator plugin.

Plugin

Features:

  • Generate auto-completion files.
  • Generate inline docs (sourcemod.xml).
  • Supports SourceMod 1.7 API specifics.

Changes:

  • Added better way to detect commentary.
  • Added methods docs.
  • Added more console stats.
  • Added xml filter.
  • Code optimization.
  • Detects all function params.
  • Detects enum & define correctly.
  • Detects methodmap selection.
  • Detects typeset.
  • Makes keywords to pop up correctly.

Server command:

sm_makedocs - starts to parse SourceMod includes and generates output files.

Notepad++

SourceMod docs files are located in the plugins\NPP\ subfolder of sourcemod folder.
Notepad++ API files are located in the plugins\APIs\ subfolder of the Notepad++ installation folder.
Notepad++ API v7.6+ files are located in the autoCompletion\ subfolder of the Notepad++ installation folder.

Note: Use sm_makedocs command to generate docs or get them from the latest release).

Highlights

Use preset

A preset has all the setting ready to developing your plugin. To load preset go to Notepd++ -> Lanuguage -> Define your language -> Import and select userDefineLang.xml from SourceMod docs or copy userDefineLang.xml to <USER_NAME>\AppData\Roaming\Notepad++\

Define you own preset

If you want to configurate user defined languge or update keywords, check plugins\NPP\ folder for NPP_STYLE files. These files contain defining the keyword lists for the SourcePawn language. Open one of those files, select keywords and copy. Go to Notepd++ -> Lanuguage -> Define your language... Select you own language or create new and past keywords to the Keywords Lists group. Do it for other groups too. More information here: UDL 2.0. Docs screenshot

Note: It's important to define your language as sourcemod

Autocompletion

Copy sourcemod.xml file from SourceMod docs folder to Notepad++ API folder. Done! Due to Notepad++ Issues I highly recommend using 3P plugin for autocompletion feature. Otherwise, you can use default Notepad++ autocompletion feature (don't forget to read about Issues). The completion list can be triggered automatically as you type, via settings in Settings -> Preferences -> Auto-Completion: Auto-Completion is enabled by a checkbox. Additionally there is a setting "From X th character", accepting a the minimum length of a prefix needed before the completion list is shown (some people like 2, some 3, some 4...); and, there is a setting to specify which candidates should be used: words, functions, or both.

Note: Press TAB to fast autocompletion.
Note: To watch docs again place the cursor between ( ) characters and press CTRL+SHIFT+SPACE hotkeys

Useful URLs

NppExec Script and Console Hightlight

Methodmap notes

Docs screenshot
These strings are not actual SourceMod functions. The purpose of these strings is to provide access to documentation showing the methodmap structure. Notepad++ don't reacts on dots in names (exp: fileArray.GetString) and docs not shown, so . were separated with _ symbol.

Note: If you want to use string as code you must remove prefix and separate _ with .
Note: If you want to watch docs you must do the vice versa.

Prefix structure:

MM (Methodmap) type With tag Without tag
C (Constructor) MM_%1_%2_C_%3 MM_%1_C_%3
M (Method) MM_%1_%2_M_%3 MM_%1_M_%3
P (Property) MM_%1_%2_P_%3 MM_%1_P_%3

Where: %1 - Class name, %2 - Tag name, %3 - Real method/property/constructor name.

Note: Prefix - a string before %3 param (e.g., MM_ArrayList_Handle_M_GetArray).

Examples:

MM (Methodmap) type With tag Without tag
C (Constructor) MM_Menu_Handle_C_Menu Always has the tag
M (Method) MM_Menu_Handle_M_ToPanel MM_AdminId_M_BindIdentity
P (Property) MM_Menu_Handle_P_ItemCount MM_AdminId_P_ImmunityLevel

Editing string to watch docs:
Method: ToPanel()
Prefix: MM_Menu_Handle_M_
Result: MM_Menu_Handle_M_ToPanel

Editing string to use as code:
Docs string: MM_AdminId_P_ImmunityLevel
Removes prefix: MM_AdminId_M_
Result: my_code.ImmunityLevel()

Issues

The following Issues were reported on notepad-plus-plus repository.

  1. Code-complete-file defined with ignoreCase="yes" input makes autocomplete work incorrectly.
  2. Code-complete-file defined with ignoreCase="no" input makes pop up docs work incorrectly for functions with a similar names (e.g., ReplaceStringEx hint docs from ReplaceString).

By deafault code-complete-file defined withignoreCase="yes" input, because it did less harm. So, keep in mind about issues #1.

Note: For changing ignoreCase attribute edit sourcemod.xml file.

Credits:

  • Thanks @MCPAN for original plugin.

Donation

My cat wants a new toy! I try to make quality and beautiful toys for my beloved cat. I create toys in my spare time but sometimes I can step into a tangle and get confused! Oops! It takes time to get out! When the toy is ready I give it to the cat, the GitHub cat and the community can also play with it. So if you enjoy my toys and want to thank me for my work, you can send any amount. All money will be spent on milk! Donate ๐Ÿพ

sourcemod-npp-docs's People

Contributors

razieil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sourcemod-npp-docs's Issues

sdktools_trace.inc parse are not complete

native void TR_EnumerateEntities(const float pos[3],
                                 const float vec[3],
                                 int mask,
                                 RayType rtype,
                                 TraceEntityEnumerator enumerator,
                                 any data=0);

Parameter TraceEntityEnumerator enumerator causes the parser to stop read file below this line.

I can't see parameters list

Hi,

after N++ update I can't see tooltip about function arguments (I see function names autocompletion only).

Do you know what could go wrong?

Here is my settings:
sett

Thanks you.

it looks horrible on Dark Skin

Everybody in the world knows that developers works on BLACK BACKGROUND and WHITE TEXT.
Why in the world would somebody make an inverted one????

White background completely breaks your eyes. Please, take a look at my screenshot. It looks horrible.
Nice work but the only reason I can't use is because those white highlights.

Screenshot: https://prnt.sc/xb9rf2

Autocompletion case insensitive

Hi,

thanks a much for such handy additions!

I have a question on improving autocomplete feature:

When I type "PL" => I have a tip "PLATFORM_MAX_PATH"
but, when I typed "PLA" => this tip is disappear.

Can it be fixed?

Can you also make this feature accept "pl" (case insensitive) to show "PLATFORM_MAX_PATH" as well?

(Without using 3P plugin, of course, because for me it cause crash sometimes, and other issues like intercepting input when I don't need it.)

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.