Skip to content

Commit

Permalink
Use textmatesharp grammars nuget (#210)
Browse files Browse the repository at this point in the history
* Remove project AvaloniaEdit.TextMateSharp.Grammars

It was moved to repository TextMateSharp, https://github.com/danipen/TextMateSharp/tree/master/src/TextMateSharp.Grammars

* Update AvaloniaEdit.sln

* Use the nuget instead of the project reference

* Update README.md

* Update azure-pipelines.yml

* Fixed missing '

* remove extra lines

Co-authored-by: Takoooooo <[email protected]>
  • Loading branch information
danipen and Takoooooo authored Feb 18, 2022
1 parent 24293dd commit 67dadab
Show file tree
Hide file tree
Showing 299 changed files with 14 additions and 160,326 deletions.
10 changes: 0 additions & 10 deletions AvaloniaEdit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.TextMate", "src\AvaloniaEdit.TextMate\AvaloniaEdit.TextMate.csproj", "{63826C17-C08C-4E5F-AABB-443EBA565E92}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaEdit.TextMate.Grammars", "src\AvaloniaEdit.TextMate.Grammars\AvaloniaEdit.TextMate.Grammars.csproj", "{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -59,14 +57,6 @@ Global
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|Any CPU.Build.0 = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.ActiveCfg = Release|Any CPU
{63826C17-C08C-4E5F-AABB-443EBA565E92}.Release|x64.Build.0 = Release|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Debug|x64.ActiveCfg = Debug|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Debug|x64.Build.0 = Debug|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Release|Any CPU.Build.0 = Release|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Release|x64.ActiveCfg = Release|Any CPU
{8FBDB2C4-A830-4CF4-94B4-06F06798EEAE}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AvaloniaVersion>0.10.12</AvaloniaVersion>
<TextMateSharpVersion>1.0.24</TextMateSharpVersion>
<TextMateSharpVersion>1.0.25</TextMateSharpVersion>
<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
<Version>0.10.12.1</Version>
</PropertyGroup>
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@ AvaloniaEdit supports features like:

* Syntax highlighting using [TextMate](https://github.com/danipen/TextMateSharp) grammars
* Line numeration
* Rectangular selection
* Intra-column adornments
* Word wrapping
* Scrolling below document
* Hyperlinks

and many,many more!

AvaloniaEdit currently consists of 3 packages
AvaloniaEdit currently consists of 2 packages
* [Avalonia.AvaloniaEdit](https://www.nuget.org/packages/Avalonia.AvaloniaEdit) well-known package that incudes text editor itself.
* [AvaloniaEdit.TextMate](https://www.nuget.org/packages/AvaloniaEdit.TextMate/) package that adds TextMate integration to the AvaloniaEdit.
* [AvaloniaEdit.TextMate.Grammars](https://www.nuget.org/packages/AvaloniaEdit.TextMate.Grammars/) grammars for TextMate and additional infrastructure that helps you to use them.

### How to set up TextMate theme and syntax highlighting for my project?
First of all, if you want to use grammars supported by TextMateSharp, should install the following packages:
- [AvaloniaEdit.TextMate](https://www.nuget.org/packages/AvaloniaEdit.TextMate/)
- [TextMateSharp.Grammars](https://www.nuget.org/packages/TextMateSharp.Grammars/)

### How to set up theme and syntax highlighting for my project?
First of all, if you want to use grammars that we support you should install [package](https://www.nuget.org/packages/AvaloniaEdit.TextMate.Grammars/) with them and [package](https://www.nuget.org/packages/AvaloniaEdit.TextMate/) with TextMate integration otherwise you just install the package with TextMate integration and implement IRegistryOptions interface, that's currently the easiest way in case you want to use AvaloniaEdit with the set of grammars different from in-bundled.
Alternatively, if you want to support your own grammars, you just need to install the AvaloniaEdit.TextMate package, and implement IRegistryOptions interface, that's currently the easiest way in case you want to use AvaloniaEdit with the set of grammars different from in-bundled TextMateSharp.Grammars.
```csharp
//First of all you need to have a reference for your TextEditor for it to be used inside AvaloniaEdit.TextMate project.
var _textEditor = this.FindControl<TextEditor>("Editor");
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- task: DotNetCoreCLI@2
displayName: 'Pack AvaloniaEdit'
inputs:
packagesToPack: 'src\AvaloniaEdit\AvaloniaEdit.csproj;src\AvaloniaEdit.TextMate\AvaloniaEdit.TextMate.csproj;src\AvaloniaEdit.TextMate.Grammars\AvaloniaEdit.TextMate.Grammars.csproj'
packagesToPack: 'src\AvaloniaEdit\AvaloniaEdit.csproj;src\AvaloniaEdit.TextMate\AvaloniaEdit.TextMate.csproj'
command: pack
outputDir: '$(Build.ArtifactStagingDirectory)/NuGet'
verbosityPack: normal
Expand Down
1 change: 0 additions & 1 deletion src/AvaloniaEdit.Demo/AvaloniaEdit.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<ProjectReference Include="..\AvaloniaEdit.TextMate.Grammars\AvaloniaEdit.TextMate.Grammars.csproj" />
<ProjectReference Include="..\AvaloniaEdit\AvaloniaEdit.csproj" />
<ProjectReference Include="..\AvaloniaEdit.TextMate\AvaloniaEdit.TextMate.csproj" />
</ItemGroup>
Expand Down
4 changes: 1 addition & 3 deletions src/AvaloniaEdit.Demo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;

using System.Runtime.CompilerServices;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.Media.Imaging;

using AvaloniaEdit.CodeCompletion;
using AvaloniaEdit.Demo.Resources;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
using AvaloniaEdit.Folding;
using AvaloniaEdit.Rendering;
using AvaloniaEdit.TextMate;
using AvaloniaEdit.TextMate.Grammars;
using TextMateSharp.Grammars;

namespace AvaloniaEdit.Demo
{
Expand Down

This file was deleted.

98 changes: 0 additions & 98 deletions src/AvaloniaEdit.TextMate.Grammars/GrammarDefinition.cs

This file was deleted.

54 changes: 0 additions & 54 deletions src/AvaloniaEdit.TextMate.Grammars/GrammarNames.cs

This file was deleted.

Loading

0 comments on commit 67dadab

Please sign in to comment.