nvim-lspconfig icon indicating copy to clipboard operation
nvim-lspconfig copied to clipboard

Dart Workspaces

Open mkohlhaas opened this issue 9 months ago • 0 comments

Description

Cannot drill down on definitions in the Flutter SDK (goto definition).

There are loads of options for dartls - very impressive btw - but couldn't find any suitable for this case.

See: https://github.com/dart-lang/sdk/issues/53582


In the command line you can see the current workspace directories. Screenshot_20230926_191745


Workspace directory added after jumping with goto definition: Screenshot_20230926_191848

Neovim version

NVIM v0.9.2 Build type: None LuaJIT 2.1.0-beta3 Compilation: /usr/lib/ccache/bin/cc -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include -I/builddir/neovim-0.9.2/build/src/nvim/auto -I/builddir/neovim-0.9.2/build/include -I/builddir/neovim-0.9.2/build/cmake.config -I/builddir/neovim-0.9.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Nvim-lspconfig version

ede4114e1fd41acb121c70a27e1b026ac68c42d6

Operating system and version

Linux 6.3.13_1 #1 SMP PREEMPT_DYNAMIC Tue Jul 25 00:19:40 UTC 2023 x86_64 GNU/Linux

Affected language servers

dartls

Steps to reproduce

  1. flutter create fluttertst
  2. cd fluttertst
  3. nvim lib/main.dart
  4. goto definition "any Flutter stuff"
  5. see red squiggly lines

Actual behavior

Cannot resolve `import 'package:

Expected behavior

Workspace directory should not be added after goto definition jumping.

Minimal config

require("lspconfig").dartls.setup({
            cmd = { "dart", "language-server", "--protocol=lsp" },
            filetypes = { "dart" },
            init_options = {
                closingLabels = true,
                flutterOutline = true,
                onlyAnalyzeProjectsWithOpenFiles = false,
                outline = true,
                suggestFromUnimportedLibraries = true,
            },
            settings = {
                dart = {
                    completeFunctionCalls = true,
                    showTodos = true,
                },
            },
            on_attach = on_attach,
        })

LSP log

https://drive.google.com/drive/folders/10BzhYtV8GuPNVopktjhxFPQxTFvYVpY5?usp=drive_link

mkohlhaas avatar Sep 26 '23 17:09 mkohlhaas