aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-14 00:50:01 -0800
committerAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-14 00:50:01 -0800
commit8bb6448e79e94e8d1bca715d8dda3ce6e850bf18 (patch)
treede22c9d3e2636259464a7d71c00938370ec627c9 /CONTRIBUTING.md
parentBugfix (diff)
downloadnvim-lspconfig-8bb6448e79e94e8d1bca715d8dda3ce6e850bf18.tar
nvim-lspconfig-8bb6448e79e94e8d1bca715d8dda3ce6e850bf18.tar.gz
nvim-lspconfig-8bb6448e79e94e8d1bca715d8dda3ce6e850bf18.tar.bz2
nvim-lspconfig-8bb6448e79e94e8d1bca715d8dda3ce6e850bf18.tar.lz
nvim-lspconfig-8bb6448e79e94e8d1bca715d8dda3ce6e850bf18.tar.xz
nvim-lspconfig-8bb6448e79e94e8d1bca715d8dda3ce6e850bf18.tar.zst
nvim-lspconfig-8bb6448e79e94e8d1bca715d8dda3ce6e850bf18.zip
Add contributing docs and clangd config.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md78
1 files changed, 78 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..ed953344
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,78 @@
+# Requirements
+
+- Neovim :P
+- The docgen requires \*nix systems for now.
+
+# Generating docs
+
+`scripts/docgen.lua` was written with the intention of being sourced (like with `luafile`)
+from `nvim` to run.
+
+It **must** be run from the .git/project root. This could be modified to try to
+find the .git root with one of our `util.*` functions potentially.
+
+So you can either run nvim with cwd at the project root, or run `nvim +"luafile
+scripts/docgen.lua" +q` from the project root.
+
+This generates a suffix for README.md
+
+# skeleton
+
+skeleton has a `__newindex` metamethod which validates and creates
+an object containing `setup()`, which can then be retrieved and modified.
+
+In vim.validate parlance, this is the format to use.
+
+```
+skeleton.SERVER_NAME = {
+ default_config = {'t'};
+ on_new_config = {'f', true};
+ on_attach = {'f', true};
+ commands = {'t', true};
+ docs = {'t', true};
+}
+docs = {
+ description = {'s', true};
+ default_config = {'t', true};
+}
+```
+
+The docs `default_config` is a table whose keys match the other `default_config`,
+and can be used to specify a string in place of using `vim.inspect(value)` to
+generate the documentation. This is useful for functions, whose output would
+be unhelpful otherwise.
+
+`commands` is a table of key/value pairs from `command_name -> {definition}`.
+The format of `{definition}` is a table where the first array value
+is a function which will be called for this command. The other table values
+are either array values which will be formed into flags for the command or
+special keys like `description`.
+
+Example:
+
+```
+ commands = {
+ TexlabBuild = {
+ function()
+ buf_build(0)
+ end;
+ "-range";
+ description = "Build the current buffer";
+ };
+ };
+```
+
+
+After you create a `skeleton.SERVER_NAME`, you can add functions to it that you
+wish to expose to the user.
+
+Example:
+
+```
+skeleton.texlab.buf_build = buf_build
+```
+
+After you create a skeleton, you have to `require 'common_lsp/SERVER_NAME'` in
+`lua/common_lsp.lua`, and that's it.
+
+Generate docs and you're done.