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

feat: advance resolver incremental compile #1209

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

He1pa
Copy link
Contributor

@He1pa He1pa commented Apr 9, 2024

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):

sema/src/advanced_resolver
sema/src/core
sema/src/resolver
tools/src/LSP

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

advance resolver incremental compile

  1. cache globalstate in lsp
  2. record invalidate_pkgs in resolver
  3. globalstate clear cache by invalidate_pkgs
  4. globalstate resolve new or invalidate pkgs
  • 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

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

@He1pa He1pa changed the title feat: advance resolver incremental compile [wip]feat: advance resolver incremental compile Apr 10, 2024
@He1pa He1pa changed the title [wip]feat: advance resolver incremental compile feat: advance resolver incremental compile Apr 12, 2024
Signed-off-by: he1pa <18012015693@163.com>
@He1pa He1pa marked this pull request as ready for review April 12, 2024 06:32
@He1pa He1pa self-assigned this Apr 12, 2024
@He1pa He1pa marked this pull request as draft April 12, 2024 06:41
Signed-off-by: he1pa <18012015693@163.com>
@coveralls
Copy link
Collaborator

coveralls commented Apr 12, 2024

Pull Request Test Coverage Report for Build 9028982239

Details

  • 408 of 457 (89.28%) changed or added relevant lines in 21 files are covered.
  • 8 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.07%) to 71.493%

Changes Missing Coverage Covered Lines Changed/Added Lines %
kclvm/api/src/service/service_impl.rs 0 1 0.0%
kclvm/sema/src/advanced_resolver/mod.rs 15 16 93.75%
kclvm/sema/src/core/scope.rs 22 23 95.65%
kclvm/sema/src/resolver/node.rs 10 11 90.91%
kclvm/sema/src/namer/mod.rs 46 48 95.83%
kclvm/tools/src/LSP/src/util.rs 18 20 90.0%
kclvm/sema/src/namer/node.rs 25 30 83.33%
kclvm/sema/src/advanced_resolver/node.rs 61 67 91.04%
kclvm/sema/src/core/global_state.rs 88 102 86.27%
kclvm/sema/src/core/symbol.rs 74 90 82.22%
Files with Coverage Reduction New Missed Lines %
kclvm/sema/src/resolver/scope.rs 1 73.07%
kclvm/sema/src/resolver/config.rs 2 80.55%
kclvm/sema/src/core/global_state.rs 5 91.63%
Totals Coverage Status
Change from base Build 9026564739: 0.07%
Covered Lines: 53569
Relevant Lines: 74929

💛 - Coveralls

gs: GlobalState,
node_ty_map: NodeTyMap,
) -> GlobalState {
gs: &'ctx mut GlobalState,
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a bit strange here that all stateful state variables are not unified, some are Arc<Mutex<T>>, some are Rc<RefCell<T>>, and some are &mut borrowing. Should they all be unified as Arc<Mutex<T>, corresponding to the multi-threaded scenario of the language server.

Signed-off-by: he1pa <18012015693@163.com>
Signed-off-by: he1pa <18012015693@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants