AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   [Editor] AMXXPawn for Visual Studio Code (https://forums.alliedmods.net/showthread.php?t=300661)

Bugsy 03-03-2018 11:32

Re: [Editor] AMXXPawn for Visual Studio Code
 
This looks cool, I've been a die-hard AMXX Studio user forever my only complaint with it is the white UI and lack of custom 'new plugin' layout. I just installed this but I have yet to figure out how to get a plugin to compile. I tried selecting View->Debug and then the play button, but then it asks me to select an environment which I do not see AMXX as an option. A short tutorial from download, configuration to actual usage would be helpful. Even setting the directories in User Settings took some trial and error.

HamletEagle 03-03-2018 12:02

Re: [Editor] AMXXPawn for Visual Studio Code
 
Quote:

Originally Posted by KliPPy (Post 2581104)
Done, just update. Would've done it last night but Windows update goofed on me hard. Duplicated start menu shortcuts, and even worse, changed some paths in the %PATH% environment variable. Micro$oft please fix.

Thanks. I feel your pain, the latest windows update messed up my colors to the point I could not see anything, I had to go back to the older version.

One more thing, can you also add an option for amxx file name? Right now it's the same as the file name, but I would like to be able to set a predefined name.

Quote:

Originally Posted by Bugsy (Post 2581166)
This looks cool, I've been a die-hard AMXX Studio user forever my only complaint with it is the white UI and lack of custom 'new plugin' layout. I just installed this but I have yet to figure out how to get a plugin to compile. I tried selecting View->Debug and then the play button, but then it asks me to select an environment which I do not see AMXX as an option. A short tutorial from download, configuration to actual usage would be helpful. Even setting the directories in User Settings took some trial and error.

Press CTRL+SHIFT+P and select AMXXPawn: CompilePlugin. You can create a key binding by going to File->Preferences->Keyboard Shortcuts. I have mine on CTRL+F5.

klippy 03-03-2018 12:06

Re: [Editor] AMXXPawn for Visual Studio Code
 
Quote:

Originally Posted by Bugsy (Post 2581166)
This looks cool, I've been a die-hard AMXX Studio user forever my only complaint with it is the white UI and lack of custom 'new plugin' layout. I just installed this but I have yet to figure out how to get a plugin to compile. I tried selecting View->Debug and then the play button, but then it asks me to select an environment which I do not see AMXX as an option. A short tutorial from download, configuration to actual usage would be helpful. Even setting the directories in User Settings took some trial and error.

Yeah I can create a full tutorial.


I don't like the compiling process either. However it looks like I can use tasks now to do it, there's been some progress with them and it looks like my extension can provide a task template now. I need some feedback though, especially from people that use VSCode and tasks regularly:
  • Should I treat this as primarily a development tool? That means that I can require users to do something more than just put a path to the compiler because developers are capable of doing more than that. If I want to cater to a general public (server operators, admins) then I have to keep it simple, and it already isn't simple enough for some that are used to more GUI it looks like. Plugin consumers are used to hitting one button and compiling a plugin, while they can get stuck on anything a bit more advanced.
  • With tasks you won't be able to just open a file and hit a button or a shortcut to compile that plugin. Tasks are meant to be used for multi-file projects, and Pawn plugins are usually consisting of a single file. I don't know how I feel about this.
  • On the other side, other development environments use tasks because they are one unified way to compile stuff. I think "Run Build Task" is bound to Ctrl + Shift + B by default, so by using tasks you use "the one true way" of compiling things in VSCode.
  • amxxpc isn't in most people's %PATH%/$PATH, which would make everything much easier. Most other development tools are added to PATH during installation, amxxpc isn't one of them. I feel like I can't require plugin consumers to change their environment variables.


Quote:

Originally Posted by HamletEagle (Post 2581170)
One more thing, can you also add an option for amxx file name? Right now it's the same as the file name, but I would like to be able to set a predefined name.

You can use tasks if you need more customization, because your desire to have a specific filename seems to be project-specific, which tasks are great at. I don't feel like just setting the file name in settings is a good idea.

voed 03-12-2018 15:51

Re: [Editor] AMXXPawn for Visual Studio Code
 
http://ipic.su/avjtI.png
Are there any way to add operators to autocomplete? :/

Quote:

Originally Posted by KliPPy (Post 2581171)
Should I treat this as primarily a development tool?

Well, i dont think server admins needs IDE, they have compile.exe/sh, so yes

klippy 03-19-2018 13:33

Re: [Editor] AMXXPawn for Visual Studio Code
 
Quote:

Originally Posted by voed (Post 2582731)
http://ipic.su/avjtI.png
Are there any way to add operators to autocomplete? :/

What do you mean by "operators"? Control flow keywords like if, else, for etc? If so, I'm not quite sure, I don't think other language services add it at all. Why would you even need that? Just writing "else" is much faster then finding it in the completions list.

Quote:

Originally Posted by voed (Post 2582731)
Well, i dont think server admins needs IDE, they have compile.exe/sh, so yes

Thank you. I need more feedback though.

voed 03-21-2018 15:24

Re: [Editor] AMXXPawn for Visual Studio Code
 
Quote:

Originally Posted by KliPPy (Post 2583659)
Why would you even need that? Just writing "else" is much faster then finding it in the completions list.

Yeah, i typed 'else' and its suggesting me autocomplete for 'elog_message', so i need to cancel autocomplete and then hit enter, thats why i asked:roll:

wopox3 04-25-2018 12:33

Re: [Editor] AMXXPawn for Visual Studio Code
 
In support of the author. I would like to share some settings for Visual Studio Code. I use VSCode for development using Github & BitBucket repository systems. It's comfortable.

I will make some clarifications for the relative paths and work with the project.
Compile plugins by default build system.
https://i.imgur.com/2ie3Osu.png

Need create task with the following contents in tasks.json:
PHP Code:

{
    
"version""2.0.0",
    
"tasks": [
        {
            
"taskName""Compile AMXX Plugin",
            
"type""process",
            
"command""${workspaceRoot}\\scripting\\amxxpc.exe",
            
"args": [
                
"${file}",
                
"-i${workspaceRoot}\\scripting\\include",
                
"-o${workspaceRoot}\\..\\plugins\\${fileBasenameNoExtension}.amxx"
            
],
            
"group": {
                
"kind""build",
                
"isDefault"true
            
}
        }
    ]


A specific task supports the relative paths of the project. When you press 'CTRL_SHIFT+B' your task will works (If you have not changed the default settings of VSCode).
The compiler will start and the destination file will go to: ${workspaceRoot}\\..\\plugins \ \ ${fileBasenameNoExtension}.amxx
NOTE: :nono: You need to create the ${workspaceRoot}/plugins/ folder in advance for the amxx compiler to successfully place the output file.

If you want to configure VSCode to collect information from include by relative path (relative path to compiler and libraries), you may configure VSCode by this way:
in settings.json
PHP Code:

{
    
"amxxpawn.compiler.includePaths": [
        
"${workspaceRoot}/scripting/include/"
    
],
    
"amxxpawn.compiler.executablePath""${workspaceRoot}/scripting/amxxpc.exe",
    
"amxxpawn.compiler.outputType""path",
    
"amxxpawn.compiler.outputPath""${workspaceRoot}/plugins/"


IMPORTANTLY! You can set specific parameters for the workspace and this should not be ignored for your convenience.
https://i.imgur.com/kqnDx9j.png

When working, keep in mind that you need to open the project folder in VSCode, not the plugin file. :3

like this
https://i.imgur.com/CQXsaxS.png

Recra 04-26-2018 09:05

Re: [Editor] AMXXPawn for Visual Studio Code
 
1 Attachment(s)
There is a bug in parsing some lines that includes "^

Zer0_CooL 05-11-2018 15:35

Re: [Editor] AMXXPawn for Visual Studio Code
 
When i setting up includePaths like this:
Code:

    "amxxpawn.compiler.includePaths":
    [
        "C:\\AMXX\\Compiler\\1.8.3\\include",
        "${fileDirname}\\include"
    ],

and put my include files in the "${fileDirname}\\include" directory
VSCode says: "Couldn't resolve include path 'my_include'. Check compiler include paths."
but compiles without errors.

KliPPy, can you fix it please?
Anyway this extension is amazing. Thank you!

ish12321 06-10-2018 12:16

Re: [Editor] AMXXPawn for Visual Studio Code
 
I installed x64 build of VS Code. I installed AMXXPawn and set it. The enums and constants from the includes are not coming in auto complete, neither are any defines. Only functions are coming from include files. Please check. @KliPPy


All times are GMT -4. The time now is 02:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.