diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-04-21 20:54:37 -0700 |
|---|---|---|
| committer | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-04-23 00:57:36 -0700 |
| commit | 04f223f3d08388eac74a571516145154bf5af64c (patch) | |
| tree | e63d5848e642f2d29dc4bd2e695f0ad25763cb8c /lua/lspconfig/util.lua | |
| parent | Merge pull request #859 from mjlbach/lazy_require_lspinfo (diff) | |
| download | nvim-lspconfig-04f223f3d08388eac74a571516145154bf5af64c.tar nvim-lspconfig-04f223f3d08388eac74a571516145154bf5af64c.tar.gz nvim-lspconfig-04f223f3d08388eac74a571516145154bf5af64c.tar.bz2 nvim-lspconfig-04f223f3d08388eac74a571516145154bf5af64c.tar.lz nvim-lspconfig-04f223f3d08388eac74a571516145154bf5af64c.tar.xz nvim-lspconfig-04f223f3d08388eac74a571516145154bf5af64c.tar.zst nvim-lspconfig-04f223f3d08388eac74a571516145154bf5af64c.zip | |
Use dofile instead of require for faster setup({})
* closes #239
* For 76 language servers, this decreases time to invoke setup({}) from
~126 ms to ~1ms
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index dc06f181..5c45a78c 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -74,6 +74,11 @@ function M.has_bins(...) return true end +M.script_path = function() + local str = debug.getinfo(2, "S").source:sub(2) + return str:match("(.*/)") +end + -- Some path utilities M.path = (function() local function exists(filename) |
