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

Merged
merged 35 commits into from
Jan 15, 2025

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
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
@TwitchBronBron TwitchBronBron added the create-package create a temporary npm package on every commit label Jan 3, 2025
@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on 942025f. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.41-callfunc-completion-and-validation.20250103190224.tgz

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on 3d2e4f5. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.41-callfunc-completion-and-validation.20250104221946.tgz

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on d20aee5. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.41-callfunc-completion-and-validation.20250106142632.tgz

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on 0d6e1b4. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.41-callfunc-completion-and-validation.20250108140338.tgz

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on 05a5583. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.41-callfunc-completion-and-validation.20250114181913.tgz

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on f0626ca. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.41-callfunc-completion-and-validation.20250114194334.tgz

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on 4fc8688. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.41-callfunc-completion-and-validation.20250114195635.tgz

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.

This is fantastic! I'm pumped about this feature, and it works great in the projects I've tested it in. Nice work.

@TwitchBronBron TwitchBronBron merged commit 1a27f76 into release-1.0.0 Jan 15, 2025
6 checks passed
@TwitchBronBron TwitchBronBron deleted the callfunc_completion_and_validation branch January 15, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-package create a temporary npm package on every commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants