joelday / papyrus-lang

📜Advanced language tools for the Papyrus scripting language.
Other
105 stars 19 forks source link

Proposal for better handling SkyrimSE source and import paths #95

Closed rjstone closed 4 years ago

rjstone commented 4 years ago

Is your feature request related to a problem? Please describe.

The sse papyrus compiler doesn't support .PPJ files. However, the language server really needs a way to be able to load the intended directories for Source and Import and the build task configs need these also.

Describe the solution you'd like

A typical build task for SSE papyrus looks like this (due to lack of PPJ support):

{
//...
    "tasks": [
        {
            "label": "Compile Papyrus (All)",
            "type": "process",
            "command": "${config:papyrus.skyrimSpecialEdition.installPath}\\Papyrus Compiler\\PapyrusCompiler.exe",
            "args": [ 
                "Source\\Scripts",
                "-i=Source\\Scripts;${config:papyrus.skyrimSpecialEdition.installPath}\\Data\\Source\\Scripts",
                "-o=Scripts",
                "-f=TESV_Papyrus_Flags.flg",
                "-all",
                ]
// ...
       }
   ]
// ...
}

But this hardcodes values in a way that the language server can't hope to find them.

Since vscode provides us with .code-workspace that can contain configuration options that override the global config options, I suggest adding options for Source and Scripts so 1) the language server can find the configuration information and 2) they can be easily included in things like build tasks.

That would both enable the language server and papyrus compiler to access the information more easily. Currently the language server can read the PPJ, but the build task config can't.

So the build task config could look more like this if the options were added:

            "args": [ 
                "${config:papyrus.skyrimSpecialEdition.scriptPath}",
                "-i=${${config:papyrus.skyrimSpecialEdition.importPath};${config:papyrus.skyrimSpecialEdition.installPath}\\Data\\Source\\Scripts",
                "-o=${config:papyrus.skyrimSpecialEdition.outputPath}",
                "-f=TESV_Papyrus_Flags.flg",
                "-all",
                ],

In short, use .code-workspace instead of ppj for skyrim and skyrimse. (Not sure how many people would actually use this for oldrim though so that seems safe to ignore until someone shows that it's being used).

Describe alternatives you've considered

Trying to read stuff from the .PPJ and generate the tasks.json. This would have to be re-run every time the PPJ was changed and is more roundabout.

Additional context All I can say is that due to SkyrimSE not getting "upgraded" with new stuff that was added for FO4 there is some skew like this between how the games are handled. Thus we're dealing with trying to use the official project config method for FO4 while trying to add one to SSE which doesn't have one.

rjstone commented 4 years ago

We're just using PPJ files now so this can be closed.