You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Solidity extension, currently, when immutable state variables are not initialized, the entire contract is highlighted in red. This is not optimal for understanding the issue at hand. It would be more helpful if only the uninitialized immutable variables and the related constructor were highlighted.
Steps to Reproduce:
Declare an immutable state variable in a Solidity contract.
Create a constructor without initializing the immutable variable.
Expected: Highlighting of immutable variable and constructor to be have red squiggly lines.
Actual: Everything is red, making it hard to see which immutable variables are the problem.
The text was updated successfully, but these errors were encountered:
What is happening is that that solc is giving an error (solc 2658). The range that solc is giving in the source code is the entire contract:
With the extension we can manipulate that source range so that it is limited to the constructor, more specifically just to the constructor keyword.
The way this would be implemented is by providing a new CompilerDiagnistic for 2658. This diagnostic would provide no code actions but transform the solc error by constraining the source range by implementing fromHardhatCompilerError, and constraining to the constructor keyword. You can see a similar move here:
In the Solidity extension, currently, when immutable state variables are not initialized, the entire contract is highlighted in red. This is not optimal for understanding the issue at hand. It would be more helpful if only the uninitialized immutable variables and the related constructor were highlighted.
Steps to Reproduce:
Expected: Highlighting of immutable variable and constructor to be have red squiggly lines.
Actual: Everything is red, making it hard to see which immutable variables are the problem.
The text was updated successfully, but these errors were encountered: