CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
Johnson_boy - 12.05.2014
Removed
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
brent94 - 13.05.2014
This will come in handy. Thanks for the release.
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
iZN - 13.05.2014
Some great work, this would definitely going to get handy for me as I use Sublime Text.
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
Bews - 20.05.2014
Maybe it just me, but I have some functions and defines missing in the output (for ex. Create3DTextLabel). NPC include seems to be ignored completely (yes I have #include <a_npc>).
This is almost full list of missing things:
Code:
@receivepacket @receivestring Create3DTextLabel CreatePlayer3DTextLabel EOF GetDistanceFromMeToPoint GetMyPos GetMyFacingAngle GetPlayerArmedWeapon OnClientMessage OnNPCConnect OnNPCDisconnect OnNPCEnterVehicle OnNPCExitVehicle OnNPCModeExit OnNPCModeInit OnNPCSpawn OnPlayerEditObject OnPlayerEditAttachedObject OnRecordingPlaybackEnd PauseRecordingPlayback ResumeRecordingPlayback SPECIAL_ACTION_CUFFED SendChat SendCommand SetMyFacingAngle SetMyPos StartRecordingPlayback StopRecordingPlayback _players_included TEXT_DRAW_FONT_SPRITE_DRAW TEXT_DRAW_FONT_MODEL_PREVIEW BULLET_HIT_TYPE_NONE BULLET_HIT_TYPE_PLAYER BULLET_HIT_TYPE_VEHICLE BULLET_HIT_TYPE_OBJECT BULLET_HIT_TYPE_PLAYER_OBJECT SPECIAL_ACTION_CARRY ER_DBACCESS_DENIED_ERROR ER_ACCESS_DENIED_ERROR ER_UNKNOWN_TABLE ER_SYNTAX_ERROR CR_SERVER_GONE_ERROR CR_SERVER_LOST CR_COMMAND_OUT_OF_SYNC CR_SERVER_LOST_EXTENDED
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
Johnson_boy - 20.05.2014
Quote:
Originally Posted by Bews
Maybe it just me, but I have some functions and defines missing in the output (for ex. Create3DTextLabel). NPC include seems to be ignored completely (yes I have #include <a_npc>).
This is almost full list of missing things:
Code:
@receivepacket @receivestring Create3DTextLabel CreatePlayer3DTextLabel EOF GetDistanceFromMeToPoint GetMyPos GetMyFacingAngle GetPlayerArmedWeapon OnClientMessage OnNPCConnect OnNPCDisconnect OnNPCEnterVehicle OnNPCExitVehicle OnNPCModeExit OnNPCModeInit OnNPCSpawn OnPlayerEditObject OnPlayerEditAttachedObject OnRecordingPlaybackEnd PauseRecordingPlayback ResumeRecordingPlayback SPECIAL_ACTION_CUFFED SendChat SendCommand SetMyFacingAngle SetMyPos StartRecordingPlayback StopRecordingPlayback _players_included TEXT_DRAW_FONT_SPRITE_DRAW TEXT_DRAW_FONT_MODEL_PREVIEW BULLET_HIT_TYPE_NONE BULLET_HIT_TYPE_PLAYER BULLET_HIT_TYPE_VEHICLE BULLET_HIT_TYPE_OBJECT BULLET_HIT_TYPE_PLAYER_OBJECT SPECIAL_ACTION_CARRY ER_DBACCESS_DENIED_ERROR ER_ACCESS_DENIED_ERROR ER_UNKNOWN_TABLE ER_SYNTAX_ERROR CR_SERVER_GONE_ERROR CR_SERVER_LOST CR_COMMAND_OUT_OF_SYNC CR_SERVER_LOST_EXTENDED
|
I had a look into it, and the regular expression did indeed contain an error, resulting in those 4 first functions being skipped. That bug is now fixed.
However, I was unable to reproduce the issue you described with the npc file. I included a_npc in a bare gamemode, and all the npc functions were correctly parsed and written to the output file. I am relatively sure I didn't make any changes regarding that in the update, but you could try with the latest version, and see if the functions are still missing.
As to parsing the defines, it is not currently possible, because the defines no longer exists having preprocessed the file using the pawn compiler. I guess the best solution would be to include a predefined list definitions present in SA-MP 0.3z in the output. Another way would be to manually parse every file in the include directory, but that would result in a large number of defines which are never used in the script.
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
Bews - 20.05.2014
Quote:
Originally Posted by Johnson_boy
I had a look into it, and the regular expression did indeed contain an error, resulting in those 4 first functions being skipped. That bug is now fixed.
|
What about _players_included?
Quote:
Originally Posted by Johnson_boy
However, I was unable to reproduce the issue you described with the npc file. I included a_npc in a bare gamemode, and all the npc functions were correctly parsed and written to the output file. I am relatively sure I didn't make any changes regarding that in the update, but you could try with the latest version, and see if the functions are still missing.
|
Oh well, it's my bad. I just wanna make a complete list of native functions and callbacks, but you know a_samp and a_npc can't be used together -_-
Quote:
Originally Posted by Johnson_boy
As to parsing the defines, it is not currently possible, because the defines no longer exists having preprocessed the file using the pawn compiler. I guess the best solution would be to include a predefined list definitions present in SA-MP 0.3z in the output. Another way would be to manually parse every file in the include directory, but that would result in a large number of defines which are never used in the script.
|
U can parse .pwn file to get all used includes.
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
Johnson_boy - 21.05.2014
I am currently working on a new version which does not use the pawn preprocessor, but instead the files are parsed manually. The benefit is vastly improved performance on large files and the ability to include definitions as well. In addition, it allows you to parse includes in cases where the proprocessor would have left them out, like including both a_samp and a_npc.
The downside is that the output will be less accurate, as #if defined blocks for instance are no longer taken into account. Still, I believe that the positive effects outweight the negative ones in this case.
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
RajatPawar - 21.05.2014
This is great. Thanks to my almost nil knowledge about this, is there a way to automatically parse includes on definite intervals (or on a compile), and add all natives automatically, instead of manually doing that?
Mauzen did that for notepad++, is this possible for ST2?
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
Johnson_boy - 21.05.2014
@Bews You could give the new version (v0.2) a shot, and see if it performs better than the previous version. It should now parse all the includes, and also solve the issues you pointed out.
@RajatPawar Yes, it's indeed possible, just requires adding a command line interface to the program. Once that's done, you could execute the program every time you compile, schedule it to run when your computer boots up, or anything you like. I'll try to include it in the next version.
Re: CodeParser: Generate auto-complete files for Sublime Text / Notepad++ (Qt/C++) -
Bews - 22.05.2014
Quote:
Originally Posted by Johnson_boy
@Bews You could give the new version (v0.2) a shot, and see if it performs better than the previous version. It should now parse all the includes, and also solve the issues you pointed out.
|
OnPlayerEditObject and OnPlayerEditAttachedObject in skipped list, why?
This is also ignored:
pawn Code:
enum filemode
{
io_read, /* file must exist */
io_write, /* creates a new file */
io_readwrite, /* opens an existing file, or creates a new file */
io_append, /* appends to file (write-only) */
}
const EOF = -1;
_ALS_OnFilterScriptInit and the same functions (starting with _ALS_) should be skipped I think. They are used in hooks.
Edit: And please update your NPP template to this one:
userDefineLang.xml (it has some bugs fixed)