diff --git a/lsp/format_range_server_test.go b/lsp/format_range_server_test.go index 6e25a50..1167c96 100644 --- a/lsp/format_range_server_test.go +++ b/lsp/format_range_server_test.go @@ -8,7 +8,7 @@ import ( "go.lsp.dev/protocol" "go.lsp.dev/uri" - "github.com/karitham/thrift-ls/lsp/mapper" + "github.com/karitham/thrift-ls/mapper" ) func TestServerRangeFormatting(t *testing.T) { diff --git a/lsp/lsptest/model.go b/lsp/lsptest/model.go index b075e6c..2ab4946 100644 --- a/lsp/lsptest/model.go +++ b/lsp/lsptest/model.go @@ -4,7 +4,7 @@ package lsptest // tests need to aim cursors at code. Tests see these plain types only; // translation from protocol types happens at the harness boundary. // Anything with real semantics, such as UTF-16 position math or edit -// application, is reused from lsp/mapper rather than reimplemented here. +// application, is reused from mapper rather than reimplemented here. import ( "fmt" @@ -12,7 +12,7 @@ import ( "go.lsp.dev/protocol" - "github.com/karitham/thrift-ls/lsp/mapper" + "github.com/karitham/thrift-ls/mapper" ) // Position is a zero-based line/character position; character counts UTF-16 diff --git a/lsp/lsptest/server.go b/lsp/lsptest/server.go index 7745d98..83a1cf6 100644 --- a/lsp/lsptest/server.go +++ b/lsp/lsptest/server.go @@ -19,7 +19,7 @@ import ( "go.lsp.dev/protocol" "go.lsp.dev/uri" - "github.com/karitham/thrift-ls/lsp/mapper" + "github.com/karitham/thrift-ls/mapper" ) const ( diff --git a/lsp/source/format.go b/lsp/source/format.go index a2adff4..2f720f5 100644 --- a/lsp/source/format.go +++ b/lsp/source/format.go @@ -8,7 +8,7 @@ import ( "go.lsp.dev/protocol" "github.com/karitham/thrift-ls/formatter" - "github.com/karitham/thrift-ls/lsp/mapper" + "github.com/karitham/thrift-ls/mapper" "github.com/karitham/thrift-ls/store" "github.com/karitham/thrift-ls/vfs" ) diff --git a/main.go b/main.go index 105951c..20d214f 100644 --- a/main.go +++ b/main.go @@ -347,6 +347,11 @@ func dumpIncludes(ctx context.Context, file string, cmd *cli.Command) error { return err } + // Usage and file errors beat config errors, mirroring formatAction. + if _, err := os.Stat(abs); err != nil { + return err + } + cfg, err := loadConfig(cmd.String("config"), filepath.Dir(abs)) if err != nil { return err diff --git a/lsp/mapper/apply.go b/mapper/apply.go similarity index 100% rename from lsp/mapper/apply.go rename to mapper/apply.go diff --git a/lsp/mapper/apply_test.go b/mapper/apply_test.go similarity index 100% rename from lsp/mapper/apply_test.go rename to mapper/apply_test.go diff --git a/lsp/mapper/mapper.go b/mapper/mapper.go similarity index 100% rename from lsp/mapper/mapper.go rename to mapper/mapper.go diff --git a/lsp/mapper/mapper_fuzz_test.go b/mapper/mapper_fuzz_test.go similarity index 100% rename from lsp/mapper/mapper_fuzz_test.go rename to mapper/mapper_fuzz_test.go diff --git a/lsp/mapper/mapper_test.go b/mapper/mapper_test.go similarity index 100% rename from lsp/mapper/mapper_test.go rename to mapper/mapper_test.go diff --git a/store/parse.go b/store/parse.go index fcb3610..eef11c2 100644 --- a/store/parse.go +++ b/store/parse.go @@ -7,7 +7,7 @@ import ( "go.lsp.dev/uri" - "github.com/karitham/thrift-ls/lsp/mapper" + "github.com/karitham/thrift-ls/mapper" "github.com/karitham/thrift-ls/syntax" "github.com/karitham/thrift-ls/vfs" )