Coder Social home page Coder Social logo

icsharpcode.texteditor-lexers's Introduction

Synopsis

This project is a compilation of lexers I had written for SharpDevelop's TextEditor component. I am indeed late to the party, as the component is no longer supported by SharpDevelop team; however, I spent a good chunk of time writing these lexers through the years and now I thought why not make them open source for everyone who's still using the component.

All lexers were created exclusively for ICSharpCode.TextEditor v3.2. They were not tested on any earlier or later releases.

Languages

List of all supported languages, sorted alphabetically:

A B C D E F G H I J K L N O P R S T V X
ActionScript Batch C# D Eiffel F# Go Haskell Icon Java KiXtart Lean Nemerle Obj-C ParaSail R Scala TCL Vala X10
Ada Boo C Dart Erlang Falcon Groovy Haxe ILYC JavaScript Kotlin Lisp Nim OCaml Pascal Registry Scheme Thrift VB.NET XC
ANTLR C++ Delphi Fantom Gui4Cli HTML INI/INF JSON Lua PHP Resource Solidity TypeScript VBScript XML
Assembly Ceylon Fortran95 Io Julia Pike Rexx Spike Verilog Xtend
AutoHotkey ChucK PowerShell Rust SQF VHDL
‌‌ Clojure Prolog SQL VS Solution
‌‌ Cocoa PureScript Swift Volt
‌‌ CoffeeScript Python
‌‌ Cool
‌‌ CSS

That makes 85 languages in total.

Notes

  • PHP: Heredoc highlighting is not supported. The syntax parser simply can't do it.
  • CSS: Omitting the last semicolon in the block is not supported. Same reason as above.

Usage

If you are on this page, you most likely already know how to activate the lexer and use it.
For a complete noob, this is how it is done:

C#

using System.IO;
using ICSharpCode.TextEditor.Document;
// insert the directory path of the desired .xshd file
var synDir = Application.StartupPath + "\\Syntax";

// check if directory exists to prevent throwing an exception
if (Directory.Exists(synDir))
{
    // create new provider with the highlighting directory
    var fsmProvider = new FileSyntaxModeProvider(synDir);
    // attach to the text editor
    HighlightingManager.Manager.AddSyntaxModeFileProvider(fsmProvider);
    // activate the highlighting, use the name from the SyntaxDefinition node in the .xshd file
    TextEditorControl.SetHighlighting("YourHighlighting");
}
else { MessageBox.Show("\u0027" + synDir + "\u0027" + " doesn't exist"); }

VB.NET

Imports System.IO
Imports ICSharpCode.TextEditor.Document
' insert the directory path of the desired .xshd file
Dim synDir As String = Application.StartupPath & "\Syntax"
' syntax provider
Dim fsmProvider As FileSyntaxModeProvider

If Directory.Exists(synDir) Then
    ' create new provider with the highlighting directory
    fsmProvider = New FileSyntaxModeProvider(synDir)
    ' attach to the text editor
    HighlightingManager.Manager.AddSyntaxModeFileProvider(fsmProvider)
    ' activate the highlighting, use the name from the SyntaxDefinition node in the .xshd file
    TextEditorControl.SetHighlighting("YourHighlighting")
Else
    MessageBox.Show(ChrW(39) + synDir + ChrW(39) + "doesn't exist")
End If

For more information on XSHD files, see here.

Contact Author

Email me your love letters
Tweet me maybe?

Legal

This project is distributed under the MIT License

icsharpcode.texteditor-lexers's People

Contributors

ei avatar xv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.