Skip to content

Commit 80d9b68

Browse files
venkatarenduchintalaVenkata Subramani Renduchintala
andauthored
feat(lua-markdown): add lazydev.nvim for Lua LSP and marksman for Markdown (#21)
- lua/plugins/configs/lazydev.lua: lazydev.nvim with luv library for vim.uv types - plugins/init.lua: register lazydev before mason in LSP section - after/lsp/lua_ls.lua: remove manual workspace.library (lazydev owns it) - cmp.lua: add lazydev source (group_index 0) for Lua file completions - mason.lua: add marksman to lspconfig ensure_installed - treesitter.lua: add markdown and markdown_inline parsers - CI: install+validate markdown/markdown_inline parsers via README.md fixture Co-authored-by: Venkata Subramani Renduchintala <venkatarenduchintala@pm.me>
1 parent 17e332e commit 80d9b68

9 files changed

Lines changed: 38 additions & 4 deletions

File tree

after/lsp/lua_ls.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim.lsp.config('lua_ls', {
33
Lua = {
44
runtime = { version = "LuaJIT" },
55
diagnostics = { globals = { "vim" } },
6-
workspace = { library = vim.api.nvim_get_runtime_file("", true) },
6+
-- workspace.library is managed by lazydev.nvim
77
telemetry = { enable = false },
88
},
99
},

lua/plugins/configs/cmp.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ return {
113113
}),
114114
sources = {
115115
-- { name = "copilot" },
116+
{ name = "lazydev", group_index = 0 },
116117
{ name = "nvim_lsp" },
117118
{ name = "nvim_lua" },
118119
{ name = "luasnip" },

lua/plugins/configs/lazydev.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
return {
2+
"folke/lazydev.nvim",
3+
ft = "lua",
4+
opts = {
5+
library = {
6+
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
7+
},
8+
},
9+
}

lua/plugins/configs/mason.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ return {
3535
"yamlls",
3636
-- General dev
3737
"lua_ls",
38+
"marksman",
3839
"pyright",
3940
"rust_analyzer",
4041
"clangd",

lua/plugins/configs/treesitter.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ return {
4444
"bash",
4545
"gotmpl",
4646
"jsonnet",
47+
-- Markdown
48+
"markdown",
49+
"markdown_inline",
4750
},
4851
refactor = {
4952
highlight_definitions = {

lua/plugins/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ local plugins = {
8383
require("plugins.configs.glance"),
8484

8585
---- LSP/DAP
86+
require("plugins.configs.lazydev"),
8687
require("plugins.configs.mason"),
8788
"neovim/nvim-lspconfig",
8889
require("lsp.configs.dap"),

test/fixtures/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Fixture: Markdown
2+
3+
This file is used as a treesitter fixture for the `markdown` and `markdown_inline` parsers in CI validation.
4+
5+
## Section
6+
7+
A paragraph with **bold**, _italic_, and `inline code`.
8+
9+
- List item one
10+
- List item two with a [link](https://example.com)
11+
12+
```yaml
13+
apiVersion: v1
14+
kind: ConfigMap
15+
```
16+
17+
> Blockquote text here.

test/install_parsers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Headless treesitter parser installer for CI.
22
-- Uses TSInstall! + vim.wait() polling parser .so files on disk.
33
-- Exit code 1 on timeout so the CI step fails visibly.
4-
local langs = { 'go', 'terraform', 'hcl', 'yaml', 'bash', 'gotmpl', 'dockerfile', 'jsonnet', 'python' }
4+
local langs = { 'go', 'terraform', 'hcl', 'yaml', 'bash', 'gotmpl', 'dockerfile', 'jsonnet', 'python', 'markdown', 'markdown_inline' }
55
local parser_dir = vim.fn.stdpath('data') .. '/lazy/nvim-treesitter/parser/'
66

77
local function installed(lang)

test/validate_treesitter.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ test_parser('yaml', cfg .. '/test/fixtures/deployment.yaml')
4343
test_parser('bash', cfg .. '/test/fixtures/script.sh')
4444
test_parser('gotmpl', cfg .. '/test/fixtures/helm_deployment.yaml')
4545
test_parser('dockerfile', cfg .. '/test/fixtures/Dockerfile')
46-
test_parser('jsonnet', cfg .. '/test/fixtures/dashboard.jsonnet')
47-
test_parser('python', cfg .. '/test/fixtures/script.py')
46+
test_parser('jsonnet', cfg .. '/test/fixtures/dashboard.jsonnet')
47+
test_parser('python', cfg .. '/test/fixtures/script.py')
48+
test_parser('markdown', cfg .. '/test/fixtures/README.md')
49+
test_parser('markdown_inline', cfg .. '/test/fixtures/README.md')
4850

4951
if #errors > 0 then
5052
for _, err in ipairs(errors) do

0 commit comments

Comments
 (0)