For reasons not worth explaining, I have a context where I cannot easily install plugins. If it’s absolutely needed, I can try, but chances are I’ll be forced to use a different editor instead.
I’ve read quite a bit, so I am fairly familiar with what needs to be done at a high level. Problem is most guides are around Mason, mason-lspconfig and nvim-lspconfig, which I’m trying to avoid. I’m not being stubborn, I have a bad context.
The good news are:
Mason
: I don’t need it. Bothtypescript
andtypescript-language-server
are available throughnpm
nvim-lspconfig
: I don’t need it. The docs say this plugin is just convenience. Meaning I should be able to do whatever this does manually (I reckon with a ton of effort though)mason-lspconfig
: I don’t need it, as I wouldn’t be using any of the above.
If I understood correctly, the next step is to start the server. I headed over to :help lsp
and I got from there I need to call something like this
vim.lsp.start({
name = 'tsserver',
cmd = {'tsserver'},
root_dir = vim.fs.dirname(vim.fs.find({'tsconfig.json', 'package.json'}, { upward = true })[1]),
})
I put the above in my init.lua
, restarted, tried <C-X> <C-O>
in insert mode, but nothing came up.
At this point, I have a bunch of questions:
- Is it not working because I should somehow use typescript-language-server instead of tsserver in the config above?
- Maybe it could be working, but I’m just missing some setup for omnifunc
- Am I completely in the wrong path?
I have tried my best to find a guide or video where this manual setup is explained but have had no luck.
Could I get some guidance?