commit 6a9bce10ae19203f67b40212e537a1109db85677
parent 3f7bb3ee5ecd5404a414e4b0fb7c89a2784f3d43
Author: Tomáš Němec <nemec@medoro.org>
Date: Thu, 7 Aug 2025 10:30:55 +0200
update
Diffstat:
9 files changed, 48 insertions(+), 52 deletions(-)
diff --git a/after/ftplugin/dart.lua b/after/ftplugin/dart.lua
@@ -88,5 +88,6 @@ if pcall(require, 'dart-tools') then
dt_req.execute_command('refactor.convert.bodyToBlock')
end, opts('Dart Convert To Block'))
vim.keymap.set('n', '<leader>ad', dt_lsp.super, opts('Dart Go to Super Definition'))
+ vim.keymap.set('n', '<leader>az', '<cmd>DartAnalyze<cr>', opts('Dart Analyze to QuickFix list'))
-- vim.keymap.set('n', '<leader>ap', dt_lsp.import, opts('Dart Go to Import'))
end
diff --git a/after/lsp/css-lsp.lua b/after/lsp/css-lsp.lua
@@ -0,0 +1 @@
+return vim.lsp.config['cssls']
diff --git a/after/lsp/dartls.lua b/after/lsp/dartls.lua
@@ -47,9 +47,11 @@ return {
},
capabilities = vim.tbl_deep_extend('force', vim.lsp.protocol.make_client_capabilities(), capabilities),
init_options = {
+ onlyAnalyzeProjectsWithOpenFiles = true,
+ suggestFromUnimportedLibraries = true,
closingLabels = true,
- outline = false,
- flutterOutline = false,
+ outline = true,
+ flutterOutline = true,
},
settings = { dart = { completeFunctionCalls = true, showTodos = true } },
handlers = {
diff --git a/after/lsp/jsonls.lua b/after/lsp/jsonls.lua
@@ -1,15 +1,12 @@
-local schemas
-if pcall(require, 'schemastore') then
- schemas = require 'schemastore'.json.schemas()
-end
+local capabilities = vim.lsp.protocol.make_client_capabilities()
+capabilities.textDocument.completion.completionItem.snippetSupport = true
return {
+ capabilities = capabilities,
settings = {
json = {
- schemas = schemas,
- validate = {
- enable = true
- }
+ schemas = require 'schemastore'.json.schemas(),
+ validate = { enable = true }
}
},
}
diff --git a/after/lsp/lua_ls.lua b/after/lsp/lua_ls.lua
@@ -1,4 +1,29 @@
return {
+ runtime = {
+ -- Tell the language server which version of Lua you're using (most
+ -- likely LuaJIT in the case of Neovim)
+ version = 'LuaJIT',
+ -- Tell the language server how to find Lua modules same way as Neovim
+ -- (see `:h lua-module-load`)
+ path = {
+ 'lua/?.lua',
+ 'lua/?/init.lua',
+ },
+ },
+ -- Make the server aware of Neovim runtime files
+ workspace = {
+ checkThirdParty = false,
+ -- library = vim.tbl_filter(function(d)
+ -- return not d:match(vim.fn.stdpath('config') .. '/?a?f?t?e?r?')
+ -- end, vim.api.nvim_get_runtime_file('', true))
+ library = {
+ vim.env.VIMRUNTIME,
+ -- Depending on the usage, you might want to add additional paths
+ -- here.
+ '${3rd}/luv/library',
+ '${3rd}/busted/library'
+ }
+ },
settings = {
Lua = {
telemetry = {
diff --git a/after/lsp/typescript-language-server.lua b/after/lsp/typescript-language-server.lua
@@ -0,0 +1 @@
+return vim.lsp.config['ts_ls']
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
@@ -1,4 +1,14 @@
-vim.lsp.enable { 'gopls', 'lua_ls', 'dartls', 'zls', 'yamlls', 'bashls' }
+vim.lsp.enable {
+ 'bashls',
+ 'css-lsp',
+ 'dartls',
+ 'html',
+ 'intelephense',
+ 'jsonls',
+ 'lua_ls',
+ 'typescript-language-server',
+ 'yamlls',
+}
vim.api.nvim_create_augroup('my.lsp', {
clear = false
diff --git a/after/plugin/medoro.lua b/after/plugin/medoro.lua
@@ -1,15 +0,0 @@
-local group = vim.api.nvim_create_augroup('tms-medoro', {})
-vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
- group = group,
- pattern = '*/bigroot/**',
- callback = function()
- vim.keymap.set('n', '<leader>al', require 'tms.medoro'.lang, { buffer = true })
- end,
-})
-
-vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, {
- pattern = 'dpgw.xml',
- callback = function()
- vim.b.disable_autoformat = true
- end,
-})
diff --git a/lua/tms/medoro.lua b/lua/tms/medoro.lua
@@ -1,26 +0,0 @@
-local M = {}
-
-M.lang = function()
- -- TODO(tms) 17.12.22: little to specific not?
- local cwd = '/work/medoro/dev/bigroot/dpgw/server/src/main/resources/org/medoro/dpgw/core/lang/'
- local files = { 'lang.properties', 'lang_cs.properties' }
- require('telescope.builtin').live_grep({
- cwd = cwd,
- search_dirs = files,
- disable_coordinates = true,
- attach_mappings = function(prompt_bufnr)
- local actions = require('telescope.actions')
- actions.select_default:replace(function(_, _)
- local entry = require('telescope.actions.state').get_selected_entry()
- local lang = entry.text:match('(%S+)=.*')
- print(entry.text, lang)
- actions.close(prompt_bufnr)
- vim.fn.setreg('+', lang)
- vim.fn.setreg('*', lang)
- end)
- return true
- end,
- })
-end
-
-return M