I have installed nvim-lspconfig and nvim-cmp plugins for Neovim. A code completion with ccls works pretty well for .cpp
and .hpp
file extensions. I want to make code completion to also work with .tpp
file extension. I have created tpp.vim
file inside ~/.config/nvim/ftdetect
directory, which contains au BufRead,BufNewFile *.tpp set filetype=cpp
Vim script. After doing this, syntax highlighting started to work for .tpp
file, but code completion not.
vim.filetype.add({ extension = { tpp = "cpp", },})
I have also added these lines of code inside ~/.config/nvim/init.lua
file, code completion still not wants to start working. So with all of that I have done - only syntax highlighting started to work for .tpp
file extension, but code completion not. How can I make code completion to also start working for this file extension?
lspconfig: require("lspconfig.health").check()LSP configs active in this session (globally) ~- Configured servers: ccls- OK Deprecated servers: (none)LSP configs active in this buffer (bufnr: 1) ~- Language client log: ~/.local/state/nvim/lsp.log- Detected filetype: `cpp`- 1 client(s) attached to this buffer- Client: `ccls` (id: 1, bufnr: [1]) root directory: ~/TurboINI/ filetypes: c, cpp, objc, objcpp, cuda cmd: /usr/local/bin/ccls version: `Debian ccls version 0.20241108-2-g4331c895` executable: true autostart: true
Even tho LSP detected that this file's extension is related to C++, but code completion still not wants to work:
I assume that solution to this is hiding in ccls and not in Neovim plugins.
P.S. I have found an article on how to make a specific file extensions behave exactly like standard C++ extensions on vi.stackexchange.com, I have tried it out and ccls still not wants to do code completion. In principe code completion works, but as database it takes already what you have typed in a file, as an example if I typed #include <iostream>
its database will only contain #include
and <iostream>
and nothing else.