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

Fix indentation bug when brighterscript keywords are used as identifiers #96

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

philanderson888
Copy link
Contributor

@philanderson888 philanderson888 commented Dec 9, 2024

Prevent brighterscript-specific keywords such as enum and class from triggering indentation when not contained within those actual ast node types.

class:
image

Fixes #77

@philanderson888 philanderson888 changed the title issue 77 - formatting issue when function is used with a reserved keyword in the function name eg function class() Work In Progress : issue 77 - formatting issue when function is used with a reserved keyword in the function name eg function class() Dec 9, 2024
@philanderson888
Copy link
Contributor Author

pipeline failing on

Screenshot 2024-12-09 at 10 41 46

not sure exactly what this means - if it is something to be concerned about or not. looks like a library issue, we can look at this later after we agree the fix in principle.

@TwitchBronBron
Copy link
Member

pipeline failing on

Screenshot 2024-12-09 at 10 41 46 not sure exactly what this means - if it is something to be concerned about or not. looks like a library issue, we can look at this later after we agree the fix in principle.

This issue is caused by the local install of brighterscript. Revert this change and then run npm install again in the brighterscript-formatter project, then commit your package.json and package-lock.json and it should resolve.

image

@philanderson888 philanderson888 force-pushed the issue-77-formatter-with-keywords-in-function-name branch from 038171d to b9c34c1 Compare January 3, 2025 21:25
@philanderson888
Copy link
Contributor Author

just rolled back all the commits to remove the package.json and package-lock.json files from the commits, then re-committed all the other changes.

just waiting to see if all the Github build tests pass now ...

@philanderson888
Copy link
Contributor Author

seems to be failing on code coverage not quite 100%

Screenshot 2025-01-03 at 21 39 16

at least it's not an error introduced by the changes per se, it's a code coverage error which we can deal with later ... will investigate later.

will tidy up code changes first.

@philanderson888
Copy link
Contributor Author

code is tidy now

test is failing above because ... looks like ... code coverage is not 100%, not because of an error in the changes

I will have to look into writing fresh tests to cover extra code, to bring test coverage back up to 100%

@philanderson888 philanderson888 changed the title Work In Progress : issue 77 - formatting issue when function is used with a reserved keyword in the function name eg function class() Issue 77 - formatting issue when function is used with a reserved keyword in the function name eg function class() Jan 10, 2025
@philanderson888
Copy link
Contributor Author

OK @TwitchBronBron looks like

  • code is working
  • tests are passing

cc

@chrisdp @markwpearce @heart-of-code @addison-adler

@chrisdp chrisdp linked an issue Jan 10, 2025 that may be closed by this pull request
@TwitchBronBron TwitchBronBron changed the title Issue 77 - formatting issue when function is used with a reserved keyword in the function name eg function class() Fix indentation bug when brighterscript keywords are used as identifiers Jan 22, 2025
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.

@philanderson888 I pushed a test that's failing and needs to be fixed. Can you take a look?

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.

Keyword Indentation Error
2 participants