AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   [Editor] AMXXPawn for Visual Studio Code (https://forums.alliedmods.net/showthread.php?t=300661)

JusTGo 08-26-2017 05:46

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
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.

klippy 08-26-2017 08:56

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
Quote:

Originally Posted by Hedgehog95 (Post 2544411)
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 (Post 2544429)
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.

JusTGo 08-26-2017 09:48

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
ok thank build task is what i need.

KiLLeR. 08-26-2017 20:32

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
Is there something like this for Visual Studio (full version)?

klippy 08-26-2017 20:54

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
Quote:

Originally Posted by KiLLeR. (Post 2544599)
Is there something like this for Visual Studio (full version)?

Not as far as I know, as there is really no reason.

Hedgehog Fog 08-27-2017 05:16

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
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.

klippy 08-27-2017 05:56

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
Quote:

Originally Posted by Hedgehog95 (Post 2544625)
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 08-27-2017 08:31

Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
 
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


Hedgehog Fog 08-27-2017 08:47

Re: [Editor] AMXXPawn for Visual Studio Code
 
KliPPy
I need autocomplete, not a compiler.

klippy 08-27-2017 08:55

Re: [Editor] AMXXPawn for Visual Studio Code
 
Quote:

Originally Posted by Hedgehog95 (Post 2544660)
KliPPy
I need autocomplete, not a compiler.

Ah, gotcha. I'll do something about it.


All times are GMT -4. The time now is 14:33.

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