diff --git a/flake.nix b/flake.nix index 8f466eb..c589a65 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ "aarch64-windows" ] (system: let - version = "0.1.2"; # CI:CD-VERSION + version = "0.1.3"; # CI:CD-VERSION pkgs = import nixpkgs { inherit system; overlays = [ diff --git a/server/common/log.go b/server/common/log.go new file mode 100644 index 0000000..4c48483 --- /dev/null +++ b/server/common/log.go @@ -0,0 +1,5 @@ +package common + +import "github.com/tliron/commonlog" + +var Log = commonlog.GetLogger("config-lsp") diff --git a/server/common/options.go b/server/common/options.go new file mode 100644 index 0000000..35773e0 --- /dev/null +++ b/server/common/options.go @@ -0,0 +1,25 @@ +package common + +import ( + "os" + "slices" +) + +// Global options for the server +type ServerOptionsType struct { + // If true, the server will not return any errors if the + // language was undetectable. + // This is used for example in the VS Code extension, where + // we show a native warning. The error message boxes just clutter + // the interface. + NoUndetectableErrors bool +} + +var ServerOptions = new(ServerOptionsType) + +func InitServerOptions() { + if slices.Contains(os.Args, "--no-undetectable-errors") { + Log.Info("config-lsp will not return errors for undetectable files") + ServerOptions.NoUndetectableErrors = true + } +} diff --git a/server/handlers/ssh_config/analyzer/values.go b/server/handlers/ssh_config/analyzer/values.go index e10321f..49b7e1e 100644 --- a/server/handlers/ssh_config/analyzer/values.go +++ b/server/handlers/ssh_config/analyzer/values.go @@ -8,6 +8,7 @@ import ( func analyzeValuesAreValid( ctx *analyzerContext, ) { + // Check if there are unknown options for _, info := range ctx.document.Config.GetAllOptions() { option := info.Option block := info.Block diff --git a/server/root-handler/common.go b/server/root-handler/common.go index 7ef05c8..765c794 100644 --- a/server/root-handler/common.go +++ b/server/root-handler/common.go @@ -2,4 +2,4 @@ package roothandler // The comment below at the end of the line is required for the CI:CD to work. // Do not remove it -var Version = "0.1.2" // CI:CD-VERSION +var Version = "0.1.3" // CI:CD-VERSION diff --git a/vs-code-extension/package.json b/vs-code-extension/package.json index 82a9b0c..fca8036 100644 --- a/vs-code-extension/package.json +++ b/vs-code-extension/package.json @@ -2,7 +2,7 @@ "name": "config-lsp", "description": "Language Features (completions, diagnostics, etc.) for your config files: gitconfig, fstab, aliases, hosts, wireguard, ssh_config, sshd_config, and more to come!", "author": "Myzel394", - "version": "0.1.2", + "version": "0.1.3", "repository": { "type": "git", "url": "https://github.com/Myzel394/config-lsp"