Skip to content

setup_handlers -> vim.lsp.config #1926

Closed Answered by williamboman
mainendra asked this question in Q&A
Discussion options

You must be logged in to vote

This is technically not related to Mason as these things are in core Neovim. With vim.lsp.config you specify the "root directory" via either root_markers or root_dir (see :h vim.lsp.Config). single_file_support = false is now workspace_required = true.

 vim.lsp.config('ts_ls', {
     on_attach = on_attach,
-    root_dir = lspconfig.util.root_pattern('package.json'),
-    single_file_support = false,
+    root_markers = { 'package.json' },
+    workspace_required = true,
 })

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@mainendra
Comment options

@nick22985
Comment options

@mainendra
Comment options

@williamboman
Comment options

@nick22985
Comment options

Answer selected by mainendra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants