diff options
author | Patrice Peterson <patrice.peterson@mailbox.org> | 2020-08-19 18:17:08 +0200 |
---|---|---|
committer | Patrice Peterson <patrice.peterson@mailbox.org> | 2020-08-23 13:48:25 +0200 |
commit | ac05343a1023874243ee9fdd490c21c42a737157 (patch) | |
tree | 2466eb3c28b09b8e77ba7e1d3696555672fbb38e /runtime/lua/vim/lsp/log.lua | |
parent | 8c49e3d50959e24dadd688f56a18f104bd5fd934 (diff) | |
download | rneovim-ac05343a1023874243ee9fdd490c21c42a737157.tar.gz rneovim-ac05343a1023874243ee9fdd490c21c42a737157.tar.bz2 rneovim-ac05343a1023874243ee9fdd490c21c42a737157.zip |
Add docs for most vim.lsp methods
Most of the lsp.log will be addressed in a separate PR.
Diffstat (limited to 'runtime/lua/vim/lsp/log.lua')
-rw-r--r-- | runtime/lua/vim/lsp/log.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/log.lua b/runtime/lua/vim/lsp/log.lua index 696ce43a59..f19367851f 100644 --- a/runtime/lua/vim/lsp/log.lua +++ b/runtime/lua/vim/lsp/log.lua @@ -21,12 +21,14 @@ local log_date_format = "%FT%H:%M:%S%z" do local path_sep = vim.loop.os_uname().sysname == "Windows" and "\\" or "/" + --@private local function path_join(...) return table.concat(vim.tbl_flatten{...}, path_sep) end local logfilename = path_join(vim.fn.stdpath('data'), 'lsp.log') - --- Return the log filename. + --- Returns the log filename. + --@returns (string) log filename function log.get_filename() return logfilename end @@ -74,6 +76,8 @@ end -- interfere with iterating the levels vim.tbl_add_reverse_lookup(log.levels) +--- Sets the current log level. +--@param level (string or number) One of `vim.lsp.log.levels` function log.set_level(level) if type(level) == 'string' then current_log_level = assert(log.levels[level:upper()], string.format("Invalid log level: %q", level)) @@ -84,8 +88,9 @@ function log.set_level(level) end end --- Return whether the level is sufficient for logging. --- @param level number log level +--- Checks whether the level is sufficient for logging. +--@param level number log level +--@returns (bool) true if would log, false if not function log.should_log(level) return level >= current_log_level end |