diff --git a/.gitconfig b/.gitconfig index 868bab7..116c981 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1 +1 @@ -./pls +./protobuf-language-server diff --git a/.gitignore b/.gitignore index 3b9a313..1a9b7ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .idea .DS_Strore -pls +protobuf-language-server diff --git a/README.md b/README.md index bca99d3..ea4e867 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# pls +# protobuf-language-server A language server implementation for Google Protocol Buffers @@ -8,7 +8,7 @@ A language server implementation for Google Protocol Buffers Build binary ```sh -go build -o pls . +go install github.com/lasorda/protobuf-language-server@master ``` Add it to your PATH @@ -20,7 +20,7 @@ Using [coc.nvim](https://github.com/neoclide/coc.nvim), add it to `:CocConfig` ```json "languageserver": { "proto" :{ - "command": "pls", + "command": "protobuf-language-server", "filetypes": ["proto", "cpp"] } } @@ -33,9 +33,9 @@ Using [lsp-config.nvim](https://github.com/neovim/nvim-lspconfig) local configs = require('lspconfig.configs') local util = require('lspconfig.util') -configs.pls = { +configs.protobuf-language-server = { default_config = { - cmd = { 'path/to/pls' }, + cmd = { 'path/to/protobuf-language-server' }, filetypes = { 'proto', 'cpp' }, root_fir = util.root_pattern('.git'), single_file_support = true, @@ -45,7 +45,7 @@ configs.pls = { -- then we can continue as we do with official servers local lspconfig = require('lspconfig') -lspconfig.pls.setup {} +lspconfig.protobuf-language-server.setup {} ``` if you use vscode, see [vscode-extension/README.md](./vscode-extension/README.md) diff --git a/components/completion.go b/components/completion.go index edea2ce..ef403cb 100644 --- a/components/completion.go +++ b/components/completion.go @@ -2,11 +2,12 @@ package components import ( "context" - "pls/proto/view" "strings" "time" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/proto/view" + + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) var ( diff --git a/components/document_symbol.go b/components/document_symbol.go index 97688d0..1008c87 100644 --- a/components/document_symbol.go +++ b/components/document_symbol.go @@ -2,10 +2,10 @@ package components import ( "context" - "pls/proto/view" + "github.com/lasorda/protobuf-language-server/proto/view" - "pls/go-lsp/logs" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) func ProvideDocumentSymbol(ctx context.Context, req *defines.DocumentSymbolParams) (result *[]defines.DocumentSymbol, err error) { diff --git a/components/format.go b/components/format.go index 840a513..3d08ef7 100644 --- a/components/format.go +++ b/components/format.go @@ -8,9 +8,9 @@ import ( "math" "os/exec" "path/filepath" - "pls/proto/view" + "github.com/lasorda/protobuf-language-server/proto/view" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) func Format(ctx context.Context, req *defines.DocumentFormattingParams) (result *[]defines.TextEdit, err error) { diff --git a/components/hover.go b/components/hover.go index 27a3ae3..148958c 100644 --- a/components/hover.go +++ b/components/hover.go @@ -3,12 +3,12 @@ package components import ( "bytes" "context" - "pls/proto/parser" - "pls/proto/view" + "github.com/lasorda/protobuf-language-server/proto/parser" + "github.com/lasorda/protobuf-language-server/proto/view" "strings" "text/template" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" "github.com/emicklei/proto" ) diff --git a/components/jump_definition.go b/components/jump_definition.go index 9b76493..6360bf9 100644 --- a/components/jump_definition.go +++ b/components/jump_definition.go @@ -4,13 +4,13 @@ import ( "context" "errors" "fmt" - "pls/proto/parser" - "pls/proto/view" + "github.com/lasorda/protobuf-language-server/proto/parser" + "github.com/lasorda/protobuf-language-server/proto/view" "regexp" "strings" - "pls/go-lsp/logs" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) type SymbolDefinition struct { diff --git a/go-lsp/example/example b/go-lsp/example/example index 73bf4be..b003a73 100755 Binary files a/go-lsp/example/example and b/go-lsp/example/example differ diff --git a/go-lsp/example/main.go b/go-lsp/example/main.go index befcf3b..c1696f7 100644 --- a/go-lsp/example/main.go +++ b/go-lsp/example/main.go @@ -10,9 +10,9 @@ import ( "os" "strings" - "pls/go-lsp/logs" - "pls/go-lsp/lsp" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) func strPtr(str string) *string { diff --git a/go-lsp/jsonrpc/session.go b/go-lsp/jsonrpc/session.go index d4dc9f5..a16806e 100644 --- a/go-lsp/jsonrpc/session.go +++ b/go-lsp/jsonrpc/session.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - "pls/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" jsoniter "github.com/json-iterator/go" ) diff --git a/go-lsp/lsp/builtin.go b/go-lsp/lsp/builtin.go index bf13c3a..82c1b93 100644 --- a/go-lsp/lsp/builtin.go +++ b/go-lsp/lsp/builtin.go @@ -3,7 +3,7 @@ package lsp import ( "context" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) func (m *Methods) builtinInitialize(ctx context.Context, req *defines.InitializeParams) (defines.InitializeResult, error) { diff --git a/go-lsp/lsp/methods.go b/go-lsp/lsp/methods.go index eece326..7a51b07 100644 --- a/go-lsp/lsp/methods.go +++ b/go-lsp/lsp/methods.go @@ -5,8 +5,8 @@ package lsp // "context" // "fmt" // -// "pls/go-lsp/jsonrpc" -// "pls/go-lsp/lsp/defines" +// "github.com/lasorda/protobuf-language-server/go-lsp/jsonrpc" +// "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" //) // //type Methods struct { diff --git a/go-lsp/lsp/methods.temp.go b/go-lsp/lsp/methods.temp.go index c75f054..4fdc795 100644 --- a/go-lsp/lsp/methods.temp.go +++ b/go-lsp/lsp/methods.temp.go @@ -1,6 +1,6 @@ package lsp -import "pls/go-lsp/lsp/defines" +import "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" type method struct { Name string diff --git a/go-lsp/lsp/methods_gen.go b/go-lsp/lsp/methods_gen.go index 03c846f..1201197 100755 --- a/go-lsp/lsp/methods_gen.go +++ b/go-lsp/lsp/methods_gen.go @@ -4,8 +4,8 @@ package lsp import ( "context" - "pls/go-lsp/jsonrpc" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/jsonrpc" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) type Methods struct { diff --git a/go-lsp/lsp/methods_gen_test.go b/go-lsp/lsp/methods_gen_test.go index 67e3533..771bb93 100644 --- a/go-lsp/lsp/methods_gen_test.go +++ b/go-lsp/lsp/methods_gen_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) type typ_ struct { diff --git a/go-lsp/lsp/option.go b/go-lsp/lsp/option.go index 69b2dcc..3e6fd54 100644 --- a/go-lsp/lsp/option.go +++ b/go-lsp/lsp/option.go @@ -1,6 +1,6 @@ package lsp -import "pls/go-lsp/lsp/defines" +import "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" type Options struct { // if Network is null, will use stdio diff --git a/go-lsp/lsp/server.go b/go-lsp/lsp/server.go index f74ea66..5e5ace7 100644 --- a/go-lsp/lsp/server.go +++ b/go-lsp/lsp/server.go @@ -5,8 +5,8 @@ import ( "net" "reflect" - "pls/go-lsp/jsonrpc" - "pls/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/jsonrpc" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" ) type Server struct { diff --git a/go-lsp/lsp/stdio.go b/go-lsp/lsp/stdio.go index 277daa9..5f7c409 100644 --- a/go-lsp/lsp/stdio.go +++ b/go-lsp/lsp/stdio.go @@ -4,7 +4,7 @@ import ( "io" "os" - "pls/go-lsp/jsonrpc" + "github.com/lasorda/protobuf-language-server/go-lsp/jsonrpc" ) type stdioReaderWriter struct { diff --git a/go.mod b/go.mod index b201f7f..ecf0d27 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module pls +module github.com/lasorda/protobuf-language-server go 1.16 diff --git a/main.go b/main.go index 294c37a..f9afb9c 100644 --- a/main.go +++ b/main.go @@ -7,12 +7,12 @@ import ( "os" "path" - "pls/components" - "pls/proto/view" + "github.com/lasorda/protobuf-language-server/components" + "github.com/lasorda/protobuf-language-server/proto/view" - "pls/go-lsp/logs" - "pls/go-lsp/lsp" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) func strPtr(str string) *string { @@ -29,7 +29,7 @@ func init() { if err != nil { home = "" } - logPath = flag.String("logs", path.Join(home, ".pls.log"), "logs file path") + logPath = flag.String("logs", path.Join(home, ".protobuf-language-server.log"), "logs file path") if logPath == nil || *logPath == "" { logger = log.New(os.Stderr, "", 0) return diff --git a/proto/parser/parser.go b/proto/parser/parser.go index 4a5e3bc..97f118d 100644 --- a/proto/parser/parser.go +++ b/proto/parser/parser.go @@ -3,7 +3,7 @@ package parser import ( "io" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" protobuf "github.com/emicklei/proto" ) diff --git a/proto/parser/proto.go b/proto/parser/proto.go index 8259a81..0f418ee 100644 --- a/proto/parser/proto.go +++ b/proto/parser/proto.go @@ -3,8 +3,8 @@ package parser import ( "sync" - "pls/go-lsp/logs" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" protobuf "github.com/emicklei/proto" ) diff --git a/proto/view/file.go b/proto/view/file.go index 404f2a5..76d91d4 100644 --- a/proto/view/file.go +++ b/proto/view/file.go @@ -4,9 +4,9 @@ import ( "context" "strings" - "pls/proto/parser" + "github.com/lasorda/protobuf-language-server/proto/parser" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" ) // File represents a source file of any type. diff --git a/proto/view/view.go b/proto/view/view.go index 46bb5a2..076f951 100644 --- a/proto/view/view.go +++ b/proto/view/view.go @@ -14,13 +14,13 @@ import ( "sync" "unicode/utf8" - "pls/go-lsp/logs" - "pls/go-lsp/lsp" - "pls/go-lsp/lsp/defines" + "github.com/lasorda/protobuf-language-server/go-lsp/logs" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp" + "github.com/lasorda/protobuf-language-server/go-lsp/lsp/defines" "go.lsp.dev/jsonrpc2" "go.lsp.dev/uri" - "pls/proto/parser" + "github.com/lasorda/protobuf-language-server/proto/parser" ) type view struct { diff --git a/vscode-extension/README.md b/vscode-extension/README.md index 0597ab7..6e2a77a 100644 --- a/vscode-extension/README.md +++ b/vscode-extension/README.md @@ -5,7 +5,7 @@ A language server implementation for Google Protocol Buffers ## how to use 1. Get code from [https://github.com/lasorda/protobuf-language-server](https://github.com/lasorda/protobuf-language-server) -2. Build the target `pls`, add `pls` to `PATH` +2. Build the target `protobuf-language-server`, add `protobuf-language-server` to `PATH` ## features diff --git a/vscode-extension/src/extension.ts b/vscode-extension/src/extension.ts index 296a854..e17870e 100644 --- a/vscode-extension/src/extension.ts +++ b/vscode-extension/src/extension.ts @@ -13,9 +13,9 @@ import { export function activate(context: ExtensionContext) { // The server is implemented in node // const serverModule = context.asAbsolutePath( - // path.join('bin', 'pls') + // path.join('bin', 'protobuf-language-server') // ); - const serverModule = 'pls'; + const serverModule = 'protobuf-language-server'; // let debugOptions = { execArgv: ["--nolazy", "--debug=6004"] }; // If the extension is launched in debug mode then the debug server options are used // Otherwise the run options are used