Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
501a93d
Expand AttributedScopeStackTests with full coverage
udlose Feb 21, 2026
1c2b5f3
Fixes #116 AttributedScopeStack.GetHashCode() throws for normal stack…
udlose Feb 22, 2026
8ee9f02
Refactor AttributedScopeStack and expand test coverage, remove multip…
udlose Feb 22, 2026
22c2215
### BREAKING CHANGE: the MergeAttributes method used to (implcitly) t…
udlose Feb 22, 2026
6ad857b
Add .gitignore rules for Visual Studio Live Unit Testing files
udlose Feb 22, 2026
c5ac86e
Refactor dictionary access in SimpleJSON for clarity
udlose Feb 27, 2026
9a6dc13
Add comprehensive StateStack.ToString() unit tests
udlose Feb 27, 2026
0e98cd5
Refactor StateStack:ToString methods for allocations
udlose Feb 27, 2026
a3d00bc
Refactor rule type checks to use pattern matching to avoid casts
udlose Feb 27, 2026
9eb4185
Add comprehensive unit tests for theme parsing and logic
udlose Feb 27, 2026
b20ba91
Expand test coverage for ParsedTheme and Theme classes
udlose Feb 28, 2026
6b3a859
Optimize theme parsing: reduce allocations, add thread safety
udlose Feb 28, 2026
c36e00c
Optimize AttributedScopeStack scope building by minimizing List-resiz…
udlose Mar 2, 2026
a67a707
Remove unnecessary List allocation on success path in ParseTheme method
udlose Mar 2, 2026
916274d
Add comprehensive unit tests for Raw class
udlose Mar 2, 2026
4ec5115
Improve type safety and performance in Raw.cs
udlose Mar 2, 2026
d9e89aa
Add extensive unit tests for matcher logic and fix namespaces
udlose Mar 2, 2026
aa5ce9c
Improve robustness and performance across matcher code
udlose Mar 2, 2026
9e3543c
Fix scope matching logic in IMatchesName implementation
udlose Mar 2, 2026
3e538dd
Optimize rule list allocation and fix resource naming
udlose Mar 2, 2026
34a167c
fixed race condition in concurrency test. Use Volatile.Read for threa…
udlose Mar 2, 2026
f023aa2
Remove unused 'priority' parameter from theme parsing
udlose Mar 2, 2026
6423dc5
PR review feedback (remove extraneous comment)
udlose Mar 2, 2026
467acde
Update ParseTheme call to match new method signature
udlose Mar 2, 2026
da8eab4
Expand and modernize AttributedScopeStack unit tests, and remove unit…
udlose Mar 4, 2026
d3bc964
Refactor AttributedScopeStack equality and hash logic
udlose Mar 4, 2026
52c78aa
Add comprehensive unit tests for StateStack value semantics
udlose Mar 4, 2026
28fdd2f
Expand AttributedScopeStack test coverage and edge cases
udlose Mar 4, 2026
9f53a61
Add ToString() to AttributedScopeStack for scope display to match ups…
udlose Mar 4, 2026
abff6a9
Improve StateStack equality, hashing, and documentation
udlose Mar 4, 2026
29e09fe
Add unit test for param validation in HasSameRuleAs
udlose Mar 4, 2026
b3972dc
Optimize matcher list allocation with initial capacity
udlose Mar 4, 2026
50acd6b
Use ReferenceEquals for null checks, improve performance to avoid O(n…
udlose Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
Expand Down Expand Up @@ -43,6 +43,9 @@ Generated\ Files/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# VisualStudio live unit testing
*.lutconfig

# NUnit
*.VisualState.xml
TestResult.xml
Expand Down
5 changes: 2 additions & 3 deletions src/TextMateSharp.Grammars/Resources/ResourceLoader.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using System.Reflection;

namespace TextMateSharp.Grammars.Resources
Expand All @@ -12,7 +11,7 @@ internal class ResourceLoader

internal static Stream OpenGrammarPackage(string grammarName)
{
string grammarPackage = GrammarPrefix + grammarName.ToLowerInvariant() + "." + "package.json";
string grammarPackage = GrammarPrefix + grammarName.ToLowerInvariant() + ".package.json";

var result = typeof(ResourceLoader).GetTypeInfo().Assembly.GetManifestResourceStream(
grammarPackage);
Expand Down
36 changes: 6 additions & 30 deletions src/TextMateSharp.Tests/Grammar/LineTextTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;

using NUnit.Framework;

using System;
using TextMateSharp.Grammars;

namespace TextMateSharp.Tests.Grammar
Expand Down Expand Up @@ -351,15 +349,6 @@ public void GetHashCode_SameContent_ShouldReturnSameHash()
Assert.AreEqual(lineText1.GetHashCode(), lineText2.GetHashCode());
}

[Test]
public void GetHashCode_DifferentContent_ShouldReturnDifferentHash()
{
LineText lineText1 = "hello";
LineText lineText2 = "world";

Assert.AreNotEqual(lineText1.GetHashCode(), lineText2.GetHashCode());
}

[Test]
public void GetHashCode_EmptyLineText_ShouldReturnZero()
{
Expand Down Expand Up @@ -390,10 +379,12 @@ public void GetHashCode_SameInstance_ShouldBeConsistent()
}

[Test]
public void GetHashCode_DifferentArraysSameContent_ShouldReturnSameHash()
public void GetHashCode_DifferentStringInstances_SameContent_ShouldReturnSameHash()
{
// avoid declaring these as const and use this pattern to dodge string interning
// which would make them reference the same object and not test the content-based hash code properly
string buffer1 = "hello";
string buffer2 = "hello";
string buffer2 = new string("hello".ToCharArray());

LineText lineText1 = buffer1.AsMemory();
LineText lineText2 = buffer2.AsMemory();
Expand Down Expand Up @@ -423,27 +414,12 @@ public void GetHashCode_UnicodeContent_ShouldWork()
}

[Test]
public void GetHashCode_SimilarStrings_ShouldProduceDifferentHashes()
{
// These are similar but should have different hashes
LineText lineText1 = "abc";
LineText lineText2 = "abd";
LineText lineText3 = "bbc";

Assert.AreNotEqual(lineText1.GetHashCode(), lineText2.GetHashCode());
Assert.AreNotEqual(lineText1.GetHashCode(), lineText3.GetHashCode());
Assert.AreNotEqual(lineText2.GetHashCode(), lineText3.GetHashCode());
}

[Test]
public void GetHashCode_SingleCharacter_ShouldWork()
public void GetHashCode_SingleCharacter_WithSameContent_ShouldWork()
{
LineText lineText1 = "a";
LineText lineText2 = "a";
LineText lineText3 = "b";

Assert.AreEqual(lineText1.GetHashCode(), lineText2.GetHashCode());
Assert.AreNotEqual(lineText1.GetHashCode(), lineText3.GetHashCode());
}

#endregion
Expand Down
Loading
Loading