Skip to content

rabbit59/mIRCLanguageExtension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

mIRC Language Extension for Visual Studio

A comprehensive language extension for mIRC scripting in Visual Studio 2026+, featuring advanced syntax highlighting, IntelliSense, bracket pair colorization, and optional code snippets.

Visual Studio License mIRC

✨ Features

🎨 Syntax Highlighting

  • VS Code Dark Modern Theme - Professional color scheme matching modern IDEs
  • Smart Comment Detection - Both line (;) and block (/* */) comments
  • 300+ Built-in Identifiers - Distinct coloring for mIRC native functions
  • Context-Aware - Comments, strings, and identifiers handled correctly

🌈 Bracket Pair Colorization

  • Rainbow Brackets - 6-level color cycling for nested braces, brackets, and parentheses
  • Mismatched Detection - Unmatched or incorrect braces highlighted in red
  • Real-time Feedback - Instant visual indication of syntax errors

πŸ” Brace Matching

  • Smart Highlighting - Click next to any brace to see its matching pair
  • Comment-Aware - Ignores braces inside comments and strings
  • All Bracket Types - Works with { }, [ ], and ( )

πŸ’‘ IntelliSense & Code Completion

  • 735+ Completions - Keywords, commands, events, identifiers, and operators always available
  • Filtered Suggestions - Category icons for easy navigation (Keywords, Commands, Events, Identifiers, Operators)
  • Rich Tooltips - Descriptions sourced from the mIRC help file and mhelp
  • Instant Insertion - Type and press Tab or Enter
  • Ctrl+Space Trigger - Manual completion anywhere

πŸ“ Code Snippets (optional β€” disabled by default)

  • 735 Snippets - Full coverage of commands, events, identifiers, and operators
  • Tab Completion - Type shortcut and press Tab
  • Editable Placeholders - Tab through parameters
  • See Enabling Snippets below

πŸ“Έ Screenshots

Syntax Highlighting

Syntax Highlighting

Bracket Pair Colorization

Bracket Pair Colorization

Brace Matching

Brace Matching

Mismatched Braces

Mismatched Braces

IntelliSense Completion

IntelliSense

πŸš€ Installation

From VSIX Package

  1. Download the latest .vsix file from Releases
  2. Double-click the .vsix file
  3. Follow the Visual Studio Extension Installer prompts
  4. Restart Visual Studio

From Source

  1. Clone this repository
  2. Open mIRCLanguageExtension.slnx in Visual Studio 2026+
  3. Build the solution (Ctrl+Shift+B)
  4. Press F5 to launch experimental instance
  5. Install from bin\Debug\ or bin\Release\ folder

πŸ”Œ Enabling Snippets

Snippets are disabled by default. When enabled they add 735 snippet templates to the VS snippet picker (Ctrl+K, Ctrl+X) on top of the existing IntelliSense completions.

⚠️ Note: Enabling snippets is noisy. The snippet picker will show all 735 entries and the IntelliSense dropdown will also include them alongside the standard completions, resulting in a lot of duplicate entries. This is best used for testing or exploration rather than day-to-day scripting.

Step 1 β€” Enable snippet loading in code

In mIRCCompletionProvider.cs, the snippet loading is guarded by a conditional compilation symbol. To enable it, add ENABLE_SNIPPETS to your project's compilation symbols:

Option A β€” Project Properties (per configuration):

  1. Right-click the project β†’ Properties
  2. Select the Build tab
  3. In Conditional compilation symbols, add ENABLE_SNIPPETS
  4. Rebuild

Option B β€” Edit .csproj directly (all configurations):

<PropertyGroup>
  <!-- Remove comment to enable snippets in all configurations -->
  <!-- <DefineConstants>$(DefineConstants);ENABLE_SNIPPETS</DefineConstants> -->
</PropertyGroup>

Remove the comment tags around the <DefineConstants> line and rebuild.

Step 2 β€” Enable the snippet picker in Visual Studio

The snippet picker registration is commented out in mirc.pkgdef by default. To enable it, open mirc.pkgdef and uncomment the CodeExpansions section:

; ── Uncomment to enable snippet picker ──────────────────────────────────────
;[$RootKey$\Languages\CodeExpansions\mIRC]
;@="mIRC Script"
;"DisplayName"="mIRC Script"
;"IndexPath"="$PackageFolder$\Snippets\SnippetsIndex.xml"
;"Package"="{F5B8C2A3-7D4E-4B9A-8C1F-2E6D7A9B3C4E}"
;"LangStringId"="mIRC"
;"ShowRoots"=dword:00000000
;
;[$RootKey$\Languages\CodeExpansions\mIRC\ForceCreateDirs]
;"mIRC"="$MyDocuments$\Visual Studio 2026\Code Snippets\mIRC\My mIRC Snippets"
;
;[$RootKey$\Languages\CodeExpansions\mIRC\Paths]
;"mIRC"="$PackageFolder$\Snippets"

Select those lines and use Edit β†’ Advanced β†’ Uncomment Selection (Ctrl+K, Ctrl+U), then rebuild and redeploy.

Disabling snippets again

  1. Comment the <DefineConstants> line back out in .csproj (or remove ENABLE_SNIPPETS from Project Properties)
  2. Comment the CodeExpansions block back out in mirc.pkgdef
  3. Rebuild and redeploy
  4. Run Extensions β†’ Extension Development β†’ Reset Experimental Instance to clear the registry entries from the previous deployment

πŸ“‹ Syntax Elements

Color Scheme (VS Code Dark Modern)

Element Color Example
Keywords Pink #C586C0 if, while, alias
Variables Light Blue #9CDCFE %myvar, %count
User Identifiers Yellow #DCDCAA $myfunc, $custom
Built-in Identifiers Teal #4EC9B0 $me, $chan, $nick
Comments Green #6A9955 ; comment, /* block */
Strings Orange #CE9178 "text", 'string'
Mismatched Braces Red #FF5555 Unbalanced {, }

Bracket Pair Colors

Level Color Hex
1 Gold #FFD700
2 Pink #FF82FF
3 Cyan #00FFFF
4 Light Green #96FF96
5 Orange #FFB450
6 Sky Blue #87CEFA

Colors cycle after level 6 for deeper nesting.

πŸ“¦ Snippets (when enabled)

Snippets are stored in the Snippets\ folder and cover all mIRC commands, events, identifiers, and operators. They are only active when ENABLE_SNIPPETS is defined and the CodeExpansions block in mirc.pkgdef is uncommented β€” see Enabling Snippets.

Usage: Type snippet shortcut and press Tab, or use Ctrl+K, Ctrl+X to browse.

⌨️ Keyboard Shortcuts

Action Shortcut
Trigger IntelliSense Ctrl+Space
Insert Snippet (when enabled) Ctrl+K, Ctrl+X
Next Placeholder Tab
Previous Placeholder Shift+Tab
Exit Snippet Mode Esc

🎨 Customization

Change Colors

  1. Go to Tools β†’ Options β†’ Environment β†’ Fonts and Colors
  2. Find items starting with "mIRC"
  3. Customize foreground/background colors
  4. Apply changes

Available items:

  • mIRC Keyword
  • mIRC Variable
  • mIRC Identifier
  • mIRC Built-in Identifier
  • mIRC Comment
  • mIRC String
  • mIRC Brace
  • mIRC Bracket Pair Level 1-6
  • mIRC Mismatched Bracket
  • mIRC Brace Matching

Add Custom Snippets

  1. Add new <CodeSnippet> entries to the relevant .snippet file in the Snippets\ folder
  2. Follow the existing XML format
  3. Rebuild and redeploy with snippets enabled

πŸ”§ Technical Details

File Extensions

  • .mrc - mIRC script files
  • .mirc - Alternative mIRC extension

Content Type

  • Content Type: mirc
  • Base Definition: text

Components

  • Syntax Classifier - Token-based highlighting
  • Comment Tagger - Multi-line block comment support
  • Bracket Colorization Tagger - Rainbow brackets with mismatch detection
  • Brace Matching Tagger - Highlight matching pairs
  • Completion Provider - IntelliSense with 735+ completions (always active)
  • Snippet System - 735 code templates (optional, disabled by default)

πŸ› Known Issues

  • Block comments spanning very large files (1000+ lines) may have slight performance impact
  • IntelliSense may not trigger inside comments (by design)
  • Enabling snippets produces duplicate entries in the IntelliSense dropdown alongside the standard completions

πŸ“ Changelog

Version 1.0.0

  • Initial release
  • Syntax highlighting for all mIRC elements
  • 300+ built-in identifier recognition
  • C-style block comments (/* */)
  • Rainbow bracket pair colorization
  • Mismatched brace detection
  • Brace matching
  • 735 IntelliSense completions with descriptions
  • 735 optional code snippets (disabled by default)
  • VS Code Dark Modern theme colors

Development Setup

  1. Clone the repository
  2. Open in Visual Studio 2026+
  3. Install Visual Studio SDK if not already installed
  4. Build and run (F5) to launch experimental instance

Adding Features

  • New Keywords: Edit keywords array in mIRCClassifier.cs
  • New Identifiers: Add to builtinIdentifiers HashSet in mIRCClassifier.cs
  • New Snippets: Add entries to the appropriate file in Snippets\
  • IntelliSense Items: Edit the hardcoded arrays in mIRCCompletionProvider.cs

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Credits

  • mIRC Icon: Sleek XP Software by deleket (CC BY-NC-SA 3.0)
  • Inspiration: vscode-mirc by lol2k
  • Help File: mhelp by RealKindOne
  • Development: Created with assistance from Claude (Anthropic AI) for syntax highlighting architecture, bracket pair colorization, theme integration, IntelliSense, and snippet generation

πŸ”— Links


Made with ❀️ for the mIRC scripting community

Supporting Visual Studio 2026 and newer

About

mIRC Language Extension for Visual Studio 2022+

Resources

Stars

Watchers

Forks

Contributors