Skip to content

Files, tags, includes

Everything the compiler reads is CL++. The extension only chooses role.

ExtensionRoleC++ analogEmitted?
.clhHeader: struct, constants, prototypes.hTypes and constants; no function bodies
.clpModule implementation.c / untagged .cppModuleScript by default
.clppScript / methods.cppScript / LocalScript / ModuleScript from the tag

Prefer .clh + .clpp: declare in the header, define in the script.

SourceInstance
Foo.server.clppScript
Foo.client.clppLocalScript
Foo.plugin.clppPlugin Script
Foo.legacy.clppLegacy Script
Foo.clp / Foo.clpp (no tag)ModuleScript
Foo.clhtype ModuleScript
#include <clpp/roblox.clh>
#include <clpp/libs/janitor.clh>
#include "LeaderstatsServer.clh"
#include "../shared/PlayerData.clh"
FormEffect
<clpp/roblox.clh>IntelliSense only
<clpp/libs/janitor.clh>IntelliSense and require
"Stem.clh" with the same stemInlined into the .clpp
"Other.clh"require

#pragma once is valid in .clh (include guard). #pragma strict--!strict. #pragma nostrict--!nonstrict. #pragma native--!native. #pragma optimize / #pragma optimize 2--!optimize 2.

using …; is skipped. namespace { } is flattened. // and /* */ comments are stripped.

Next: Types and values.