diff options
| author | William Boman <william@redwill.se> | 2025-04-21 21:06:36 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-04-21 21:53:16 +0200 |
| commit | 80f2cd7734ff21da4cf1489c9695e440cdcd139f (patch) | |
| tree | 4e97c2a3b2a416c87985e8efdff6007eaf57823f /scripts/lua/mason-scripts/utils.lua | |
| parent | refactor!: remove `automatic_installation` setting (diff) | |
| download | mason-lspconfig-80f2cd7734ff21da4cf1489c9695e440cdcd139f.tar mason-lspconfig-80f2cd7734ff21da4cf1489c9695e440cdcd139f.tar.gz mason-lspconfig-80f2cd7734ff21da4cf1489c9695e440cdcd139f.tar.bz2 mason-lspconfig-80f2cd7734ff21da4cf1489c9695e440cdcd139f.tar.lz mason-lspconfig-80f2cd7734ff21da4cf1489c9695e440cdcd139f.tar.xz mason-lspconfig-80f2cd7734ff21da4cf1489c9695e440cdcd139f.tar.zst mason-lspconfig-80f2cd7734ff21da4cf1489c9695e440cdcd139f.zip | |
refactor!: remove handler functionality, add automatic enable feature
This also removes all generated code/docs, including relevant scripts. Mappings are now also dynamically generated
instead of compiled. These changes should reduce churn in this plugin and make it more resilient for external changes in
Mason and/or nvim-lspconfig.
Mappings have been centralized in the registry instead.
Diffstat (limited to 'scripts/lua/mason-scripts/utils.lua')
| -rw-r--r-- | scripts/lua/mason-scripts/utils.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/lua/mason-scripts/utils.lua b/scripts/lua/mason-scripts/utils.lua deleted file mode 100644 index ee6ab10..0000000 --- a/scripts/lua/mason-scripts/utils.lua +++ /dev/null @@ -1,40 +0,0 @@ -local _ = require "mason-core.functional" -local fs = require "mason-core.fs" - -local M = {} - ----@async ----@param path string ----@param contents string ----@param flags string? -function M.write_file(path, contents, flags) - local header = _.cond({ - { - _.matches "%.lua$", - _.always { - "-- THIS FILE IS GENERATED. DO NOT EDIT MANUALLY.", - "-- stylua: ignore start", - }, - }, - { - _.matches "%.md$", - _.always { - "<!--- THIS FILE IS GENERATED. DO NOT EDIT MANUALLY. -->", - }, - }, - { - _.matches "doc/.+%.txt$", - _.always {}, - }, - { - _.T, - _.always { - "# THIS FILE IS GENERATED. DO NOT EDIT MANUALLY.", - }, - }, - }, path) - - fs.async.write_file(path, table.concat(_.concat(header, { contents }), "\n"), flags) -end - -return M |
