-
Notifications
You must be signed in to change notification settings - Fork 180
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
Local variable with and empty map or list report error not declare #1576
Comments
Thank you for the report @martinOrigin8Cares, I was able to reproduce it and I can confirm this is a bug. It can see that the two complex types do not match exactly, as the hover also indicates. For clarity, unless there's constraint given by a provider/resource/data source, then This is already (correctly) reflected in the hover data: You probably understood the difference already given that you came up with the workaround with All that said, these two pairs of types (tuple / list and map/object) are convertible in this case and so we shouldn't be raising it as a diagnostic error as I will look into tweaking the type matching logic. |
This actually ended up to be more related to the fact that the tuples and objects are empty, rather than their underlying types, as you originally hinted in your post. Either way I have a patch in hashicorp/hcl-lang#330 which is now pending review. I will post updates here when we merge it and release it (hopefully soon). Thanks for your patience in the meantime. |
A new version 2.28.1 was just released. This fixes the reported bug. The update should appear automatically in VS Code. Thank you for the detailed repro case in your report @martinOrigin8Cares In case you experience any different validation related bug, please do let us know through a new issue. |
I still see the error displayed on the VSCode despite updating the extension to version 2.28.1 |
In case you experience any different validation related bug, please do let us know through a new issue and attach a repro case. Thanks. |
@radeksimko, should version 2.28.1 already fix the issue with empty tuples/lists?
|
In case you experience any different validation related bug, please do let us know through a new issue and attach a full repro case in the form of configuration. @FeltlP In your particular case we'd also need the snippet of the configuration which has the reference since it depends on the context in which it is referenced. Thanks. |
Extension Version
GitLab.gitlab-workflow@3.80.0
VS Code Version
Version: 1.83.0 (user setup)
Commit: e7e037083ff4455cf320e344325dacb480062c3c
Date: 2023-10-03T16:12:16.321Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22631
Operating System
Edition Windows 11 Pro Version 23H2 Installed on 2023-10-01 OS build 22631.2361 Experience Windows Feature Experience Pack 1000.22674.1000.0
Terraform Version
Terraform v1.6.0 on linux_amd64
Steps to Reproduce
Expected Behavior
To not shwo an error
Actual Behavior
Show the error "No declaration found for <>"
Terraform Configuration
Project Structure
. └── maint.tf
Gist
https://gist.github.com/martinOrigin8Cares/f96e3dabdcaec56620f5dd64b458a64b
Anything Else?
No response
Workarounds
No response
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: