mattn / mattn/vim-lsp-settings

sumneko needs a meta folder to support builtins

Open
#694 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
1.4k
Forks
245
Avg merge
3m
Merged PRs (30d)
1

Description

I needed to turn off checkThirdParty to get sumneko lua lsp to stop asking me to configure LOVE on each session start. That seems to cause it to fail to load builtins. I found this issue with a solution https://github.com/LuaLS/lua-language-server/issues/1788:

call lsp_settings#set('sumneko-lua-language-server', 'args', ["--metapath", expand('~/.vim-cache/lsp/meta')])

That tells sumneko where it can generate "meta files" that describe modules -- including the built-ins. When it fails to generate these meta files it may fail to recognize some types.

Should vim-lsp-settings include a default meta path? It could be where the server is installed, but I'm not sure if you'd want it to be a default component of args (since changing args without removing it is unintuitive)?

The default for --metapath is ./meta so maybe I have something else wrong and somehow that relative path is now rooted somewhere bad?


This is what I'm doing that made builtins (like math.sin) show as unrecognized:

" In ~/.vim/ftplugin/lua.vim
let servername = 'sumneko-lua-language-server'
if lsp#get_server_status(servername) !=# 'running'
    finish
endif

" Prevent love detection nag: lua-language-server#679
" and preload nag: lua-language-server#1594
let cfg = { 'Lua' : {} }
let cfg.Lua.workspace = {
            \         'checkThirdParty' : v:false,
            \         'maxPreload' : 10000,
            \ }
call lsp#update_workspace_config(servername, cfg)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sumneko Lua language-server configuration and the ~/.vim/ftplugin/lua.vim setup, then compare their args handling with the linked LuaLS --metapath documentation and issue. Define whether vim-lsp-settings should provide a default meta path and how it should interact with user-supplied args; done means built-ins remain recognized without requiring manual configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vim
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.