Created
August 8, 2019 16:33
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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