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

provide codeAction in .bs when callfunc can be refactored to callfunc operator #240

Open
georgejecook opened this issue Nov 3, 2020 · 3 comments · May be fixed by #385
Open

provide codeAction in .bs when callfunc can be refactored to callfunc operator #240

georgejecook opened this issue Nov 3, 2020 · 3 comments · May be fixed by #385

Comments

@georgejecook
Copy link
Contributor

would be great if the parser could identify when brs syntax could be upgraded to bs syntax.

for example, consider:

node.callFunc("funcName", invalid)

this could be :
node@.funcName()

@TwitchBronBron TwitchBronBron changed the title provide diagnostic when @. can be used instead of callfunc in brightescript provide diagnostic when @. can be used instead of callfunc in BrighterScript Dec 17, 2020
@TwitchBronBron TwitchBronBron added the enhancement New feature or request label Dec 17, 2020
@TwitchBronBron
Copy link
Member

This will be fairly simple to implement once #298 lands.

@TwitchBronBron
Copy link
Member

This should be really simple to implement now that codeActions are available. For .bs files, we could emit a hint for every callfunc, that is linked to a code action that recommends switching to callfunc

@TwitchBronBron
Copy link
Member

I guess we wouldn't actually need to add a diagnostic... It could just be shown anytime the cursor is on that line.... But that would get less attention drawn to it.

@TwitchBronBron TwitchBronBron changed the title provide diagnostic when @. can be used instead of callfunc in BrighterScript provide codeAction in .bs when callfunc can be refactored to callfunc operator Mar 5, 2021
@TwitchBronBron TwitchBronBron reopened this Apr 9, 2021
@TwitchBronBron TwitchBronBron linked a pull request Apr 9, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants