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

lfx pre test lsp quick fix #1038

Merged
merged 15 commits into from
Feb 19, 2024

Conversation

shashank-iitbhu
Copy link
Contributor

@shashank-iitbhu shashank-iitbhu commented Feb 12, 2024

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

Close #1020

2. What is the scope of this PR (e.g. component or file name):

Adding LSP quick fix

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

Screen.Recording.2024-02-12.at.11.57.54.PM.mov
  • Extending the Diagnostic Structure pub data: Option<serde_json::Value>, excluded data from hash calculation due to its json type
  • Used function overloading in rust to modify add_compile_error to work when data field is None
  • Filled the data in lookup_type_from_scope() and set_type_to_scope()
  • modified conver_code_to_kcl_diag_id for CompileError
  • modified quick_fix to replace new_text with suggested_replacement
  • finally, extended kcl_diag_to_lsp_diags to convert data field of KCL diagnostics to data field of LSP diagnostics.

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Copy link

github-actions bot commented Feb 12, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
@coveralls
Copy link
Collaborator

coveralls commented Feb 13, 2024

Pull Request Test Coverage Report for Build 7951445687

Details

  • -41 of 82 (50.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 72.264%

Changes Missing Coverage Covered Lines Changed/Added Lines %
kclvm/tools/src/LSP/src/quick_fix.rs 0 41 0.0%
Totals Coverage Status
Change from base Build 7948623196: -0.03%
Covered Lines: 43935
Relevant Lines: 60798

💛 - Coveralls

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
@shashank-iitbhu
Copy link
Contributor Author

shashank-iitbhu commented Feb 17, 2024

Hey @He1pa , I have added test in kclvm/tools/src/LSP/src/tests.rs for the ComplileError Quick fix which i added before.
Now all the tests are passing. For this, I have added a compile error in kclvm/tools/src/LSP/src/test_data/diagnostics.k for this.
Please review, whenever you get time.

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
kclvm/tools/src/LSP/src/quick_fix.rs Outdated Show resolved Hide resolved
kclvm/tools/src/LSP/src/quick_fix.rs Outdated Show resolved Hide resolved
kclvm/error/src/lib.rs Outdated Show resolved Hide resolved
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
kclvm/error/src/diagnostic.rs Show resolved Hide resolved
kclvm/error/src/diagnostic.rs Show resolved Hide resolved
@Peefy Peefy added this to the v0.8.0 Release milestone Feb 19, 2024
Copy link
Contributor

@Peefy Peefy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job! LGTM!

@Peefy Peefy merged commit 8e86380 into kcl-lang:main Feb 19, 2024
7 of 8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LFX PreTest] PreTest for LSP quick fix
4 participants