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

Provide Quick fixes for Compile errors #1359

Merged

Conversation

shashank-iitbhu
Copy link
Contributor

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

  • N
  • [] Y

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

kclvm/sema/src/resolver/arg.rs
kclvm/tools/src/LSP/src/quick_fix.rs
kclvm/tools/src/LSP/src/to_lsp.rs

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

Screen.Recording.2024-05-25.at.12.53.21.PM.mov
  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

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

  • N
  • Y
    Tests have not been written yet.

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>
@shashank-iitbhu
Copy link
Contributor Author

@Peefy Please review. Will be adding more fixes to this PR.

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

Pull Request Test Coverage Report for Build 9236082833

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 24 of 59 (40.68%) changed or added relevant lines in 3 files are covered.
  • 73 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.02%) to 71.211%

Changes Missing Coverage Covered Lines Changed/Added Lines %
kclvm/tools/src/LSP/src/to_lsp.rs 4 5 80.0%
kclvm/tools/src/LSP/src/quick_fix.rs 0 6 0.0%
kclvm/sema/src/resolver/arg.rs 20 48 41.67%
Files with Coverage Reduction New Missed Lines %
kclvm/query/src/util.rs 1 61.9%
kclvm/sema/src/resolver/arg.rs 2 75.16%
kclvm/query/src/lib.rs 2 91.67%
kclvm/runner/src/runner.rs 20 71.51%
kclvm/query/src/override.rs 48 89.76%
Totals Coverage Status
Change from base Build 9224776410: 0.02%
Covered Lines: 54161
Relevant Lines: 76057

💛 - Coveralls

@Peefy Peefy merged commit 8d53ec0 into kcl-lang:main May 25, 2024
8 of 10 checks passed
@Peefy
Copy link
Contributor

Peefy commented May 26, 2024

I've merge this PR. There are still some issues:

The first one is

f = lambda x: int {
    x
}
a = f(x = 1, x = 1)

will be fixed as

f = lambda x: int {
    x
}
a = f(x = 1, x)

instead of removing the dup keyworld argument.

f = lambda x: int {
    x
}
a = f(x = 1)

The second one is

f = lambda x: int {
    x
}
a = f(x = 1, b)

will be fixed as

f = lambda x: int {
    x
}
a = f(x = 1, )

instead of

f = lambda x: int {
    x
}
a = f(x = 1)

The third one is

f = lambda x: int {
    x
}
a = f(xx=1)

will be fixed as

f = lambda x: int {
    x
}
a = f(x)

instead of

f = lambda x: int {
    x
}
a = f(x = 1)

shashank-iitbhu added a commit to shashank-iitbhu/kcl that referenced this pull request May 26, 2024
Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Peefy pushed a commit that referenced this pull request May 26, 2024
* some more quick fixes

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

* fix

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

* more fixes

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

* fmt

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

* grammar test fixed

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

* test fix

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

* fixes from #1359

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

* fmt

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

---------

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants