kurtosis-tech / kurtosis

A platform for packaging and launching ephemeral backend stacks with a focus on approachability for the average developer.
https://docs.kurtosistech.com/
Apache License 2.0
382 stars 55 forks source link

Add parsing of docstring (args, return) to VSCode extension #2514

Open tedim52 opened 4 months ago

tedim52 commented 4 months ago

Background & motivation

When writing Starlark, I have to go to the github repo of a package I'm importing to know what I can pass into it and what it returns. eg.

postgres = import_module("github.com/kurtosis-tech/postgres-package/main.star")
grafana = import_module("./grafana-package/main.star")

def run(plan, args):
    postgres_service = postgres.run(plan)

    db = {
        "URL": postgres_service. <---- now I need to go to github to see if postgres package returns some URL info on the `postgres_service`
    }
    grafana.run(plan, 
    postgres_database=[db])

Desired behaviour

It would be great if the vscode extension could parse the (args, return) of a package via its docstring (eg. the postgres package

postgres = import_module("github.com/kurtosis-tech/postgres-package/main.star")
grafana = import_module("./grafana-package/main.star")

def run(plan, args):
    postgres_service = postgres.run(plan, <-- insert autocomplete to fill in all the args that need to be populated)

    db = {
        "URL": postgres_service. <--- insert VSCode intellisense drop down allowing me to select what fields to take
    }
    grafana.run(plan, 
    postgres_database=[db])

How important is this to you?

Painful; the lack of this feature makes using Kurtosis frictionful.

What area of the product does this pertain to?

SDK: the Software Development Kit libraries - Typescript, Go, etc.