SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 30/12/2017, 01:38 PM   #1
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,766
Reputation: 1305
Default Visual Studio Code - Updated Pawn Tools for vscode

vscode-pawn

Pawn tools for vscode.

Currently this is a port of the Sublime Text package which includes proper Pawn syntax highlighting, autocompletions for the standard library and some popular libraries.

Coming soon:
  • Static Analysis
  • Auto-complete
  • Intellisense support

Installation

Just search for “Pawn Tools” in the vscode extensions and install it.

Alternatively, you can check out the source code or view the marketplace page:

Compiling Pawn Code

Code uses a method called “Tasks” to run compilers and build tools. All you need to do is create a folder named .vscode in your project’s directory and in there, create a file named tasks.json with the following contents:

PHP Code:
{
    
"version""2.0.0",
    
"tasks": [
        {
            
"label""build-normal",
            
"type""shell",
            
"command""${workspaceRoot}\\pawno\\pawncc.exe",
            
"args": ["\\\"${relativeFile}\\\"""\\\"-;+\\\"""\\\"-(+\\\""],
            
"group": {
                
"kind""build",
                
"isDefault"true
            
},
            
"isBackground"false,
            
"presentation": {
                
"reveal""silent",
                
"panel""dedicated"
            
},
            
"problemMatcher""$pawncc"
        
}
    ]



"command": "${workspaceRoot}\\pawno\\pawncc.exe", is the important bit here, this is the path to your Pawn compiler and I’ve assumed most of you have a left-over pawno folder from that long dead text editor! This folder not only contains Pawno but also the Pawn code compiler (pawncc.exe).

"args": ["\\\"${relativeFile}\\\"", "\\\"-;+\\\"", "\\\"-(+\\\""], is also important, this is where you define the arguments passed to the compiler. Pawno also did this but you might not have known. The defaults have always been -;+ to force semicolon usage and -(+ to force brackets in statements. Please note the excessive use of backslash characters, if you want to add more arguments you must use the same triple-backslash-quote around the argument if it involves a special character.

If you store your Pawn compiler elsewhere, just replace the entire command setting with the full path to your compiler.

Also, if you want to disable debug symbols (you won’t be able to use crashdetect) just remove -d3 from "args": ["${relativeFile}", "-;+", "-(+", "-d3"],.

problemMatcher is the part that allows recognising the Pawn compiler output and presenting it in the problems panel of the editor. This doesn’t work well with external includes because the paths change from relative to absolute. sampctl fortunately fixes this (and a lot of other annoying things).

Features

Currently just syntax highlighting and completions from the Sublime project.

Once the Pawn-Parser project reaches a workable state, this extension will feature more language features such as intellisense support, go-to-definition, view-all-references, etc…

Here’s what the problems panel looks like when the tasks.json is set up properly:

__________________




Last edited by [HLF]Southclaw; 01/01/2018 at 04:52 PM.
[HLF]Southclaw is offline   Reply With Quote
Old 30/12/2017, 01:39 PM   #2
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 665
Reputation: 94
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Nice. I'll give it a try.

EDIT: Looks decent, I'd love to see static analysis, auto-complete, intellisense support added.
__________________
Idiot pretends to offer samp services, but scams people. http://forum.sa-mp.com/showthread.ph...34#post3987734
My hangout: https://discord.gg/yU2wDmQ
Retired from the SA-MP scene...
xo's biggest secret revealed, click on the image.

Last edited by cuber; 30/12/2017 at 02:12 PM.
cuber is offline   Reply With Quote
Old 30/12/2017, 02:23 PM   #3
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 250
Reputation: 21
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

I have a problem with this https://imgur.com/706BEhO
The args for me its not working

But good work btw, i was expecting some more good for vscode because the old pawn for vscode was bad. And what theme you are using?
__________________
My works: Github
Banditul18 is offline   Reply With Quote
Old 30/12/2017, 02:34 PM   #4
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 665
Reputation: 94
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by Banditul18 View Post
I have a problem with this https://imgur.com/706BEhO
The args for me its not working

But good work btw, i was expecting some more good for vscode because the old pawn for vscode was bad. And what theme you are using?
line 7, paste the folder location of pawno
__________________
Idiot pretends to offer samp services, but scams people. http://forum.sa-mp.com/showthread.ph...34#post3987734
My hangout: https://discord.gg/yU2wDmQ
Retired from the SA-MP scene...
xo's biggest secret revealed, click on the image.
cuber is offline   Reply With Quote
Old 30/12/2017, 02:44 PM   #5
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 250
Reputation: 21
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

https://imgur.com/7TPVOSD
https://imgur.com/k751ZTU
Code:
F:\Stuff\gm\pawno
Its in the same folder as the project. I try to add a full path to it and same thing
__________________
My works: Github
Banditul18 is offline   Reply With Quote
Old 30/12/2017, 02:48 PM   #6
DavidGravelli
Huge Clucker
 
DavidGravelli's Avatar
 
Join Date: May 2014
Posts: 225
Reputation: 36
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Error
Code:
ase\0.3.8 RC4-4\pawno\pawncc.exe gamemodes/Houses.pwn -\;+ -\(+
+           
}
DavidGravelli is offline   Reply With Quote
Old 30/12/2017, 02:48 PM   #7
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 665
Reputation: 94
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by Banditul18 View Post
https://imgur.com/7TPVOSD
https://imgur.com/k751ZTU
Code:
F:\Stuff\gm\pawno
Its in the same folder as the project. I try to add a full path to it and same thing
pawno\pawncc.exe
__________________
Idiot pretends to offer samp services, but scams people. http://forum.sa-mp.com/showthread.ph...34#post3987734
My hangout: https://discord.gg/yU2wDmQ
Retired from the SA-MP scene...
xo's biggest secret revealed, click on the image.
cuber is offline   Reply With Quote
Old 30/12/2017, 03:39 PM   #8
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,766
Reputation: 1305
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Be careful of the fact that backslash \ is an escape character.

I don't have a Windows machine to test on at the moment. But for the time being, if you run into issues, check the vscode tasks.json documentation for windows-specific things.

It could be the args escape characters for ( and ; so try messing with that.
__________________



[HLF]Southclaw is offline   Reply With Quote
Old 30/12/2017, 05:03 PM   #9
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 250
Reputation: 21
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Well i try to make those args in al the ways i was able to think and the only way its work to compile its to delete them and put them in pawn.cfg file inside pawno folder
Code:
-;+  -v2 -d3 -Z+ -\\)+
Another way i don't figure out
__________________
My works: Github
Banditul18 is offline   Reply With Quote
Old 30/12/2017, 05:23 PM   #10
rfr
Huge Clucker
 
rfr's Avatar
 
Join Date: Nov 2017
Location: 55.3781°N 3.4360°W
Posts: 271
Reputation: 40
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

very cool
rfr is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] PAWN Syntax and Compiler for Visual Studio Code FreAkeD Tutorials 55 01/01/2018 09:27 AM
[Tutorial] Visual Studio Code Compiler Casttiel Lançamentos/Releases 7 17/08/2017 09:18 AM
Can someone make Pawn compiler for Visual Studio Code? DuyDang2412 Scripting Help 11 26/07/2017 12:21 PM
[Tutorial] Visual Studio like an compilator PAWN language Dystans Tutorials 9 17/02/2013 07:43 AM
Visual Studio as the development environment for PAWN Arca Scripting Help 7 28/07/2012 09:18 PM


All times are GMT. The time now is 12:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.