From 21107f040b1579c1139ef0ca2ce993603d24826f Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 27 Apr 2025 14:12:18 +0300 Subject: Massive nvim refactor, migrated from nvim-lspconfig to NVIM 0.11 lsp/* also migrated most LSP clients to nix rather than mason --- .config/nvim/lsp/mdx_analyzer.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .config/nvim/lsp/mdx_analyzer.lua (limited to '.config/nvim/lsp/mdx_analyzer.lua') diff --git a/.config/nvim/lsp/mdx_analyzer.lua b/.config/nvim/lsp/mdx_analyzer.lua new file mode 100644 index 0000000..0f13bc3 --- /dev/null +++ b/.config/nvim/lsp/mdx_analyzer.lua @@ -0,0 +1,21 @@ +-- https://github.com/mdx-js/mdx-analyzer + +local function get_typescript_server_path(root_dir) + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1]) + return project_root and vim.fs.joinpath(project_root, 'node_modules', 'typescript', 'lib') or '' +end + +return { + cmd = { 'mdx-language-server', '--stdio' }, + filetypes = { 'mdx' }, + root_markers = { 'package.json' }, + settings = {}, + init_options = { + typescript = {}, + }, + before_init = function(_, config) + if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then + config.init_options.typescript.tsdk = get_typescript_server_path(config.root_dir) + end + end, +} -- cgit v1.3.1