Skip to content

v2.0.0 not working In my local avalonia project #102

Description

@YoshihiroIto

Describe the bug

In my local Avalonia project, after updating the following NuGet packages:

  • TextMateSharp
  • TextMateSharp.Grammars
    from v1.0.70 to v2.0.0, the application stopped working and the exception below is thrown.
System.TypeLoadException: Method 'GetLineText' in type 'AvaloniaEdit.TextMate.TextEditorModel' from assembly 'AvaloniaEdit.TextMate, Version=11.3.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b' does not have an implementation.
   at AvaloniaEdit.TextMate.TextMate.Installation.SetTheme(IRawTheme theme)
   at AvaloniaEdit.TextMate.TextMate.Installation.SetTheme(IRawTheme theme)
   at AvaloniaEdit.TextMate.TextMate.Installation..ctor(TextEditor editor, IRegistryOptions registryOptions, Boolean initCurrentDocument)
   at AvaloniaEdit.TextMate.TextMate.InstallTextMate(TextEditor editor, IRegistryOptions registryOptions, Boolean initCurrentDocument)

Desktop (please complete the following information):

  • OS:Windows
  • Version 11

Activity

  1. deapstack commented on Dec 13, 2025

    @deapstack

    Same here

  2. YoshihiroIto commented on Dec 15, 2025

    @YoshihiroIto
    ContributorAuthor

    I applied the fixes locally based on the changes, built the project, and confirmed that it works. Thank you.

  3. danipen commented on Dec 15, 2025

    @danipen
    Owner

    See #100

    ⚠️ Breaking Changes

    • IModelLines.GetLineText() now returns LineText instead of string
    • IGrammar.TokenizeLine() signature changed to accept LineText

    Migration: Replace string with LineText in implementations. The implicit conversion from string means most call sites work unchanged.

  4. danipen commented on Dec 15, 2025

    @danipen
    Owner

    I'f you're using TextMateSharp via AvaloniaEdit, I will write a new PR to migrate to TextMateSharp v2.0.0 soon

  5. YoshihiroIto commented on Dec 15, 2025

    @YoshihiroIto
    ContributorAuthor

    TextMateSharp v2.0.0 introduced breaking changes, requiring updates to dependent implementations. Since AvaloniaEdit was affected, I applied the necessary fixes and built the project.

  6. udlose commented on Dec 15, 2025

    @udlose
    Contributor

    @YoshihiroIto I understand now. My bad. Thanks for clarifying.

    @danipen thanks for planning on merging the update into AvaloniaEdit - much appreciated! Hopefully, they create a release shortly thereafter. I'm still waiting to get the fix for this bug (TextEditor.SelectAll method doesn't work) which had a fix merged, but they never created a release for it.

  7. danipen commented on Dec 16, 2025

    @danipen
    Owner

    AvaloniaEdit changes to use TextMateSharp 2.0. PR: AvaloniaUI/AvaloniaEdit#550

  8. udlose commented on Dec 17, 2025

    @udlose
    Contributor

    AvaloniaEdit changes to use TextMateSharp 2.0. PR: AvaloniaUI/AvaloniaEdit#550

    @danipen I left a comment/question on your PR

  9. YoshihiroIto commented on Dec 18, 2025

    @YoshihiroIto
    ContributorAuthor

    @danipen I built this PR locally and confirmed that it works as expected. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions