rokucommunity / rokucommunity/brighterscript-formatter

handle double-indent followed by double-outdent

Open
#85 0 comments 0 reactions 0 assignees View on GitHub

@chrisdp is already working on this.

Since Mar 29, 2026.

  • #125 by @chrisdp — open
Dominant language
TypeScript
Stars
17
Forks
10
Avg merge
49m
Merged PRs (30d)
7

Description

The formatter should prevent multi-indent when followed by multi-outdent. In this case, we have { and function, then on another line } followed by end function

This will require a lookahead to figure out if we're doing to outdent the same number of indents.

temp = {
	key_9: { env: ["any"], themes: ["any"], runtimeCheck: function() as boolean
			return true
	end function }
	key_10: { env: ["any"], themes: ["any"], runtimeCheck: function() as boolean
			return false
	end function }
	key_11: { env: ["dev"], themes: ["any"], runtimeCheck: function() as boolean
			return true
	end function }
	key_12: { env: ["any"], themes: ["any"], runtimeCheck: function() as boolean
			return true
	end function }
}

Should be:

temp = {
	key_9: { env: ["any"], themes: ["any"], runtimeCheck: function() as boolean
		return true
	end function }
	key_10: { env: ["any"], themes: ["any"], runtimeCheck: function() as boolean
		return false
	end function }
	key_11: { env: ["dev"], themes: ["any"], runtimeCheck: function() as boolean
		return true
	end function }
	key_12: { env: ["any"], themes: ["any"], runtimeCheck: function() as boolean
		return true
	end function }
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing the formatter's indentation logic and the proposed lookahead around {/function followed by }/end function; done means the shown input receives the reduced indentation in each function body without incorrect multi-outdenting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.