SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/04/2018, 11:39 AM   #41
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,947
Reputation: 1510
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Update on the above: you probably don't need to quote or escape anything now, it seems that vscode handles that internally:

Quote:
If the command itself contains spaces, VS Code will by default strong quote the command as well. As with arguments, the user can control the quoting of the command using the same literal style.
That means if the path to pawncc.exe contains spaces then it should be fine.

Quote:
Since the shell tasks specifies the argument separately, VS Code knows that it should be passed as one argument to the 'dir' command and quotes the argument based on the shell used.
And this refers to the `args` contents, which implies those don't need to be quoted either.

I still haven't got around to doing this on a Windows machine but it should be valid to just use the following tasks.json for both cmd and powershell:

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

However I'm not certain about the -;+ and -(+, I'm assuming those will be quoted and thus escaped but I've not tested this.

Edit: Ergazia tested this on PowerShell and reported that it worked fine!
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 20/04/2018, 01:43 AM   #42
Chaprnks
Gangsta
 
Chaprnks's Avatar
 
Join Date: Sep 2007
Location: Soviet America
Posts: 738
Reputation: 64
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Too many new code editors now'a'days. Took me like 6 months to finally get away from using Notepad++ & comfortable with Sublime.. then Atom came out. After trying to force myself to use Atom, I said "fk it" and went back to Sublime. I wonder what features would make VS Code more preferable to the others?
__________________
Chaprnks is offline   Reply With Quote
Old 20/04/2018, 06:43 AM   #43
iKarim
Gangsta
 
iKarim's Avatar
 
Join Date: Oct 2015
Posts: 584
Reputation: 135
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by Chaprnks View Post
Too many new code editors now'a'days. Took me like 6 months to finally get away from using Notepad++ & comfortable with Sublime.. then Atom came out. After trying to force myself to use Atom, I said "fk it" and went back to Sublime. I wonder what features would make VS Code more preferable to the others?
The most notable feature (at least for me) is the built in git management. Although it may not offer better experience for your PAWN purposes, it's a very good JavaScript/TypeScript and Go editor.

But to answer your question, most people that use vscode already for other languages will prefer using it for PAWN too.
__________________
Quote:
Originally Posted by Maximun View Post
Did he requested you some 'Kilobytes' in order to post this thread?
iKarim is offline   Reply With Quote
Old 20/04/2018, 10:06 AM   #44
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,271
Reputation: 247
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by iKarim View Post
The most notable feature (at least for me) is the built in git management. Although it may not offer better experience for your PAWN purposes, it's a very good JavaScript/TypeScript and Go editor.

But to answer your question, most people that use vscode already for other languages will prefer using it for PAWN too.
Backing what @iKarim said here, I worked with Sublime for the longest time, and never even decided to switch to anything else, but as soon as I tried VSCode out, I realized it was the one text editor I never knew I needed, I just love the integrated terminal and extensions management, very flexible, fast and customizable, not that sublime text lacks the later, but working with VSCode somehow felt like a boost to productivity, but I guess that's just me.
__________________

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

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


Eoussama is offline   Reply With Quote
Old 29/04/2018, 09:20 AM   #45
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 707
Reputation: 293
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Good job.

But why do you use "-Dgamemodes" here?
PHP Code:

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

  ] 

So if I want to compile my include file separately, which is in "include" folder, then my .amx file will be moved to the "gamemode" folder. I think it should be removed as .pwn files in "gamemode" folder will create .amx files in the same folder anyway (at least I checked it myself with "${relativeFile}" instead of "${file}" and without "-Dgamemodes" and it all worked good).
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 29/04/2018, 09:30 AM   #46
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,947
Reputation: 1510
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by OstGot View Post
Good job.

But why do you use "-Dgamemodes" here?
PHP Code:

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

  ] 

So if I want to compile my include file separately, which is in "include" folder, then my .amx file will be moved to the "gamemode" folder. I think it should be removed as .pwn files in "gamemode" folder will create .amx files in the same folder anyway (at least I checked it myself and it all worked good without this arg).
You can edit it how you please, this is just a starting point for the most common layouts.

What -D does is the same as setting the working directory of the command being invoked. Most users want to just compile their gamemode which is in `gamemodes/`. If you want to build standalone includes to test, you're probably best to just use sampctl and build them as packages. Or modify the task arguments to suit your needs.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 29/04/2018, 08:03 PM   #47
cengiz6155
Little Clucker
 
Join Date: Jul 2015
Posts: 40
Reputation: 0
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

do not have automatic completion of other inscriptions or stocks?
cengiz6155 is offline   Reply With Quote
Old 30/04/2018, 10:10 AM   #48
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,947
Reputation: 1510
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

Quote:
Originally Posted by cengiz6155 View Post
do not have automatic completion of other inscriptions or stocks?
Automatic completion and other static analysis tools are in development and coming soon.
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 01/05/2018, 07:03 AM   #49
JeremyHolden
Little Clucker
 
Join Date: Jul 2017
Location: Russia/Nizhnevartowsk
Posts: 20
Reputation: 0
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

SDK in help all (facepalm)
SDK uses c++ script and input in pawn script.
g00gle in help
JeremyHolden is offline   Reply With Quote
Old 16/05/2018, 02:43 AM   #50
poxer
Little Clucker
 
poxer's Avatar
 
Join Date: Jan 2016
Location: Argentina
Posts: 30
Reputation: 17
Default Re: Visual Studio Code - Updated Pawn Tools for vscode

This is my tasks.json on Ubuntu, I hope it helps others tho.

Code:
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build-normal",
            "type": "shell",
            "command": "pawncc", 
            "args": ["${relativeFile}", "-i:./include", "\"-;+\"", "\"-(+\"", "-Z", "-d3"],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "isBackground": false,
            "presentation": {
                "reveal": "silent",
                "panel": "dedicated"
            },
            "problemMatcher": "$pawncc"
        }
    ]
}
Using this compiler: https://github.com/pawn-lang/compiler/
__________________


poxer 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 68 12/08/2018 06:21 AM
[Tutorial] Visual Studio Code Compiler Casttiel Lançamentos/Releases 7 17/08/2017 08:18 AM
Can someone make Pawn compiler for Visual Studio Code? DuyDang2412 Scripting Help 11 26/07/2017 11:21 AM
[Tutorial] Visual Studio like an compilator PAWN language Dystans Tutorials 9 17/02/2013 06:43 AM
Visual Studio as the development environment for PAWN Arca Scripting Help 7 28/07/2012 08:18 PM


All times are GMT. The time now is 02:11 AM.


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