commit 239e06dde3993cb97c8787ac2f2608034cdc1947
parent a8a2a6241e43018782d369f223260f12b72f5c86
Author: Tomas Nemec <owl@gtms.dev>
Date: Mon, 26 Jun 2023 23:28:28 +0200
update
Diffstat:
4 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/after/plugin/dap.lua b/after/plugin/dap.lua
@@ -2,15 +2,15 @@ if not pcall(require, 'dap') then
return
end
-if pcall(require, 'cmp') then
- require('cmp').setup({
- enabled = function()
- return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt' or require('cmp_dap').is_dap_buffer()
- end,
- })
+-- if pcall(require, 'cmp') then
+-- require('cmp').setup({
+-- enabled = function()
+-- return vim.api.nvim_get_option_value('buftype') ~= 'prompt' or require('cmp_dap').is_dap_buffer()
+-- end,
+-- })
- require('cmp').setup.filetype({ 'dap-repl', 'dapui_watches', 'dapui_hover' }, { sources = { { name = 'dap' } } })
-end
+-- require('cmp').setup.filetype({ 'dap-repl', 'dapui_watches', 'dapui_hover' }, { sources = { { name = 'dap' } } })
+-- end
local dap = require('dap')
local repl = require('dap.repl')
@@ -37,7 +37,6 @@ end, { silent = true, desc = 'DAP Set Log Point' })
-- DAP UI
local has_dapui, dapui = pcall(require, 'dapui')
if has_dapui then
-
dapui.setup({
layouts = {
@@ -150,10 +149,7 @@ table.insert(dap.configurations.dart, {
local has_vscode, vscode = pcall(require, 'dap-vscode-js')
if has_vscode then
-- The VSCode Debugger requires a special setup
- vscode.setup({
- adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' },
- debugger_cmd = { 'js-debug-adapter' },
- })
+ vscode.setup({ adapters = { 'pwa-node', 'pwa-chrome' } })
table.insert(dap.configurations.dart, {
--
@@ -161,6 +157,8 @@ if has_vscode then
request = 'attach',
name = 'Attach to :9222',
cwd = vim.fn.getcwd(),
+ sourceMaps = true,
+ trace = true,
port = 9222,
webRoot = '${workspaceFolder}/web',
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
@@ -44,8 +44,13 @@ local function keymap(client, buf)
vim.api.nvim_create_autocmd('CursorMoved',
{ group = lsp_group, buffer = buf, callback = vim.lsp.buf.clear_references })
end
+ if client.supports_method('textDocument/inlayHint') then
+ vim.keymap.set('n', 'gH', function()
+ lb.inlay_hint(0, nil)
+ end, opt('LSP Inlay hints'))
+ end
if client.supports_method('textDocument/rename') then
- vim.keymap.set('n', 'cd', lb.rename, opt('LSP Rename (change definition'))
+ vim.keymap.set('n', 'cd', lb.rename, opt('LSP Rename (change definition)'))
end
if client.supports_method('textDocument/prepareTypeHierarchy') then
vim.keymap.set('n', 'gh', function()
@@ -93,13 +98,6 @@ end
-- -- TODO(tms) 08.06.23: Remove bindings
-- end
--- local progress = require('tms.lsp.progress')
--- handlers['$/progress'] = progress.handler
--- local severity = { 'error', 'warn', 'info' }
--- handlers['window/showMessage'] = function(_, method, params, _)
--- vim.notify(method.message, severity[params.type])
--- end
-
-- mason
if pcall(require, 'mason') then
require('mason').setup()
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -1,6 +1,6 @@
vim.cmd.packadd('packer.nvim')
local packer = require('packer')
-return packer.startup({
+return packer.startup {
function()
local use = packer.use
@@ -64,7 +64,8 @@ return packer.startup({
-- how to vim
use 'ThePrimeagen/vim-be-good'
- use { 'nagy135/typebreak.nvim' }
+ use 'nagy135/typebreak.nvim'
+ use 'm4xshen/hardtime.nvim'
-- vcs
use { 'lewis6991/gitsigns.nvim', requires = { 'nvim-lua/plenary.nvim' } }
@@ -128,6 +129,11 @@ return packer.startup({
use 'rcarriga/nvim-dap-ui'
use 'theHamsta/nvim-dap-virtual-text'
use 'mxsdev/nvim-dap-vscode-js'
+ use {
+ 'microsoft/vscode-js-debug',
+ opt = true,
+ run = 'npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out',
+ }
-- treesitter
use 'nvim-treesitter/nvim-treesitter'
@@ -166,4 +172,4 @@ return packer.startup({
use 'kristijanhusak/vim-dadbod-ui'
use 'kristijanhusak/vim-dadbod-completion'
end,
-})
+}
diff --git a/lua/tms/autocmd.lua b/lua/tms/autocmd.lua
@@ -7,9 +7,8 @@ vim.api.nvim_create_autocmd('TextYankPost', {
vim.api.nvim_create_autocmd('BufEnter', {
pattern = '*',
- callback = function(opt)
- local win = vim.fn.bufwinid(opt.buf)
- local preview = vim.api.nvim_win_get_option(win, 'previewwindow')
+ callback = function()
+ local preview = vim.api.nvim_get_option_value('previewwindow', {})
if preview then
vim.opt.scrolloff = 0
vim.opt.sidescrolloff = 0