Skip to content

Instantly share code, notes, and snippets.

@yamaya
Created August 8, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yamaya/e7f5d5f4711fb0263c13bcb6c053f1f9 to your computer and use it in GitHub Desktop.
Save yamaya/e7f5d5f4711fb0263c13bcb6c053f1f9 to your computer and use it in GitHub Desktop.
patch for mattn/efm-langserver: Fixed a bug when lint-stdin is false
diff --git a/langserver/handler.go b/langserver/handler.go
index 73e9be1..fbe5a8f 100644
--- a/langserver/handler.go
+++ b/langserver/handler.go
@@ -157,11 +157,17 @@ func (h *langHandler) lint(uri string) []Diagnostic {
diagnostics := []Diagnostic{}
+ cmdline := config.LintCommand
+ if !config.LintStdin {
+ cmdline += " "
+ cmdline += fname
+ }
+
var cmd *exec.Cmd
if runtime.GOOS == "windows" {
- cmd = exec.Command("cmd", "/c", config.LintCommand)
+ cmd = exec.Command("cmd", "/c", cmdline)
} else {
- cmd = exec.Command("sh", "-c", config.LintCommand)
+ cmd = exec.Command("sh", "-c", cmdline)
}
if config.LintStdin {
cmd.Stdin = strings.NewReader(f.Text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment