Skip to content

Proposal: Add the ability to include external tools in the save process #13

@WolfGangS

Description

@WolfGangS

The past 20+ years of scripting in sl have lead to a wealth of tools and personalized workflows.

This plugin could never accommodate them all so instead it would be nice to allow people to keep using some of their tools if they so wish.

I propose adding some configuration that the plugin would read, and during the save process, before and or after the preprocessor (enabeld or not) is run, the plugin executes given commands and takes their output.

Example

Say the following format is used for config

{
    "slVscodeEdit.externalTooling.afterPreProcessor": [
        {
            "command": "python ~/lsl/lsl-pyoptimizer/main.py --bom {inputFile}",
            "input": "file",
            "output": "std",
            "languages": ["lsl"]
        }
    ]
}

On save the plugin would :

  1. Run the built in preprocessor (if enabled)
  2. Check config for steps to run
    • Filter for ones that match langauge
  3. Find the step, check it's input and output types - If input is file save the script content to a temporary file
    • If output is file, generate a temporary filename
  4. Execute the command filling in relevant tokens and piping script through stdin if needed
  5. Read the response in std out / once command is complete from {outputFile}
  6. Continue as the script sync to the viewer as normal with the new output

This should allow scripters with more advanced workflows to implement their process, while getting the benefits of the plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions