Skip to content

Added a short notice if the server is used interactively #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/arduino/arduino-cli v0.0.0-20220614161710-813cfe73a466
github.com/arduino/go-paths-helper v1.7.0
github.com/fatih/color v1.13.0
github.com/mattn/go-isatty v0.0.14
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
go.bug.st/json v1.15.6
Expand All @@ -28,7 +29,6 @@ require (
github.com/leonelquinteros/gotext v1.4.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"fmt"
"io"
"log"
"net/http"
Expand All @@ -15,6 +16,7 @@ import (
"github.com/arduino/arduino-language-server/ls"
"github.com/arduino/arduino-language-server/streams"
"github.com/arduino/go-paths-helper"
"github.com/mattn/go-isatty"
)

func main() {
Expand Down Expand Up @@ -126,6 +128,16 @@ func main() {

inoHandler := ls.NewINOLanguageServer(stdio, stdio, config)

if isatty.IsTerminal(os.Stderr.Fd()) || isatty.IsCygwinTerminal(os.Stderr.Fd()) {
fmt.Fprint(os.Stderr, `
arduino-language-server is a language server that provides IDE-like features to editors.

It should be used via an editor plugin rather than invoked directly. For more information, see:
https://github.com/arduino/arduino-language-server/
https://microsoft.github.io/language-server-protocol/
`)
}

// Intercept kill signal
c := make(chan os.Signal, 2)
signal.Notify(c, os.Interrupt, os.Kill)
Expand Down