[Breaking]: Visibility of fields/properties/classes does not match upstream tm4e implementation

Open
#123 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, java
Domain
backend

Research direction

Read the listed classes in TextMateSharp’s .internal.grammar namespace and compare their visibility and sealing with the linked upstream StateStack.java implementation. The issue names AttributedScopeStack, BalancedBracketSelectors, BasicScopeAttributes, BasicScopeAttributesProvider, Grammar, LineTokenizer, LineTokens, TokenTypeMatcher, and TokenizeLineResult; check for related discrepancies elsewhere as scope allows. Done means the identified classes match upstream visibility and sealing, with any additional discrepancies assessed.

Written by the indexing model from the issue text.

Description

[!warning]
Breaking API change

I'm working on fixing this now as we discussed here. I'm creating this issue to document the changes here.

[!Note]
I didn't examine other folders/files for similar discrepancies so there may be other changes needed.

The upstream java implementation declares StateStack (and some other classes in the .internal.grammar package as final (sealed in .NET). So if you wanted to have parity with the upstream impl, we should include a breaking change by declaring these classes as sealed. Also, notice it's in the .internal.grammar package, suggesting it's not meant for public extension anyways. Implementers could still implement IStateStack if desired.

Here is a list of upstream differences I found - I only looked in this folder/namespace. So, there may also be others:

class name sealed/unsealed (has parity with TextMateSharp) class visibility (has parity with TextMateSharp)
AttributedScopeStack sealed ❌ internal ❌
BalancedBracketSelectors sealed ❌ public ✅
BasicScopeAttributes sealed ❌ internal ❌
BasicScopeAttributesProvider sealed ❌ internal ❌
Grammar sealed ❌ public ✅
LineTokenizer sealed ❌ internal ❌
LineTokens sealed ❌ internal ❌
TokenTypeMatcher sealed ❌ internal ✅
TokenizeLineResult sealed ❌ internal ❌
Dominant language
C#
Stars
170
Forks
35
Avg merge
2h 52m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from danipen/TextMateSharp

All issues in danipen/TextMateSharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.