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

Component statement support for <children> and field attributes #971

Open
wants to merge 28 commits into
base: in-code-component
Choose a base branch
from

Conversation

iObject
Copy link
Collaborator

@iObject iObject commented Nov 30, 2023

No description provided.

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.

Looks pretty good!

I'd like to see some unit tests to verify these features work and ensure they continue to work in the future. You can add them in ComponentStatement.spec.ts and follow this existing test's model:

it('adds private methods to codebehind as plain functions', async () => {
program.setFile('components/ZombieKeyboard.bs', `
component ZombieKeyboard
private sub init()
'test
end sub
private sub doSomething()
print "do something"
end sub
end component
`);
await testTranspile(program.getFile('components/ZombieKeyboard.codebehind.brs'), `
sub init()
'test
end sub
sub doSomething()
print "do something"
end sub
`);
});

Let's add at least one for each annotation type, but feel free to do more with variations on the annotation (like what happens if the annotation is present but missing the string for example). Maybe test a few with several annotations present at the same time, that type of thing.

You run them by calling npm run test:nocover or by using the test task in vscode.

src/bscPlugin/fileProviders/ComponentStatementProvider.ts Outdated Show resolved Hide resolved
src/bscPlugin/fileProviders/ComponentStatementProvider.ts Outdated Show resolved Hide resolved
@TwitchBronBron TwitchBronBron changed the title Add-component-children-and-field-attributes Component statement support for <children> and field attributes Nov 30, 2023
@iObject iObject marked this pull request as ready for review November 30, 2023 19:48
@TwitchBronBron TwitchBronBron changed the base branch from in-code-component to release-1.0.0 March 6, 2024 19:14
@TwitchBronBron TwitchBronBron changed the base branch from release-1.0.0 to in-code-component March 6, 2024 19:38
@TwitchBronBron TwitchBronBron added this to the v1.1.0 milestone Mar 7, 2024
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