Skip to content

fix(deducer): avoid retrieving declarations for non-infrastructure ca… - #329

Merged
jianzs merged 1 commit into
pluto-lang:mainfrom
jianzs:fix-check-too-many-call
Aug 9, 2024
Merged

fix(deducer): avoid retrieving declarations for non-infrastructure ca…#329
jianzs merged 1 commit into
pluto-lang:mainfrom
jianzs:fix-check-too-many-call

Conversation

@jianzs

Copy link
Copy Markdown
Contributor

Previously, the deducer attempted to retrieve all call node declarations and match them against custom infrastructure functions. This method was flawed as functions with multiple declarations caused the deducer to fail. To address this, we now first verify that a call node pertains to a custom infrastructure function by comparing function names. Only then do we fetch the call node's declaration, effectively bypassing the collection of extraneous call node declarations.

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

  • Pyright Deducer

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

  • 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

…ll nodes
Previously, the deducer attempted to retrieve all call node declarations and match them against custom infrastructure functions. This method was flawed as functions with multiple declarations caused the deducer to fail. To address this, we now first verify that a call node pertains to a custom infrastructure function by comparing function names. Only then do we fetch the call node's declaration, effectively bypassing the collection of extraneous call node declarations.
@jianzsjianzs added bug Something isn't working deducer Deducer labels Aug 9, 2024
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: aa4e7d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
NameType
@plutolang/pyright-deducerPatch
@plutolang/cliPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jianzs
jianzs merged commit 5e7702e into pluto-lang:mainAug 9, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingdeducerDeducer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jianzs