GithubHelp home page GithubHelp logo

pokstad / gomate Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 1.75 MB

Gomate is a set of TextMate CLI tools for working with Go code

License: Other

Go 82.42% Makefile 1.83% CSS 15.75%
textmate gomate golang

gomate's Introduction

CircleCI

Gomate

Gomate is a set of TextMate CLI tools for working with Go code. Inspired by syscrusher/golang.tmbundle.

Gomate embraces the Unix philosophy adopted by Textmate by utilizing simple CLI tool constructs, such as:

  • Command line arguments to indicate desired action
  • Sourcing environment variable for context of operation
  • Reading input from STDIN and producing desired output on STDOUT

Additionally, Gomate is comprised of many smaller packages with dedicated functions to allow for maximum reuse outside the scope of Textmate. For example, you may want to use the note parsing package and build your own extension to a different tool (e.g. VSCode or VIM).

The modular design also encouraged the development of some dedicated CLI tools:

  • notes - provided a path, will scan recursively and return all godoc notes in all packages
    • Installation: go get github.com/pokstad/gomate/notes/notes
    • Usage: $GOPATH/bin/notes [OPTIONS] PACKAGE_PATH

Install

To get the gomate CLI:

go get -u github.com/pokstad/gomate

Then, install the tool's dependencies:

$GOPATH/bin/gomate install

Usage

Until the bundle install is automated, the following needs to be done manually for each bundle command script:

References

To find references to the symbol under the cursor:

#!/bin/bash
gomate references
  • Output: is set to Show in New Window
    • Format: is HTML

External dependencies: guru

Outline

To generate an outline of the current source code file:

#!/bin/bash
gomate outline
  • Input: is set to Selection
    • Format is set to Text
  • Output: is set to Show in New Window
    • Format: is HTML

Get Documentation

To view HTML documentation of the symbol under the cursor:

#!/bin/bash
gomate getdoc
  • Input: is set to Document
    • Format is set to Text
  • Output: is set to Show in New Window
    • Format: is HTML

External dependencies: gogetdoc

Notes

To view a list of gonotes in the current project:

#!/bin/bash
gomate notes
  • Input: Nothing
  • Ouput: Show in New Window
    • Format: HTML

Rename

To rename an identifier:

#!/bin/bash
gomate rename
  • Input: Nothing
  • Output: Discard

External dependencies: gorename

Roadmap

  • Testing coverage and advanced options for individual test functions (similar to VSCode code lense)
  • Reimplement all features of existing Textmate plugin syscrusher/golang.tmbundle
  • Web service to support rich contexts that allow interactions via AJAX calls

gomate's People

Contributors

pokstad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

isgasho

gomate's Issues

General purpose wrapper

Many of the gomate tools provide very similar functionality:

  1. Run an external command
  2. Collect output (stderr and stdout)
  3. Parse output for code location references (e.g. location of compile error) in order to create textmate link.
  4. Generate HTML output for display in Textmate panel.

This general pattern could be adapted into a simple CLI tool that parses command output from stdout and stderr. This would speed up the development of future gomate tools by generalizing the pattern. Some additional requirements:

  1. Stderr should be displayed in separate HTML element to prevent interfering with stdout.
  2. Go conventions should be identified for proper parsing
    1. e.g. Go path convention ("fmt".Printf) or line references ("./code.go:14:13")

Wrapper could be used for gogetdoc, golint, go install, gometalinter, etc.

Feature: gopls integration

Integrate the new experimental gopls tool which provides an LSP client and server for interacting with Go code.

HTML renderers need unit tests

Tests are needed to validate the HTML rendering functions work. Additionally, a method to easily update golden files should be implemented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.