spadgos / sublime-jsdocs

Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C & C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for PowerShell

lipkau opened this issue · comments

Hi there.

I tried playing around and add PowerShell to the supported languages, but I ended up failed (with my limited python knowledge).
Would it be able to add PowerShell to this repo? I am not sure, as the syntax is quite different (example bellow).
Maybe you could give me some pointers and tips, so that I can add this functionality myself.

Here is an example:

function Set-Foo
{
    <#
        .SYNOPSIS
            Lorem ipsum

        .DESCRIPTION
            Lorem ipsum dolor sit amet

        .INPUTS
            string
            int
            bool

        .OUTPUTS
            bool

        .EXAMPLE
            c:\> Set-Foo "Hello World"
            ---------
            Example 1

        .EXAMPLE
            c:\> Set-Foo "Hello World" 10
            ---------
            Example 2
    #>
    [CmdletBinding()]
    [OutputType([bool])] #Can be an array of possible return types OutputType([bool],[int])
    param
    (
        [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
        [string]$InputObject,

        [int]$number,

        [switch]$boolValue
    )

    #do some stuff
    if ($ok) return $true
    else {return $false}
}

I am currently using a snippet as DocBlock. However, it would be nice if some stuff (.INPUTS and .OUTPUTS) could be populated automatically.

I appreciate any help