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

Adds Callfunc Completion and Validation #1352

Open
wants to merge 25 commits into
base: release-1.0.0
Choose a base branch
from

Conversation

markwpearce
Copy link
Collaborator

@markwpearce markwpearce commented Nov 21, 2024

Gives callFunc a whole lotta love!

  • Fixes an issue with completions on @. where ALL possible callfuncs would appear. This was a result of the parser having an exception on incomplete @. invocations
  • Adds function documentation to hovers on @. callfunc invocations
  • Stores all resolved types associated with callfuncs for a component in a symbolTable that is used a sibiling table when the callfunc is used in another scope
  • Return type of Callfunc and @. invocations are used to set types in assignments
  • Validates arg counts and type mismatches for callfunc and @.

While I was it, I also added validation and return typing for <component>.createChild()

Additional validation enhancements:

  • if a type depends on another type (eg, has a member of another type), and that member type changes, then all segments/ASTNodes that reference the wider type are also re-validated. This means that the type-safety flows down and things get appropriately re-validated when there are changes.
  • Better handling of typecast statements when setting up file segments for revalidation
  • Better handling of when component types change, and re-validation because of that.

TODO:

  • Make validation updates work better. Currently, you need to edit an XML file of the component for things to revalidate if the exported function type changes
  • Deal with how adding sibling tables messes up other validations. Like if the resolved version stay around when they actually should be unresolved
  • Do not have validation errors if the component type is the generic roSGNode

To be honest, I think that if we properly re-build the Component type when a member file changes, that would fix both problems.

image

image

Also fixes #1309

@markwpearce markwpearce marked this pull request as ready for review November 25, 2024 17:16
@markwpearce markwpearce added this to the v1.0.0 milestone Nov 25, 2024
@markwpearce
Copy link
Collaborator Author

markwpearce commented Nov 29, 2024

@TwitchBronBron This is ready for review

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

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

Overall, it seems to be working fairly well. I've added a few comments for some bugs I found. Looking forward to testing it again!

src/Program.ts Show resolved Hide resolved
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.

2 participants