SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/02/2018, 12:11 PM   #21
GranaT3
Huge Clucker
 
Join Date: Jan 2013
Posts: 369
Reputation: 43
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

will this continue to be updated?, what do you have to press to compile?
__________________
Gracias por todo, sección Española/Spanish
GranaT3 is offline   Reply With Quote
Old 12/02/2018, 11:59 PM   #22
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,960
Reputation: 1549
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by GranaT3 View Post
will this continue to be updated?, what do you have to press to compile?
Yes, I am planning more features such as intellisense support (go to function, autocomplete, static analysis, etc) as well as possible collaboration with Misiur for step-through debugging.

To compile, it depends on your settings and platform. The default is CTRL+Shift+B on Windows, Cmd+Shift+B on mac. There is more info here: https://code.visualstudio.com/Docs/e...tcuts-to-tasks

You can also open the command panel and enter "Run build task".

Quote:
Originally Posted by SimonItaly View Post
Has anyone tried to setup this extension with the Linux version of Code?
I haven't got a Linux desktop available at the moment, however I did develop this mostly on Mac which is Linux-like. There should be no reason why it wouldn't work since vscode normalises all path delimiters to / anyway, the only difference I know of is how Linux handles escape characters in the `args` and `command` fields in tasks.json.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is online now   Reply With Quote
Old 27/02/2018, 07:57 PM   #23
Nubik
Big Clucker
 
Nubik's Avatar
 
Join Date: May 2013
Location: $location
Posts: 54
Reputation: 4
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by [HLF]Southclaw View Post
I've updated the main post with working Windows tasks.json files now, you just have to use a ton of escape characters to properly express the `-;+` and `-(+` flags for the compiler.
For me on windows this doesn't work:
Code:
"args": ["\\\"${relativeFile}\\\"", "\\\"-;+\\\"", "\\\"-(+\\\""],
It gives me this error: cannot read from file: ""gamemodes/bare.pwn""

I think in args the file name/path is not correctly set up (its using extra quotes by looking at error message).

But this works:
Code:
"args": ["${relativeFile}", "-;+", "-(+", "-d3"],
Nubik is offline   Reply With Quote
Old 28/02/2018, 02:00 PM   #24
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,960
Reputation: 1549
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by Nubik View Post
For me on windows this doesn't work:
Code:
"args": ["\\\"${relativeFile}\\\"", "\\\"-;+\\\"", "\\\"-(+\\\""],
It gives me this error: cannot read from file: ""gamemodes/bare.pwn""

I think in args the file name/path is not correctly set up (its using extra quotes by looking at error message).

But this works:
Code:
"args": ["${relativeFile}", "-;+", "-(+", "-d3"],
What OS and shell are you using? I tested my version before posting and it worked flawlessly, I attempted no escapes and that failed miserably.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is online now   Reply With Quote
Old 28/02/2018, 05:52 PM   #25
Nubik
Big Clucker
 
Nubik's Avatar
 
Join Date: May 2013
Location: $location
Posts: 54
Reputation: 4
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by [HLF]Southclaw View Post
What OS and shell are you using? I tested my version before posting and it worked flawlessly, I attempted no escapes and that failed miserably.
Windows 7 64bit in terminal output it shows "cmd"

Default settings in vscode:
Code:
"terminal.integrated.shell.windows": "C:\\Windows\\system32\\cmd.exe"
Are you using windows 10 and a different shell?
Nubik is offline   Reply With Quote
Old 03/03/2018, 10:45 PM   #26
m33p4r34l
Little Clucker
 
Join Date: Nov 2010
Posts: 5
Reputation: 0
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

I created a little tool as addition to this nice addon in order to upload ur script directly after compilation via sftp to a given server, i changed the form of tasks.json to the following:
Quote:
{
"version": "2.0.0",
"tasks": [
{
"label": "build-normal",
"type": "shell",
"command": "&'${workspaceRoot}\\pawnCompilerPlusFTP.exe'" ,
"args": [
"\\\"hostIP\\\"",
"\\\"username\\\"",
"\\\"password\\\"",
"\\\"port\\\"",
"\\\"destinationpath\\\"",
"\\\"${relativeFile}\\\"",
"\\\"-;+\\\"",
"\\\"-(+\\\""
],
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": false,
"presentation": {
"reveal": "silent",
"panel": "dedicated"
},
"problemMatcher": "$pawncc"
}
]
}
Add the .exe and the dll for ssh in c# to your main folder where the samp-server executable sits

Heres the source code

Download

Quote:
gamemodes/BCRP.pwn(5683) : warning 203: symbol is never used: "GetItemFromPlayer"
UPLOADING : gamemodes/BCRP.amx
Connecting to 88.**.***.205 as *****..
Connection established: True
Changed Directory to: /home/samp/gamemodes
Staring Upload.. Can write: True
BCRP.amx
Finished, disconnecting..
Done!
m33p4r34l is offline   Reply With Quote
Old 17/03/2018, 04:27 AM   #27
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,276
Reputation: 255
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Looking to finally switch to this, I encountered this problem when building my pawn files
Code:
D:\Scripting\Pawn\My : The term 'D:\Scripting\Pawn\My' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ D:\Scripting\Pawn\My pawn projects\gamemodes\DRD DayZ\DRD DAYZ\pawno\ ...
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\Scripting\Pawn\My:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
The compiler's path is D:\Scripting\Pawn\My pawn projects\gamemodes\DRD DayZ\DRD DAYZ\pawno\pawncc.exe
for some reason, it cuts off whenever it detects a space character in folder names, can this be fixed? that is, without having to remove all spaces on my folders names!
__________________

|===[Web taxi]===|
List of my work
Github
Pastebin

|===[Interesting topics]===|
Semantic Versioning


Eoussama is online now   Reply With Quote
Old 17/03/2018, 09:57 AM   #28
iKarim
Gangsta
 
iKarim's Avatar
 
Join Date: Oct 2015
Posts: 585
Reputation: 139
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

I am not sure as I am mostly on Ubuntu but I guess you have to escape the spaces in the path, for example:

Code:
D:\Scripting\Pawn\My\ pawn\ projects\gamemodes\DRD\ DayZ\DRD\ DAYZ\pawno\ ...
Thing is, in Windows the "\" is probably the path separator or whatever so I am not sure if that'll work to escape the path.
iKarim is offline   Reply With Quote
Old 17/03/2018, 10:45 AM   #29
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,960
Reputation: 1549
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by Eoussama View Post
Looking to finally switch to this, I encountered this problem when building my pawn files
Code:
D:\Scripting\Pawn\My : The term 'D:\Scripting\Pawn\My' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ D:\Scripting\Pawn\My pawn projects\gamemodes\DRD DayZ\DRD DAYZ\pawno\ ...
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\Scripting\Pawn\My:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
The compiler's path is D:\Scripting\Pawn\My pawn projects\gamemodes\DRD DayZ\DRD DAYZ\pawno\pawncc.exe
for some reason, it cuts off whenever it detects a space character in folder names, can this be fixed? that is, without having to remove all spaces on my folders names!
You probably need to place escaped quotes around the path:

Code:
"command": "\"C:\Path with spaces\pawno\""
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is online now   Reply With Quote
Old 17/03/2018, 12:43 PM   #30
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,276
Reputation: 255
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Thank you guys, I had it working buy wrapping the path in single quotes and prefix it with an ampersand, I also had to change all my include paths from relative to absolute.

Code:
"command": "&'${workspaceRoot}/pawno/pawncc.exe'"
__________________

|===[Web taxi]===|
List of my work
Github
Pastebin

|===[Interesting topics]===|
Semantic Versioning


Eoussama is online now   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 68 12/08/2018 07:21 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 07:10 AM.


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