@@ -2128,7 +2128,7 @@ end
2128
2128
--- Start the lsp client
2129
2129
---
2130
2130
--- @return integer
2131
- Client .lsp_start = function (self )
2131
+ Client .lsp_start = function (self , buf )
2132
2132
local handlers = require " obsidian.lsp.handlers"
2133
2133
local has_blink , blink = pcall (require , " blink.cmp" )
2134
2134
local has_cmp , cmp_lsp = pcall (require , " cmp_nvim_lsp" )
@@ -2141,6 +2141,7 @@ Client.lsp_start = function(self)
2141
2141
else
2142
2142
capabilities = vim .lsp .protocol .make_client_capabilities ()
2143
2143
end
2144
+
2144
2145
local client_id = vim .lsp .start {
2145
2146
name = " obsidian-ls" ,
2146
2147
capabilities = capabilities ,
@@ -2150,7 +2151,6 @@ Client.lsp_start = function(self)
2150
2151
handlers [method ](self , params , handler , _ )
2151
2152
end ,
2152
2153
notify = function (method , params , handler , _ )
2153
- print (method )
2154
2154
handlers [method ](self , params , handler , _ )
2155
2155
end ,
2156
2156
is_closing = function () end ,
@@ -2162,6 +2162,13 @@ Client.lsp_start = function(self)
2162
2162
}
2163
2163
assert (client_id , " failed to start obsidian_ls" )
2164
2164
2165
+ if not (has_blink or has_cmp ) then
2166
+ vim .lsp .completion .enable (true , client_id , buf , { autotrigger = true })
2167
+ vim .bo [buf ].omnifunc = " v:lua.vim.lsp.omnifunc"
2168
+ vim .bo [buf ].completeopt = " menu,menuone,noselect"
2169
+ vim .bo [buf ].iskeyword = " @,48-57,192-255" -- HACK: so that completion for note names with `-` in it works in native completion
2170
+ end
2171
+
2165
2172
return client_id
2166
2173
end
2167
2174
0 commit comments