Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Trait-CNew to Visual Studio Code? Get it now.
Trait-C

Trait-C

BASELABS GmbH

|
1,167 installs
| (5) | Free
Trait-C language support for Visual Studio Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Trait-C for Visual Studio Code

This extension adds language support for Trait-C to Visual Studio Code.

Quick Start

  1. Install the Trait-C compiler.
  2. Install this Trait-C extention for Visual Studio Code.
  3. Open or create a *.tc file and start coding!

Features

The following features are provided:

1. Syntax Highlighting

The keywords of Trait-C are highlighted. Also, the syntax of C code, embedded in Trait-C templates, is highlighted.

syntax highlighting image

2. Snippets

Snippets make it easier to enter repeating code patterns. The following Trait-C code snippets are defined:

  • type declaration
  • trait declaration
  • trait implementation
  • generic trait implementation
  • function item declaration
  • function item definition
  • constant item definition
  • fragment declaration
  • tcdoc annotations (used by the tool tcdoc)

using snippets image

Also, you can see the available snippets by running Insert Snippet in the Command Palette.

3. Problem Matcher

Errors and warnings emitted by the Trait-C compiler are shown in the Problems view of Visual Studio Code. Each problem is also marked and described within the code, e.g. like this:

problem matcher image

The problem matcher can be used in a tasks.json file via its name reference $traitcc, like so:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "command": "traitcc compile src",
            "problemMatcher": "$traitcc"
        }
    ]
}

The compilation of the Trait-C code is started with the command traitcc compile src. In case of a problem, the output of the Trait-C compiler is the input of the problem matcher. By running the task, the problem matcher $traitcc is activated.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft