Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: workspace/configuration #12738

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

schrieveslaach
Copy link
Contributor

@schrieveslaach schrieveslaach commented May 2, 2024

Description

Implement workspace/configuration protocol for LSP clients. See #10794 (follow up PR of #12454)

User-Facing Changes

LSP clients can provide include directories via the LSP client settings. For example, for Neovim via lspconfig for Nushell the include path configuration looks like this:

require('lspconfig').nushell.setup({
   settings = {
      nu = {
         includePaths = {
            "Path to include dir",
            --
         }
      }
   },
})

@fdncred
Copy link
Collaborator

fdncred commented May 7, 2024

@schrieveslaach Where are we at on this?

@schrieveslaach
Copy link
Contributor Author

@fdncred, maybe, you can have a look from the user's point of view already.

Missing is the configuration changes. So, only static configuration are supported.

@fdncred
Copy link
Collaborator

fdncred commented May 24, 2024

I tried this in my neovim config and couldn't get it to work

        require('lspconfig').nushell.setup {
          cmd = { 'nu', '--lsp' },
          filetypes = { 'nu', 'nuon' },
          root_dir = require('lspconfig.util').find_git_ancestor,
          single_file_support = true,
          setting = {
            nu = {
              includePaths = {
                '/home/fdncred/test',
                '/home/fdncred/src/nu_scripts',
              },
            },
          },
        },

I put a file named ds.nu in /home/fdncred/test and did source ds.nu in a foo.nu file and it didn't like it. This is the file with the diagnostic plus the :LspInfo
image

The use line works because that path is in my $env.NU_LIB_DIRS, at least that's my guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants