Raised This Month: $12 Target: $400
 3% 

[Editor] AMXXPawn for Visual Studio Code


Post New Thread Reply   
 
Thread Tools Display Modes
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-26-2017 , 05:46   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #11

can you add somthing like this :

PHP Code:
  // Where should compiler. Can be:
  //   - 'source' (same as input)
  //   - 'path' (specified in amxxpawn.compiler.executablePath setting)
  
"amxxpawn.compiler.executableType""source"
if source is set in this case it will look amxxpc.exe in the input folder.

PHP Code:
  // Where should include files. Can be:
  //   - 'source' ( include directory,  relative to input directory )
  //   - 'path' (specified in amxxpawn.compiler.includePaths setting)
  
"amxxpawn.compiler.includeType ""source"
will look for include folder.
__________________
JusTGo is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-26-2017 , 08:56   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #12

Quote:
Originally Posted by Hedgehog95 View Post
KliPPy,
I mean support of relative paths or special variable for project directory.
Can you define "project directory" precisely? In VSCode there are no projects, but workspaces, which are folders that have been opened in VSCode.
So in VSCode there are two contexts: workspace (which only exists if a folder is opened) and currently opened file.

There are THESE substitution variables available, but they are only available within tasks.json, so that doesn't help us here as they are not resolved/expanded within settings.
There is some talk HERE to support it in settings.json (which can be overriden per-workspace) but it hasn't been implemented yet, nor do extensions have a service to resolve those substitution variables.

I can write a substitution variables resolver I guess, but keep reading this post, what I am about to write may help you.

Quote:
Originally Posted by JusTGo View Post
can you add somthing like this :

PHP Code:
  // Where should compiler. Can be:
  //   - 'source' (same as input)
  //   - 'path' (specified in amxxpawn.compiler.executablePath setting)
  
"amxxpawn.compiler.executableType""source"
if source is set in this case it will look amxxpc.exe in the input folder.

PHP Code:
  // Where should include files. Can be:
  //   - 'source' ( include directory,  relative to input directory )
  //   - 'path' (specified in amxxpawn.compiler.includePaths setting)
  
"amxxpawn.compiler.includeType ""source"
will look for include folder.
I don't think I want to support that, as there is probably no need. If you really have a folder with many files that may use a different compiler, then read THIS. You can create a .vscode/settings.json in your directory and then set your compiler path there.

Also, here is another (and probably better) solution - why not create a BUILD TASK in .vscode/tasks.json for your workspace?
Here's a working example:
Code:
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "Compile Plugin",
            "type": "process",
            "command": "${workspaceRoot}\\amxxpc.exe",
            "args": [
                "${file}",
                "-i${workspaceRoot}\\include",
                "-o${workspaceRoot}\\output\\${fileBasenameNoExtension}.amxx"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}
Now when you open any file in that workspace you can just do Ctrl+Shift+B and it will compile your plugin and put it in the output/ directory.

Last edited by klippy; 08-26-2017 at 09:02.
klippy is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-26-2017 , 09:48   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #13

ok thank build task is what i need.
__________________
JusTGo is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 08-26-2017 , 20:32   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #14

Is there something like this for Visual Studio (full version)?
KiLLeR. is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-26-2017 , 20:54   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #15

Quote:
Originally Posted by KiLLeR. View Post
Is there something like this for Visual Studio (full version)?
Not as far as I know, as there is really no reason.
klippy is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 08-27-2017 , 05:16   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #16

KliPPy
Yes, I'm talking about an opened folder. I know about workspace configs, but anyway I should write absolute path for include directory, so, yep, relative path will be nice.
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-27-2017 , 05:56   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #17

Quote:
Originally Posted by Hedgehog95 View Post
KliPPy
Yes, I'm talking about an opened folder. I know about workspace configs, but anyway I should write absolute path for include directory, so, yep, relative path will be nice.
Can't you use a task? Look at my post again.
If you absolutely need it the way you want it, then I guess I can write a substitution variables resolver.
klippy is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-27-2017 , 08:31   Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Reply With Quote #18

Published version 0.2.1.
Code:
## [Version 0.2.1] - 2017-08-27
### Added
- Handle **#tryinclude** statements and underline if can't resolve, but don't produce an error
- Report unmatched closing braces

### Fixed
- Properly parse and resolve **#include** statements
- Properly handle multiple multiline comments on the same line
- Properly handle multiple braces on the same line
klippy is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 08-27-2017 , 08:47   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #19

KliPPy
I need autocomplete, not a compiler.
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-27-2017 , 08:55   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #20

Quote:
Originally Posted by Hedgehog95 View Post
KliPPy
I need autocomplete, not a compiler.
Ah, gotcha. I'll do something about it.
klippy is offline
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

Forum Jump


All times are GMT -4. The time now is 10:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode