-
Notifications
You must be signed in to change notification settings - Fork 131
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
No schema found / No root module found / Workspace not initialized / Alternative root modules found #424
Comments
I have fix for those people who uses coc.nvim as me. You need to define rootPatterns parameter with ".terraform" let g:coc_user_config.languageserver = #{
\ terraform: #{
\ filetypes: ['terraform'],
\ command: 'terraform-ls',
\ args: ['serve'],
\ rootPatterns: ['.terraform'],
\ initializationOptions: {} },
\ } |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This one seems to work a lot better, but I notice that (at least every now and then) I have to save a file twice before it will be formatted. Didn't look into it, but seems reasonably consistent (using coc-nvim) using this snapshot, while I didn't notice that with the latest release. Will keep an eye on it and if I have time have a closer look, but just thought to share this first observation. |
@svanharmelen That is an interesting observation, but I don't see how that could relate to the recent changes 🤔 Admittedly there is one query into the module cache, because we used to track TF execution path per module because different modules may require different TF versions from different paths, but feature actually never crystalized into anything, so we may as well just remove that extra query - see #466 What could be going on is that the formatting takes time and the client doesn't wait for response for that long. Sublime Text LSP AFAIK recently introduced 1sec timeout for formatting responses. However that query alone should not be causing any (significant) delay. What I'd guess might be happening is that execution takes longer for some reason (e.g. as a result of tfenv) |
Interesting. Thanks for the insights! I'll try to have a closer look (if time permits) to see if this holds true for my setup as well... |
Just FYI the originally planned release was postponed due to the incident involving GPG key rotation, which also means I had some extra time to look into the suspected performance issues and make some improvements in that area: Hoping to make it part of the next release 🔜 , once the key rotation is finished and VSCode extension had chance to release a version with the new (rotated) key embedded as per hashicorp/vscode-terraform#612 |
Nice @radeksimko! Thanks for the update... Didn't have much time to have a closer look, so looking forward to the release 👍🏻 |
Language server 0.16.0 was released yesterday. As mentioned in the changelog, this version removes all of the above warnings and should provide schema-dependent functionality in more cases due to the fact that it can now combine different sources. It also lays down the foundations for future work on #193 and #355 Such additional sources of schema will then improve the coverage (and chances of getting relevant schema) further. In the meantime you may still experience some inaccurate completion/hover/highlighting data (because newer/older version of provider schema was matched) or lack of the data because it's not available in the preloaded batch of official+partner providers and it was not possible to source it locally, which may have been because
Feel free to follow the mentioned issues and comment there if you feel impacted by these and feel free to file any new bugs or feature requests you find in the new version(s). Thanks again for your patience! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Symptoms
This is a catch-all issue for the following warning messages:
Duplicates
This is an issue we'll keep open in place of the following ones:
Which doesn't mean the linked issues are in any way invalid, just that it's beneficial to keep the conversation in one place.
All of the above points to one particular root cause, which is that the language server has no schema to use for completion, hover and other functionality.
This may be because one of the following reasons:
terraform init
-ed, i.e. plugins were not downloaded, e.g. becauseinit
-ed on its own, but only from a parent moduleterraform init
-ed, but the LS was unable to obtain the schema, e.g. because.terraform-version
is not yet installedThe list of reasons is not definitive, but these are the most commonly reported ones.
Proposed Solution
#354 describes the solution in more detail.
TL;DR of the solution is to obtain the schema through other means (not just via CLI) and combine the different sources, so that there is a schema in most/more cases, then remove both messages from LS entirely.
Feel free to leave 👍 reaction on this issue, but please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for maintainers and other issue followers and do not help with prioritization.
The text was updated successfully, but these errors were encountered: