Sarrus1 / sourcepawn-studio

VSCode extension for SourcePawn scripting
https://sarrus1.github.io/sourcepawn-studio/
MIT License
139 stars 21 forks source link

Add outputDirectoryPath as optional availableAPIs param #379

Closed nikooo777 closed 2 months ago

nikooo777 commented 2 months ago

What do you want to see added to the extension?

Similarly to how SPedit handled configurations, it would be nice if I could specify a custom outputDirectoryPath directory for each API definition. Something like this:

"sourcepawn.availableAPIs": [
        {
            "name": "SM-1.11",
            "includesDirectories": [
                "C:/path/to/sm_1_11/include",
            ],
            "spcompPath": "C:/path/to/sm_1_11/spcomp64.exe",
            "compilerArguments": [],
            "outputDirectoryPath": "C:/path/to/compiled_1_11/",
            "linterArguments": []
        },
        {
            "name": "SM-1.10",
            "includesDirectories": [
                "C:/path/to/sm_1_10/include",
            ],
            "spcompPath": "C:/path/to/sm_1_10/spcomp.exe",
            "compilerArguments": [],
            "outputDirectoryPath": "C:/path/to/compiled_1_10/",
            "linterArguments": []
        }
    ],

An alternative to adding support for this param would be adding support for variables such as %filename% or %basename% so that one could do the following:

            "compilerArguments": [
                "-oC:/path/to/compiled_1_11/%filename%.smx"
            ],

How would it help you?

I like to keep my plugins separated, if they were compiled with an older version of SM I'd want the plugin to be in that folder. This is so that I can support older plugins that aren't necessarily compatible with the new APIs.

How often would you use this feature?

I just migrated from Spedit (I was oblivious to this awesome extension!!!!) and I use it every time I'm writing plugins.

Thank you for your exceptional effort!

maxijabase commented 2 months ago

Will look into it!

Sarrus1 commented 2 months ago

This was implemented, thanks @maxijabase !