Commit graph

146 commits

Author SHA1 Message Date
duianto dd8e611158
Replace obsolete lsp-prefer-flymake with lsp-diagnostic-package 2020-02-21 23:19:20 +01:00
pancho horrillo 1fa28b345c [go] Update build instructions for golangci-lint
See #10825.

Try to match more closely the build process followed upstream:

- Force module build mode, which builds the latest stable release (not master),
and takes care of module replacements.

- Disable cgo.

- The -trimpath argument to go get requires go >= 1.13, which is also needed
because go <= 1.12 has a bug that causes problems with golangci-lint², as
explained in the golangci-lint installation instructions².

Note that the only thing that is missing to exactly match the upstream build
process is the addition of some -X variables, which only affect the data
reported by golangci-lint version.

¹: https://github.com/golang/go/issues/29612
²: https://github.com/golangci/golangci-lint#install

Thanks to @dbriemann and @seriousben for reporting and clarifying this issue!
2019-12-28 20:29:01 +01:00
zhuoyikang 35de1f6db0
[go] Add missing linters to flycheck-disabled-checkers
I have added go-staticcheck and go-unconvert to list of
disabled checkers.
2019-12-15 15:28:53 +01:00
Seong Yong-ju 2e7a5c5929 Do not use go-eldoc for LSP backend 2019-11-17 16:45:39 +01:00
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.

The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.

* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
  except for distribution layers (we declare layer dependencies right away in
  distribution layers)
2019-09-30 02:00:48 -04:00
syl20bnr ac30247811 [lsp] When used, make LSP the default backend for all supported lang
* Added a new function to each language to select the backend
* Use these new functions in all `pcase`.
2019-09-30 00:49:44 -04:00
emacspace 560b51c324 documentation formatting: Thu Sep 12 15:09:22 UTC 2019 2019-09-12 21:44:20 +02:00
Mathieu ab9acc0810 Fixed go-run-test-current-function for go test and gocheck 2019-09-12 15:25:57 +02:00
pancho horrillo a7e27370e6 [go] Cleanup README.org
- Consolidate pre-requisites
- Revise document structure
- Clarify setup instructions
- Link key bindings to their supporting tools
- Remove ancient notes on go-oracle
- Fix typos
- Style fixes
- Apply suggestions from code review by @duianto

Thanks to @duianto for the comprehensive review!

Co-Authored-By: duianto <otnaiud@gmail.com>
2019-09-12 14:25:51 +02:00
pancho horrillo 4c1245e8c5 [go] Drop support for deprecated gometalinter
gometalinter¹ was deprecated on 2019-02-28, in favor of the more advanced
golangci-lint.

. Drop references to gometalinter from README.org
. Update reference to available meta-linter (golangci-lint) in LAYERS.org
. Add attribution in CHANGELOG.develop

¹: https://github.com/alecthomas/gometalinter
2019-09-05 20:49:43 +02:00
pancho horrillo 877f577bab [go] Update doc on LSP setup.
`gopls` is Google’s upcoming Go language server; the other implementation
mentioned in the `lsp-mode` doc¹ has been discontinued².

So, I've added the recommended procedure³ to install `gopls`.

¹: https://github.com/emacs-lsp/lsp-mode/
²: https://github.com/saibing/bingo
³: https://github.com/golang/go/wiki/gopls
2019-08-26 17:58:51 +02:00
Mathieu 272c96d855 Add Testify support for layers/+lang/go 2019-08-21 21:25:49 +02:00
Robert Zaremba d642095380 layer/+lang/go: refactore go-linter setup 2019-07-11 19:22:18 +02:00
emacspace c7c348a676 documentation formatting: Sun May 26 20:58:52 UTC 2019 2019-05-27 01:23:35 +03:00
Anton-Latukha f6660f82d4
Switch to the new layers generator 2019-05-15 21:08:21 +03:00
Anton-Latukha ba074bc908 layers: lang: new structure: general: add pure, multi-paradigm (&js) 2019-05-15 21:04:48 +03:00
JAremko 77c680160e Add placeholder tags 2019-05-05 20:40:47 +03:00
Seong Yong-ju 610ecbbf70 Add godoc installation into go layer README 2019-04-17 15:37:52 +02:00
smile13241324 350dbf6373 Move go "generate" prefix declaration to "go-gen-test" init 2019-04-07 08:43:18 +02:00
Seong Yong-ju 9941c60b5c Add missing prefixes in go-mode 2019-04-05 23:21:15 +02:00
Enze Chi 21c442050a Add go-run-args to pass command line arguments to go run
When executing the main function which requires command line arguments, user can
set `go-run-args` to pass command line arguments to compiled binary.

The example below demonstrates how to pass command line arguments by setting
`go-run-args` as file local variable:

package main

import (
	"fmt"
	"os"
	"strconv"
)

func main() {
	//Atoi converts a string to an int
	fmt.Println("Arguments:", os.Args)
	a, _ := strconv.Atoi(os.Args[1])
	b, _ := strconv.Atoi(os.Args[2])

	result := sum(a, b)
	fmt.Printf("The sum of %d and %d is %d\n", a, b, result)
}

func sum(a, b int) int {
	return a + b
}

// Local Variables:
// go-run-args: "10 5"
// End:
2019-04-05 22:59:17 +02:00
Tim Heckman e84bd90262 Set lsp-prefer-flymake to :none when Go layer is using LSP
When switching the Go layer to use the LSP backend with `golangci-lint`, I
noticed that none of my linter errors were being rendered with my source code.
Digging in further, I eventually learned it was due to `lsp-prefer-flymake`
being set to `nil` and not `:none`.

This change updates the Go layer, when using LSP and golangci-lint, to set
`lsp-prefer-flymake` to `:none`. If this is not set, the golangci-lint errors
will not be reported.

This is an alternative to #12043.

Fixes #11680

Signed-off-by: Tim Heckman <t@heckman.io>
2019-04-04 12:46:49 +02:00
Enze Chi 004d407908 Add toggle control for verbose go test output 2019-04-04 12:17:53 +02:00
Justin f8bb6997a9 Remove lsp-javascript-typescript package for lsp built in.
Remove lsp-go package for lsp built in.
Changed go/react/typescript lsp-*-enable hooks to lsp
Update go/typescript/rust layer docs for lsp-mode installation command.
Remove unused rust layer variable
2019-01-15 00:41:30 +02:00
emacspace 0631e44895 documentation formatting: Sun Jan 13 19:53:55 UTC 2019 2019-01-13 21:57:17 +02:00
syl20bnr 7cc06ce63e Update change logs
Thank you everybody for participating in #11741 in order to make this
possible!
2019-01-13 16:32:47 +02:00
emacspace 45276bd96f documentation formatting: Wed Dec 5 03:03:03 UTC 2018 2018-12-04 22:06:14 -05:00
Josh Greenwood b8d5555340
fixes typo. s/with/wish 2018-10-16 09:20:16 +03:00
JAremko cd39f80c24 Reformat documentation 2018-10-11 00:13:43 +03:00
Andriy Senyshyn 24d5607b7b Update gocode repo
nsf/gocode is not maintained anymore. change to https://github.com/mdempsky/gocode
2018-08-28 21:59:29 +01:00
Lupco Kotev 25be8ecb62 Update documentation to include golangci-lint 2018-08-20 23:03:45 +01:00
Lupco Kotev 1d49cd7ed8 Add golangci-lint support 2018-08-20 23:03:45 +01:00
Ljupcho Kotev 107833af16 Remove unnecessary company-go function 2018-08-16 12:01:38 +01:00
Ljupcho Kotev 81865e1ea2 Change backend name from default to go-mode 2018-08-16 00:39:17 +03:00
Lupco Kotev bb3e3b2103 Add lsp support for go 2018-08-16 00:39:17 +03:00
lawr 591fe78eec go-layer: supoort set-tab-width equal nil to work with editorconfig 2018-08-10 00:36:46 +03:00
Robby O'Connor c3e402332f go layer: fix cosmetic issue 2018-08-02 00:20:24 +01:00
Jon Erik D Suero ff555d80b4 Add key binding to run gofmt manually 2018-08-01 17:54:27 -04:00
Jon Erik D Suero 166f6768ae go: add toggle for gofmt before save and turn it off by default 2018-08-01 17:52:03 -04:00
JAremko 6946e255e6 Reformat docs 2018-07-20 02:45:21 +03:00
fiveNinePlusR 75f1d915a8 [CORE] synchronize the environment variables from the default shell 2018-06-14 20:12:26 -04:00
Josh Santos 7944ed2634 Fix environment variable setting for go and rust layers 2018-06-09 01:22:56 -04:00
syl20bnr b04cce06b2 go: defer loading of various packages 2018-06-09 01:11:41 -04:00
syl20bnr 9fc1883b4b go: fix bad quoting of go-packages-function 2018-06-09 01:10:03 -04:00
syl20bnr aedceddd92 go: cleanup layer sorting stuff and using idiomatic constructs 2018-06-09 01:09:11 -04:00
Cosmin Cojocar d47f9267e9 go: add support for go-impl in refactoring menu 2018-06-09 01:04:23 -04:00
syl20bnr f12b849993 go: sort packages.el and update README 2018-06-09 00:58:50 -04:00
Cosmin Cojocar 80dbae3825 go: add option in refactoring to fill a structure with default values 2018-06-09 00:51:33 -04:00
syl20bnr ae53d9612e go: update feature section with gopkgs 2018-06-09 00:49:07 -04:00
syl20bnr 0e0d5088b9 go: remove unused function load-gopath-file 2018-06-09 00:45:48 -04:00