Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Clang Auto SemicolonNew to Visual Studio Code? Get it now.
Clang Auto Semicolon

Clang Auto Semicolon

noname

|
15 installs
| (0) | Free
Append a missing semicolon to C statements on a new line or when a completion is accepted
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Clang Auto Semicolon

Adds the ; you forgot the moment you leave a line of C. Written for embedded C (Renesas RL78 / CC-RL), where a missing semicolon is the most common compile error.

Features

  • Semicolon on the line you leave — pressing Enter, inserting a line above or below, or moving off the line with ↑/↓ parses the line you left with tree-sitter and appends ; only if it is a statement that must end in one, so int a = 1 becomes int a = 1; while if (x), #define, comments and unfinished expressions are left alone.
  • Completion acceptance finishes the statement — accepting a suggestion with Tab or Enter turns counter = coun into counter = counter; and puts the cursor after the semicolon. Nothing is added when the accepted item leaves the cursor mid-line (a snippet placeholder such as f(|)) or when the statement is still incomplete.
  • No doubled semicolons — for three seconds after an automatic ;, typing ; yourself leaves one, not ;;, the same way auto-closing brackets behave. It works by removing the duplicate rather than claiming the ; key, so a keymap extension that binds ; keeps working.
  • Missing : on switch labels — case 0 or default left on its own line gets its colon instead of a semicolon.
  • Conservative where the parse is unclear — unparseable regions such as RL78 SFR bit access (P1.0 = 1) fall back to a line-level rule that prefers adding nothing. Undo/redo, paste, Enter in the middle of a line, mouse clicks and multiple cursors never trigger it, and one Ctrl+Z removes the new line and the added character together.

Usage

Works automatically. A file is handled when its language is c, or when its name ends in .c or .h in any letter case — the name rule matters when a setting such as "files.associations": { "*.C": "cpp" } makes Windows report C files as C++. Real C++ files (.cpp, .hpp, .cc) are left alone.

The Tab / Enter acceptance path is the command Clang Auto Semicolon: Accept Suggestion and Append Semicolon (clangAutoSemicolon.acceptSuggestion), bound to those keys only while the suggestion widget has a focused item in a handled file. Rebind it if your keymap needs different keys.

Settings

Setting Default Purpose
clangAutoSemicolon.enabled true Turn the extension on or off.
clangAutoSemicolon.completionSemicolon true Append the ; when a completion is accepted, and swallow a ; typed right after it.
clangAutoSemicolon.keywordMacros ["STATIC", "EXTERN", "CONST", "VOLATILE"] Macros that expand to keywords (e.g. #define STATIC static in a shared header). They are ignored when judging a line, so STATIC U1 waits for its variable name. #define lines in the edited file are picked up automatically. Remove a name here if your code uses it as an ordinary variable.
clangAutoSemicolon.debugLog false Write to the Clang Auto Semicolon output channel why an edit was skipped or what was inserted.

Requirements

Visual Studio Code 1.100.0 or later.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft