foam-language-server
foam-language-server copied to clipboard
Macro expansion behavior
Describe the bug When expanding a macro, I have noticed two behaviors:
- A colon is prepended to the expansion. This appears to be an intended effect based on this slide, but this does not seem correct.
- With ms-jpq/coq_nvim, The
$is removed. This does not appear to happen with nvim-cmp, so it may be an issue with coq_nvim; if so, please let me know and I will issue a bug report there.
To Reproduce Steps to reproduce the behavior:
- Open an existing 0/p file with an
internalFieldentry - Add a macro
$i - Arrow down to
internalFieldand add; - Result is
:internalField
Expected behavior
$internalField
Desktop (please complete the following information):
- OS: Ubuntu 20.04
- NVIM v0.7.0-dev
Additional context Minimal init.vim (modified from https://github.com/FoamScience/openfoam-nvim/blob/master/init.vim):
"
" This is a sample init.vim for nvim v0.6.0+
" to edit OpenFOAM cases files
"
"
" Plugins
call plug#begin('~/.local/share/nvim/plugged')
" Tree-Sitter with OpenFOAM support
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
" Interface to the native LSP client with OpenFOAM support
Plug 'neovim/nvim-lspconfig'
" Helper plugin to install language servers
Plug 'williamboman/nvim-lsp-installer'
" Auto-Complete plugins with snippets (or you can just attach to built-in omnifunc)
Plug 'ms-jpq/coq_nvim', {'branch': 'coq'}
call plug#end()
lua <<EOF
-- Configuration for Tree-Sitter
-- Note that, for this to work, the filetype must be detected correctly
-- Which is handled automatically by nvim-treesitter plugin
local ts_config = require('nvim-treesitter.configs')
ts_config.setup {
-- Or you can just :TSInstall foam cpp regex
ensure_installed = { "foam", "cpp", "regex" },
sync_install = false,
ignore_install = {},
highlight = {
enable = true,
disable = {},
additional_vim_regex_highlighting = false,
},
}
-- LSP configuration
-- I recommend using lsp_installer instead
local lsp_installer = require("nvim-lsp-installer")
-- LSP installer configuration
lsp_installer.settings({
ui = {
icons = {
server_installed = "✓",
server_pending = "➜",
server_uninstalled = "✗"
}
}
})
-- Make sure these servers are installed
local servers = { 'foam_ls' }
for _, name in pairs(servers) do
local server_is_found, server = lsp_installer.get_server(name)
if server_is_found then
if not server:is_installed() then
print("Installing " .. name)
server:install()
end
end
end
-- Configure servers
-- Here, just passes the global on_attach to the server
lsp_installer.on_server_ready(function(server)
local opts = {
on_attach = on_attach,
}
server:setup(opts)
end)
EOF
set termguicolors
Yes, this is actually intended behaviour, because the leading : denotes absolute paths in FoamExtend. It should be a config option for the LSP server. Thanks for reminding me!
I don't have much experience with coc-nvim but if there is an issue, it's probably a bug here.
This also on my list now. Will release a new version as soon as I find time to tackle this!
But please check with coq-nvim devs if there is an option to retain trigger chars.