Skip to content

[Breaking]: Part 1 of 2 Restrict visibility, add immutability, refactor internals…#124

Merged
danipen merged 4 commits intodanipen:masterfrom
udlose:fix/gethashcode-sealed-visibility-issues
Mar 8, 2026
Merged

[Breaking]: Part 1 of 2 Restrict visibility, add immutability, refactor internals…#124
danipen merged 4 commits intodanipen:masterfrom
udlose:fix/gethashcode-sealed-visibility-issues

Conversation

@udlose
Copy link
Contributor

@udlose udlose commented Mar 7, 2026

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 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.

udlose added 3 commits March 7, 2026 10:28
… 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.
Copy link
Owner

@danipen danipen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good, please check a couple of comments.

@danipen danipen merged commit c615bfd into danipen:master Mar 8, 2026
5 checks passed
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.
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