[Breaking]: Part 1 of 2 Restrict visibility, add immutability, refactor internals…#124
Merged
danipen merged 4 commits intodanipen:masterfrom Mar 8, 2026
Conversation
… to match partity with upstream: TM4e repo: https://github.com/eclipse-tm4e/tm4e/tree/main/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal Converted many classes and members to internal or sealed, and marked fields as readonly to improve encapsulation and immutability. Refactored utility classes to static, updated method visibility, and simplified JSONPListParser logic. These changes clarify API boundaries, prevent misuse, and enhance maintainability and thread safety.
…y, internal methods Refactored LineTokens to be sealed and updated fields to readonly for improved immutability. Removed unused _lineText field and constructor parameter. Changed public methods to internal for better encapsulation. Cleaned up code and removed unnecessary fields.
TokenizeLineResult2 is now sealed, preventing inheritance and potential subclassing. This change improves code safety and may offer performance benefits.
danipen
requested changes
Mar 8, 2026
Owner
danipen
left a comment
There was a problem hiding this comment.
Overall good, please check a couple of comments.
udlose
added a commit
to udlose/TextMateSharp
that referenced
this pull request
Mar 8, 2026
Strengthen encapsulation and immutability Several classes changed from public to internal and sealed, with fields and methods updated to internal and readonly where appropriate. GrammarNames made static; SupportedGrammars is now readonly. These changes improve code safety and clarify usage boundaries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Breaking API changes
Partially addresses #123
Part 1 of 2 Restrict visibility, add immutability, refactor internals to match parity with upstream: TM4e repo: https://github.com/eclipse-tm4e/tm4e/tree/main/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal
Converted many classes and members to
internalorsealed, and marked fields asreadonlyto improve encapsulation and immutability. Refactored utility classes tostatic, updated method visibility, and simplifiedJSONPListParserlogic. These changes clarify API boundaries, prevent misuse, and enhance maintainability and thread safety.