SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/03/2018, 01:00 PM   #31
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,991
Reputation: 1560
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by Eoussama View Post
I also had to change all my include paths from relative to absolute.
Do you mean `#include <C:\...>`? You should never need to do that, I've never known anyone need to do that. Just set the `-D` flag or the working directory property in the tasks.json configuration.
__________________
Tools:

Plugins:

Links:

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

Quote:
Originally Posted by [HLF]Southclaw View Post
Do you mean `#include <C:\...>`? You should never need to do that, I've never known anyone need to do that. Just set the `-D` flag or the working directory property in the tasks.json configuration.
I didn't have to include the root, just changed from "Utils/something.inc" this to this "gamemodes\Utils\something.inc".
__________________

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

|===[Interesting topics]===|
Semantic Versioning
Eoussama is offline   Reply With Quote
Old 17/03/2018, 01:38 PM   #33
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,991
Reputation: 1560
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Ah, in that case just pass `-Dgamemodes/` to the compiler and it will adjust the working directory for the compiler. This also requires using `${file}` as the first argument. I've updated the first post and the readme file with all the details - tested on Windows with cmd and PowerShell.
__________________
Tools:

Plugins:

Links:

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

Quote:
Originally Posted by [HLF]Southclaw View Post
Ah, in that case just pass `-Dgamemodes/` to the compiler and it will adjust the working directory for the compiler. This also requires using `${file}` as the first argument. I've updated the first post and the readme file with all the details - tested on Windows with cmd and PowerShell.
That didn't work for me either, I get this error everytime,
Code:
d:\Scripting\Pawn\My.p(0) : fatal error 100: cannot read from file: "d:\Scripting\Pawn\My.p"
where the path should be: D:\Scripting\Pawn\My pawn projects\gamemodes\DRD DayZ\DRD DAYZ\pawno/pawncc.exe

The only method that worked for me is this "args": ["\\\"${relativeFile}\\\"", "\\\"-;+\\\"", "\\\"-(+\\\""],
but it requires me to add the gamemode folder in my includes path.
PHP Code:
#include "gamemodes/Utils/Lock.inc"; // Previousely; #include "Utils/Lock.inc"; 
__________________

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

|===[Interesting topics]===|
Semantic Versioning
Eoussama is offline   Reply With Quote
Old 17/03/2018, 08:46 PM   #35
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,991
Reputation: 1560
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by Eoussama View Post
That didn't work for me either, I get this error everytime,
Code:
d:\Scripting\Pawn\My.p(0) : fatal error 100: cannot read from file: "d:\Scripting\Pawn\My.p"
where the path should be: D:\Scripting\Pawn\My pawn projects\gamemodes\DRD DayZ\DRD DAYZ\pawno/pawncc.exe

The only method that worked for me is this "args": ["\\\"${relativeFile}\\\"", "\\\"-;+\\\"", "\\\"-(+\\\""],
but it requires me to add the gamemode folder in my includes path.
PHP Code:
#include "gamemodes/Utils/Lock.inc"; // Previousely; #include "Utils/Lock.inc"; 
That's caused by the space in the path which is resolved by wrapping the path with single-quotes, for the "command" this is: &'pawno/pawncc.exe' and for the first "arg" value, it would be '${file}'
__________________
Tools:

Plugins:

Links:

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

Quote:
Originally Posted by [HLF]Southclaw View Post
That's caused by the space in the path which is resolved by wrapping the path with single-quotes, for the "command" this is: &'pawno/pawncc.exe' and for the first "arg" value, it would be '${file}'
Thanks a bunch, working like a charm now.
__________________

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

|===[Interesting topics]===|
Semantic Versioning
Eoussama is offline   Reply With Quote
Old 29/03/2018, 10:18 AM   #37
MrThomas
Little Clucker
 
Join Date: Feb 2018
Posts: 9
Reputation: 0
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Code:
> Executing task: "C:\Users\Tom\Desktop\Script\pawno\pawncc.exe" "c:\Users\Tom\Desktop\Script\gamemodes\script.pwn" -Dgamemodes -;+ -(+ -d3 <

'C:\Users\Tom' is not recognized as an internal or external command,
operable program or batch file.
The terminal process terminated with exit code: 1
I don't understand what is it, anyone can help?
MrThomas is offline   Reply With Quote
Old 29/03/2018, 01:03 PM   #38
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,991
Reputation: 1560
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

I don't understand either... Try forward slashes? Odd that error usually appears when there's a space in the path and it's not escaped properly but that's not the case here. Try copying that into a PowerShell prompt and experiment there.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is online now   Reply With Quote
Old 05/04/2018, 08:24 PM   #39
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

Tried this on a bare script:
PHP Code:
"args": ["\"${file}\"""-Dgamemodes""-;+""-(+""-d3"], 
Code:
> Executing task: "D:\project\pawno\pawncc.exe" "d:\project\gamemodes\bare.pwn" -Dgamemodes -;+ -(+ -d3 <

The filename, directory name, or volume label syntax is incorrect.
The terminal process terminated with exit code: 1
It works without the forward slash
PHP Code:
"args": ["${file}""-Dgamemodes""-;+""-(+""-d3"],, 
But I can't open files from problem panel:
Code:
Unable to open 'bare.pwn': File not found (file:///d:/project/gamemodes/d:/project/gamemodes/bare.pwn).
I changed ${file} variable to ${fileBasename} and now I can open files from problems panel.

I have modified command, args and problemMatcher, this works for me without any error on Windows 7 (CMD shell).
PHP Code:
"command""${workspaceRoot}\\pawno\\pawncc.exe",
"args": ["${fileBasename}""-Dgamemodes""-;+""-(+""-d3"],
"problemMatcher""$pawncc
Now I can also open external includes/modules like #include "cnr/admin.pwn" directly from problems panel (admin module is located in folder gamemodes/cnr/admin.pwn).
Nubik is offline   Reply With Quote
Old 07/04/2018, 07:13 PM   #40
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,991
Reputation: 1560
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

The latest Visual Studio Code update includes some changes to how quotes, escapes and directories with spaces work. Check the link out below:

https://code.visualstudio.com/updates/v1_22#_tasks

I will give it a proper read tomorrow or next week and update the extension and documentation accordingly.

If anyone uses the new version and runs into issues, please drop a message here. If you investigate and solve your issue on the new version then please also drop some details in this thread or even better, submit a pull request to the extension's GitHub repository!
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw 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 03:52 PM.


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