Skip to content

Would be nice to have support for docblocks like you do in PHP #3

Closed

Description

@ProLoser
No description provided.

Activity

  1. whitlockjc commented on Mar 16, 2014

    @whitlockjc
    Member

    The issue is there is no language specific documentation format for JavaScript and to make the problem worse, there are conflicting options out there. Off the top of my head, there's JSDoc and YUIDoc but thankfully both are similar enough so to add some generic support. What do you think of this:

    • Scoping tags (Example: @param)
    • Scoping tag arguments, where possible (Example: Scoping the type and name of the param tag)

    Any feedback you can provide will help me make a decision on how to do this.

  2. ryanfitzer commented on Feb 11, 2016

    @ryanfitzer

    I created a grammar in my personal bundle to give very simple support for docblocks:

    {   patterns = (
            {   name = 'comment.block.documentation.jsdoc';
                begin = '(/\*\*)\s*$';
                end = '\*/';
                beginCaptures = { 1 = { name = 'punctuation.definition.comment.begin.jsdoc'; }; };
                endCaptures = { 0 = { name = 'punctuation.definition.comment.end.jsdoc'; }; };
                patterns = (
                    {   include = '#inline'; },
                    {   name = 'meta.documentation.tag.jsdoc';
                        begin = '(\@)(\S+)';
                        end = '(?=^\s*\*?\s*@|\*/)';
                        beginCaptures = {
                            1 = { name = 'punctuation.definition.keyword.jsdoc'; };
                            2 = { name = 'keyword.other.documentation.$2.jsdoc'; };
                        };
                        patterns = ( { include = '#inline'; } );
                    },
                    {   match = '((\@)\S+)\s';
                        captures = {
                            1 = { name = 'keyword.other.documentation.custom.jsdoc'; };
                            2 = { name = 'punctuation.definition.keyword.jsdoc'; };
                        };
                    },
                );
            },
        );
        repository = {
            inline = { patterns = ( { include = '#inline-formatting'; } ); };
            inline-formatting = { patterns = ( ); };
        };
    }
    

    Here's the preview:

    screen shot 2016-02-11 at 1 14 25 pm

    If you think it would be useful in this bundle, I'd be interested in making it more robust.

  3. infininight commented on Jul 30, 2016

    @infininight
    Member

    Basic support has been added, currently matches the blocks and tags used by JSDoc.

  4. ryanfitzer commented on Aug 4, 2016

    @ryanfitzer

    Thanks for adding in some support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions