-
Notifications
You must be signed in to change notification settings - Fork 87
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
How to setup root_dir
for dartls
#202
Comments
Hi @Energizer328 , please take a look at the "NOTE" mentioned in the Full Configuration section. Seems like that's what you're looking for. |
Thanks for the reply @Thesmader! Maybe I'm missing something, but isn't |
@Energizer328 I missed that one. I meant the 2nd note which you can find towards the end of the Full Configuration section.
|
What I understand from that note is that it enables the analisys of the packages in the flutter SDK. That's also not what I want. Anyway, I tried it, for the sake of it, but it also didn't fix the issue. Let me try to be more explicit about my issue: I have a complex project structure consisting of multiple flutter packages. Something like this:
There are dependencies between the different packages, so it might be the case that Usually in |
@Energizer328 you should be able to send any options you'd normally send to lspconfig to the dart language server using the |
@Energizer328 I have exactly the same project structure as you. I solved it with the following: Create a
and set the return {
"akinsho/flutter-tools.nvim",
ft = "dart",
event = "BufRead",
dependencies = {
"nvim-lua/plenary.nvim",
"stevearc/dressing.nvim", -- optional for vim.ui.select
},
opts = {
root_patterns = { ".nvim-workspace" },
lsp = {
init_options = {
onlyAnalyzeProjectsWithOpenFiles = false,
},
},
},
} Hope it helps. |
Hi! I usually work in flutter projects with multiple packages and I realized that lsp features like references were only analyzing the packages of the currently opened buffers. I did some digging around and the problem seems to be the root directory of dartls. Now, if I setup dartls using lspconfig, I can actually configure this using the
root_dir
parameter of the configuration. Like thisHowever, when i try to do a similar thing with flutter-tools
it doesn't work. I also took a quick peek under the hood, and it seems to me that the
root_dir
parameter is completely ignored by flutter-tools: https://github.com/akinsho/flutter-tools.nvim/blob/ae0be3cef35c0cb41d6c7f814a19b3402d50fd7a/lua/flutter-tools/lsp/init.lua#L257-L264So my question is: Does flutter-tools support customization of the root directory and, if so, what is the correct way to do this?
Thank you so much for time!
The text was updated successfully, but these errors were encountered: