GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - michaelblyons/SublimeSyntax-HTML-CSharp: Sublime Text syntax highlighting for HTML with embedded C#: WebForms/ASP.Net and Razor

BranchesTags
Open more actions menu

Latest commit

 

History

122 Commits
122 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.messages
.messages
 
 
Razor
Razor
 
 
WebForms
WebForms
 
 
.gitattributes
.gitattributes
 
 
Default.sublime-commands
Default.sublime-commands
 
 
HTML (C#).sublime-settings
HTML (C#).sublime-settings
 
 
LICENSE.md
LICENSE.md
 
 
Main.sublime-menu
Main.sublime-menu
 
 
README.md
README.md
 
 
messages.json
messages.json
 
 
plugin.py
plugin.py
 
 

Repository files navigation

HTML (C#)

This project contains syntax highlighting and completions in Sublime Text for .cshtml, .aspx, and similar files. It was originally created for .Net WebForms, but later expanded to support Razor syntax as well.

WebForms

Microsoft's ASP.Net pages with C# were the first thing that this package supported. The syntaxes also work for .Net MVC. The ASP syntax that Sublime Text ships with only supports Visual Basic.

Current support

Highlighting

  • Embedded C# script blocks (<script runat="server">)
    • The runat="server" must immediately follow the tag opening.
  • ASP.Net inline expressions
    • Server-side comments (<%--)
    • Directives (<%@)
    • Output (<%=, <%#, <%:, <%#:, <%$)
    • Embedded code blocks (<%)

Functionality

  • Hotkey comment/uncomment server-side comments (Ctrl+/ or Cmd+/)
  • Snippets for <%-ish expressions
  • Snippets for some directives (Try page or import)
    • Default attributes are subject to change.
  • Snippets may require Ctrl+Space, depending on your environment.
  • Some autocomplete within directives.
  • Basic "Open CodeBehind" shortcut for frontend pages.
  • Naive "Open Front End" shortcut for codebehind files.

To-Do (maybe)

  • Identify more attributes of directives
  • Snippets and/or completions for ASP.Net builtins

Known issues

  • Nothing yet? 🤞
  • File new issues on GitHub

Razor

Microsoft later released a simplified, less-intrusive frontend templating syntax that supplanted WebForms.

First version thanks to Keith Hall. Rebuilt by Michael Lyons. Also see LoneBoco's version.

Current Support

Highlighting

  • Support for many @ expressions
  • See Known Issues below for exceptions

Functionality

  • Hotkey comment/uncomment server-side comments (Ctrl+/ or Cmd+/)

Known issues

  • Trouble with @( in CSS- or JS-embedding HTML attributes if the expression contains the tag string delimiter.
  • No support for @bind attributes.
  • Chaining expressions together like @if-for-etc. may require curly braces, even for single commands.
  • File new issues on GitHub

About

Sublime Text syntax highlighting for HTML with embedded C#: WebForms/ASP.Net and Razor

Topics

asp-netmvcrazorsublime-textsublime-text-pluginsyntax-highlightingwebforms

Resources

Readme
MIT license
Activity

Stars

6 stars

Watchers

3 watching

Forks

5 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.