View Single Post
wopox3
Junior Member
Join Date: Dec 2013
Location: Russia
Old 04-25-2018 , 12:33   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #107

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.


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: 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.


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

like this

Last edited by wopox3; 04-25-2018 at 12:41.
wopox3 is offline