It is a mandate of a code action to generate a valid Ballerina source code. However, while the Create variable with type code action produces the correct variable type, it is unable to import the necessary modules. This is addressed via this PR.
Following a similar approach as seen in the 'Create variable' code action, the PR adjusts the logic of the 'Create variable with type' code action to utilize the same 'ImportAcceptor'.
Purpose
It is a mandate of a code action to generate a valid Ballerina source code. However, while the
Create variable with type
code action produces the correct variable type, it is unable to import the necessary modules. This is addressed via this PR.2201.9.0 of https://github.com/ballerina-platform/ballerina-lang/pull/42574
Approach
Following a similar approach as seen in the 'Create variable' code action, the PR adjusts the logic of the 'Create variable with type' code action to utilize the same 'ImportAcceptor'.
Samples
https://github.com/ballerina-platform/ballerina-lang/assets/59343084/79cec6fe-fde6-4dd8-a495-c2181d44118c
Check List