From 99339f3edd406f6fc2dc41cd74ae5c082fe75561 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:50:50 +0200 Subject: [PATCH] chore(sshd_config): Add some documentation --- handlers/sshd_config/README.md | 6 ++++++ handlers/sshd_config/analyzer/README.md | 3 +++ handlers/sshd_config/ast/README.md | 16 ++++++++++++++++ handlers/sshd_config/fields/README.md | 7 +++++++ handlers/sshd_config/handlers/README.md | 5 +++++ handlers/sshd_config/indexes/README.md | 9 +++++++++ handlers/sshd_config/lsp/README.md | 7 +++++++ 7 files changed, 53 insertions(+) create mode 100644 handlers/sshd_config/README.md create mode 100644 handlers/sshd_config/analyzer/README.md create mode 100644 handlers/sshd_config/ast/README.md create mode 100644 handlers/sshd_config/fields/README.md create mode 100644 handlers/sshd_config/handlers/README.md create mode 100644 handlers/sshd_config/indexes/README.md create mode 100644 handlers/sshd_config/lsp/README.md diff --git a/handlers/sshd_config/README.md b/handlers/sshd_config/README.md new file mode 100644 index 0000000..36acfb0 --- /dev/null +++ b/handlers/sshd_config/README.md @@ -0,0 +1,6 @@ +# /sshd_config + +This is the root directory for each of the handlers. +This folder should only contain the antlr grammar file, +shared libraries, variables, etc. and folders for each +logic part. \ No newline at end of file diff --git a/handlers/sshd_config/analyzer/README.md b/handlers/sshd_config/analyzer/README.md new file mode 100644 index 0000000..dfd445c --- /dev/null +++ b/handlers/sshd_config/analyzer/README.md @@ -0,0 +1,3 @@ +# /sshd_config/analyzer + +This folder analyzes the config file and returns errors, warnings, and suggestions. \ No newline at end of file diff --git a/handlers/sshd_config/ast/README.md b/handlers/sshd_config/ast/README.md new file mode 100644 index 0000000..dea10a4 --- /dev/null +++ b/handlers/sshd_config/ast/README.md @@ -0,0 +1,16 @@ +# /sshd_config/ast + +This folder contains the AST (Abstract Syntax Tree) for the handlers. +The AST is defined in a filename that's the same as the handler's name. + +Each AST node must extend the following fields: + +```go +type ASTNode struct { + common.LocationRange + Value commonparser.ParsedString +} +``` + +Each node should use a shared prefix for the node name, +e.g. `SSHDConfig`, `SSDKey` for the `sshd_config` handler. \ No newline at end of file diff --git a/handlers/sshd_config/fields/README.md b/handlers/sshd_config/fields/README.md new file mode 100644 index 0000000..00637d9 --- /dev/null +++ b/handlers/sshd_config/fields/README.md @@ -0,0 +1,7 @@ +# /sshd_config/fields + +This folder contains the glue between the config documentation and +our language server. + +`fields.go` usually contains a list of all the available options / fields +the config file offers. \ No newline at end of file diff --git a/handlers/sshd_config/handlers/README.md b/handlers/sshd_config/handlers/README.md new file mode 100644 index 0000000..1d8e185 --- /dev/null +++ b/handlers/sshd_config/handlers/README.md @@ -0,0 +1,5 @@ +# /sshd_config/handlers + +This folder contains the actual logic for the LSP commands. +Stuff like fetching completions, executing commands, getting hover +definitions, etc. should be done here. \ No newline at end of file diff --git a/handlers/sshd_config/indexes/README.md b/handlers/sshd_config/indexes/README.md new file mode 100644 index 0000000..116a37f --- /dev/null +++ b/handlers/sshd_config/indexes/README.md @@ -0,0 +1,9 @@ +# /sshd_config/indexers + +This folder contains logic for indexing the AST. + +Creating the indexer fulfills two purposes: +* Creating actual indexes +* Validating some logic + +The indexer also validates stuff like checking for duplicate values, etc. \ No newline at end of file diff --git a/handlers/sshd_config/lsp/README.md b/handlers/sshd_config/lsp/README.md new file mode 100644 index 0000000..2aa9542 --- /dev/null +++ b/handlers/sshd_config/lsp/README.md @@ -0,0 +1,7 @@ +# /sshd_config/lsp + +This folder is the glue between our language server and the LSP +clients. +This folder only contains LSP commands. +It only handles very little actual logic, and instead calls +the handlers from `../handlers`. \ No newline at end of file