Skip to content
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

[Master] Add the relevant new import text edits via the Create variable with type code action #42574

Merged
merged 4 commits into from
Apr 26, 2024

Conversation

nipunayf
Copy link
Contributor

@nipunayf nipunayf commented Apr 17, 2024

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.

Fixes #42482

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

Screen.Recording.2024-04-17.at.5.50.25.PM.mov

Check List

  • Read the Contributing Guide
  • [] Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@nipunayf nipunayf added the Team/LanguageServer Language Server Implementation related issues. #Compiler label Apr 17, 2024
@nipunayf nipunayf changed the title Add the new import text edit via the Create variable with type code action Add the respective new import text edits via the Create variable with type code action Apr 17, 2024
@nipunayf nipunayf changed the title Add the respective new import text edits via the Create variable with type code action Add the relevant new import text edits via the Create variable with type code action Apr 18, 2024
@nipunayf nipunayf changed the title Add the relevant new import text edits via the Create variable with type code action [Master] Add the relevant new import text edits via the Create variable with type code action Apr 23, 2024
@nipunayf nipunayf merged commit 8b1ac03 into ballerina-platform:master Apr 26, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/LanguageServer Language Server Implementation related issues. #Compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: The Create variable with type code action fails to import the relevant modules
2 participants