Git Product home page Git Product logo

gocode-subl3's Introduction

Sublime Text 3 plugin

Description

This is a modified version of nsf's Sublime Text 3 plugin , trying to meet my own needs.

golang.sublime-settings Settings

{
    "PATH": "/Users/user/dev/go/bin",
    "GOPATH": "/Users/user/dev/go",

    // Enable gocode autocompletion.
    "autocomplete": true,

    // Enable gocode serverless mode, need github.com/mdempsky/gocode fork
    "gocode_serverless_mode": true
}

Changes

  • 20170914:
    • Use sublime-config to read enviornment variables, otherwise the plugin cannot find gocode binary on macOS.
    • Support mdempsky fork's serverless mode.

Original info

If you want full Go experience in sublime, use GoSublime.

This plugin is written by me (nsf) as a result of frustration with GoSublime. I wanted something simpler and plugin has to use system version of the gocode. As you may know, GoSublime uses a fork of gocode, which is integrated into its own daemon called MarGo (as far as I know).

The plugin does:

  1. Basic gocode autocompletion. I did my best presenting the results to the user. Maybe it's possible to improve that part a bit, not quite sure yet. For functions I use "{class} {name}\t{returns}", for everything else "{class} {name}\t{type}". In addition to that functions are properly augmented with argument snippets.

  2. Gofmt on save. Here I use difflib to calculate differences, which results in line by line changes. GoSublime uses google-diff-match-patch library, which calculates changes on finer granularity, maybe I should switch to that lib as well.

I don't have any big plans on this plugin. The reason why I moved to sublime in the first place is, again, frustration, but with Atom (too slow). We'll see how it goes.

Oh yes, this plugin uses GoSublime syntax files for Go. Well, they use a fork of gocode, I'll use the fork of their syntax files, fair deal.

gocode-subl3's People

Contributors

jostyee avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

yuankunzhang

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.