Skip to content

ashtonckj/Classic-ASP-Language-Support

Repository files navigation

Classic ASP Language Support Logo
Classic ASP Language Support for VSCode

Version: 0.3.7 Downloads License: MIT


πŸ“Έ See It In Action

Using Catppuccin Theme

Formatting Before & After SQL Syntax Highlighting

πŸš€ Quick Start

Action Shortcut
Format document Alt + Shift + F (Win/Linux) Β· Option + Shift + F (Mac)
Trigger IntelliSense Ctrl + Space or just start typing
Insert snippet Type prefix β†’ Tab
Go to definition F12 or Ctrl + Click
Follow include link Ctrl + Click on the file path

✨ Features

🎨 Smart Formatting

  • Multi-language β€” VBScript, HTML, CSS, JavaScript, and SQL in a single keystroke
  • VBScript β€” smart indentation across all control structures and multi-block <% %> regions
  • HTML/CSS/JS β€” formatted by Prettier, fully configurable
  • Keyword casing β€” your choice of PascalCase, UPPERCASE, or lowercase

πŸ’‘ IntelliSense & Auto-Completion

  • Context-aware β€” correct suggestions whether you're in ASP, CSS, JS, or HTML
  • COM object tracking β€” type rs. after Set rs = Server.CreateObject("ADODB.Recordset") to see all methods and properties
  • Cross-file IntelliSense β€” variables and functions from #include'd files appear in suggestions automatically
  • File paths β€” live browsing inside #include and href/src/action attributes

πŸ” Hover, Definition & Links

  • Hover docs β€” inline documentation for keywords, functions, COM members, and CSS properties
  • Go to definition β€” F12 across the current file and all included files
  • Document links β€” Ctrl + Click navigation on #include paths and local file attributes

🌈 Syntax Highlighting

  • ASP regions β€” toggleable background colouring for <% %> blocks, light and dark themes
  • Semantic colouring β€” user-defined functions and sub names
  • Smart SQL β€” highlights SQL inside strings; plain strings are left untouched

πŸ”΄ Diagnostics

  • HTML β€” mismatched structural tags flagged with orange squiggles
  • VBScript β€” unmatched control blocks (If/End If, Sub/End Sub, For/Next, etc.)
  • CSS β€” errors and warnings inside <style> blocks as you type
  • Void elements β€” invalid closing tags caught with a one-click quick fix

⌨️ Smart Key Handling

  • Context-aware Enter/Tab β€” correct indentation inside <% %> blocks automatically
  • Auto de-indent β€” closing keywords (End If, Next, etc.) de-indent as you type
  • Auto-close β€” HTML and ASP comment blocks close automatically

πŸ“ Snippets

ASP / VBScript
Prefix Inserts
asp <% %> code block
aspo <%= %> output expression
rw Response.Write("...")
rr Response.Redirect("...")
rf Request.Form("...")
rq Request.QueryString("...")
sco Server.CreateObject("...")
dbconn Full ADODB.Connection open/close template
rs Full Recordset open β†’ loop β†’ close template
inc <!--#include file="..."-->
HTML
Prefix Inserts
html5 HTML5 boilerplate
! <!DOCTYPE html>
table Table with <thead> and <tbody>
form Form with action and method
divc / divid Div with class / ID
script:src External script tag
link:css Stylesheet link tag
JavaScript
Prefix Inserts
log console.log()
fetch Fetch API with .then() / .catch()
listener addEventListener with handler
gebi document.getElementById()
qs document.querySelector()
timeout setTimeout with callback

πŸ”Œ Compatibility

Extension Status Notes
Prettier βœ… Integrated Already bundled β€” no separate install needed
Error Lens βœ… Compatible Displays diagnostics inline
Auto Rename Tag βœ… Compatible Rename opening/closing HTML tags together
GitLens βœ… Compatible Git blame, history, and code insights
Indent Rainbow βœ… Compatible Colour-coded indentation levels
Lorem Ipsum βœ… Compatible Quick placeholder text insertion
Color Highlight βœ… Compatible Highlights CSS colour values inline
Better Comments βœ… Compatible Colour-coded comment annotations
Inline Bookmarks βœ… Compatible In-editor bookmark tracking
HTTP Status Codes βœ… Compatible HTTP status code reference on hover
ASP HTML Tag Matcher βœ… Compatible Highlights matching HTML tags in ASP files
HTML CSS Support ⚠️ Caution May conflict with built-in HTML completions β€” test before use
ASP Classic Support ❌ Incompatible Already integrated into this extension
Classic ASP Syntaxes & Snippets ❌ Incompatible Already integrated into this extension

πŸ’‘ Bracket pair colourisation works natively with ASP files β€” enable it via editor.bracketPairColorization.enabled and editor.guides.bracketPairs in VS Code settings.


βš™οΈ Configuration

πŸ“‹ Full Settings List

VBScript Formatting

Setting Default Description
aspLanguageSupport.keywordCase PascalCase lowercase Β· UPPERCASE Β· PascalCase
aspLanguageSupport.aspTagsOnSameLine false Keep <% %> on the same line as code
aspLanguageSupport.htmlIndentMode flat flat β€” VBScript always at column 0; continuation β€” follows HTML nesting

Prettier (HTML/CSS/JS)

Setting Default Description
aspLanguageSupport.prettier.printWidth 80 Wrap lines at this column width
aspLanguageSupport.prettier.tabWidth 2 Spaces per indentation level
aspLanguageSupport.prettier.useTabs false Use tabs instead of spaces
aspLanguageSupport.prettier.bracketSameLine false Put > on last attribute line
aspLanguageSupport.prettier.semi true Add semicolons in JavaScript
aspLanguageSupport.prettier.singleQuote false Use single quotes in JavaScript
aspLanguageSupport.prettier.arrowParens always Arrow function parentheses
aspLanguageSupport.prettier.trailingComma es5 Trailing comma style
aspLanguageSupport.prettier.endOfLine lf Line ending style
aspLanguageSupport.prettier.htmlWhitespaceSensitivity css HTML whitespace handling

Syntax Highlighting

Setting Default Description
aspLanguageSupport.highlightAspRegions true Highlight ASP regions
aspLanguageSupport.bracketLightColor rgba(255, 100, 0, 0.2) Bracket colour (light theme)
aspLanguageSupport.bracketDarkColor rgba(0, 100, 255, 0.2) Bracket colour (dark theme)
aspLanguageSupport.codeBlockLightColor rgba(100, 100, 100, 0.1) Code block colour (light)
aspLanguageSupport.codeBlockDarkColor rgba(220, 220, 220, 0.1) Code block colour (dark)

πŸ“‹ Known Limitations

  • ASP blocks must be properly closed (<% ... %>) for formatting and diagnostics to work correctly
  • Complex mixed HTML/ASP structures may occasionally require manual adjustment after formatting
  • #include virtual="..." paths are resolved from the first workspace folder root

πŸ› οΈ Development

Building from Source

Prerequisites: Node.js 16+ Β· VS Code 1.80+

git clone https://github.com/ashtonckj/Classic-ASP-Language-Support.git
cd Classic-ASP-Language-Support
npm install
npm run compile
# Press F5 in VS Code to launch the Extension Development Host

🀝 Contributing

Contributions are welcome! If you have ideas, bug reports, or want to improve the extension:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add amazing feature')
  4. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
  5. πŸŽ‰ Open a Pull Request

πŸ™ Acknowledgements

This extension wouldn't be possible without these amazing projects:


If you find this extension helpful, please consider leaving a ⭐ on GitHub and a rating on the VS Code Marketplace!
Made with ❀️ for the Classic ASP community

About

Formatting, IntelliSense, Auto-Completion, and Syntax Highlighting for Classic ASP files with HTML, CSS, JavaScript, SQL, and VBScript.

Resources

License

Stars

Watchers

Forks

Contributors