Feng Language provides an out-of-the-box editing experience for Feng in VS Code. After installing the extension, you get syntax highlighting, document formatting, Feng Language Server client integration for source files, Feng debugger integration through feng dap, dedicated Feng manifest support for .fm, and distinct Feng file icons for source, manifest, bundle, and symbol-table files.
Features
- Syntax highlighting: Covers common Feng keywords, strings, comments, assignment and compound operators, and basic language structures, and highlights Feng manifest sections and
#comments in.fmfiles. - Document formatting: Normalizes indentation, whitespace, and common syntax spacing for day-to-day editing, including compound assignment and bitwise shift operators, and aligns manifest values inside
.fmsections. - Language Server client: For Feng source files, the extension launches
feng lspthrough the configured Feng executable and connects it using VS Code's standard Language Client. Hover, completion, definition, references, rename, diagnostics, and later language features are now sourced from the Feng LSP capability set exposed by your installed CLI. - Debugger integration: The extension contributes a Feng debug type that launches
feng dap --stdio, derives the defaultprogramfrom the nearesttarget: "bin"project manifest when possible, falls back to scanned workspacetarget: "bin"manifests when generatinglaunch.jsonwithout an active Feng source file, writes generatedprogramandcwdentries with${workspaceFolder}-style variables when possible, and ensures.vscode/tasks.jsoncontains the matching Feng build task used by the defaultpreLaunchTask. - Language Server restart: The command palette command
Feng: Restart Language Serverand the Feng LSP status bar item both stop the current language server and start a freshfeng lspprocess using the latestfeng.executablePathsetting. - Diagnostics compatibility: If the current Feng CLI does not yet advertise any LSP capability, the extension keeps the existing check-based diagnostics path as a temporary compatibility fallback so open/save validation does not regress.
- Icon support: The extension logo and the built-in
.feng/.ff,.fm,.fb, and.ftfile icons all use the latest Feng document icon family when your current file icon theme does not provide a Feng-specific icon.
Supported File Extensions
.fengand.fffor Feng source files.fmfor Feng manifests.fbfor Feng bundles.ftfor Feng symbol tables
Quick Start
- Install Feng Language from the VS Code Marketplace.
- Open any Feng source file and syntax highlighting will be enabled automatically.
- When you want to clean up code, run VS Code's Format Document command.
- If you already have the Feng CLI installed, the extension will start
feng lspautomatically for Feng source files. Language features are then provided by the LSP capabilities exposed by that CLI build. - Open Run and Debug, create a Feng launch configuration, and start debugging. When the active file belongs to a
target: "bin"Feng project, the extension derives the default launch binary and build task from the nearestfeng.fm; when you createlaunch.jsonfrom the Run and Debug view without an active Feng source file, it falls back to the workspace's discoveredtarget: "bin"manifests. - If your current CLI build still exposes an empty LSP capability set, the extension will temporarily keep open/save diagnostics through the legacy
checkpath until the server side is filled in.
To package the extension from this repository, run bash ./scripts/build_editor_extentions.sh at the repository root; the script enters editors/feng-vscode and runs npm run pack, which packages the extension through the repository-local vsce dependency.
Optional Configuration
If the feng executable is not available in your system PATH, you can configure it explicitly in VS Code settings:
{
"feng.executablePath": "./build/bin/feng"
}
This path can be either an absolute path or a path relative to the first workspace root.
When feng.executablePath keeps its default value, the extension runs feng directly from your system PATH.
The same executable setting is used for both feng lsp and feng dap.
Formatting Behavior
The formatter is designed to cover the most common cleanup tasks in everyday development:
- Adjust indentation around
{},(), and[] - Remove trailing whitespace at the end of each line
- Normalize line endings to
\n - Normalize binary and compound operator spacing, for example
a+b→a + b,total+=1→total += 1,mask>>=1→mask >>= 1 - Normalize parameter and argument lists, for example
func add(a:int,b:int)→func add(a: int, b: int) - Normalize spacing around
:,,, and{}in object literals and type annotations
For .fm manifest files, the formatter additionally:
- Normalizes
[section]headers - Normalizes
#comment spacing - Aligns
key: "value"entries within each section so values start in the same column
Its goal is to provide a stable and predictable formatting experience for daily use. It does not currently reflow complex expressions across lines or perform multi-line alignment.
Language Service
- Feng source files are connected through the standard VS Code Language Client by launching
feng lsp. - The default executable name is
feng, resolved through your systemPATH. - If your CLI is not in the default lookup path, set
feng.executablePathto the correct executable location. - Run
Feng: Restart Language Serverfrom the command palette, or click the Feng LSP status bar item, after rebuilding or changing the configured executable. - The extension keeps the built-in formatter and TextMate grammars; only language-service features move behind LSP.
- If the installed CLI currently reports an empty LSP capability set, the extension temporarily preserves the previous open/save diagnostics path by running
feng check --format json <file>for project files andfeng tool check <file>for standalone files.
Debugging
- The extension contributes a
fengdebug type that startsfeng dap --stdio. - On macOS,
feng dapfirst trieslldb-dapfromPATH; if that misses, it falls back toxcrun -f lldb-dap, which keeps packaged VS Code sessions working even when Xcode's debugger binaries are not exported directly inPATH. - When a launch configuration omits
program, the extension first tries to resolve it from the nearesttarget: "bin"project manifest by mappingnameandoutto<out>/<host-platform>/bin/<name>, then falls back to the unique discovered workspacetarget: "bin"project when no active Feng file is available. - When a launch configuration omits
preLaunchTask, the extension binds it to the generated Feng build task for that project. - When VS Code generates a Feng
launch.json, the extension also ensures.vscode/tasks.jsoncontains the matchingtype: "feng"build task so the generatedpreLaunchTaskresolves without manual setup. - Generated
programandcwdvalues prefer${workspaceFolder}-style variables over absolute paths whenever the Feng project lives inside the active workspace folder. - The current debug surface targets macOS +
lldb-dapand the non-releaselocaltarget=binbuild path. evaluatecurrently covers the read-only subset exposed byfeng dap: identifiers, member access, constant integer indexing, and simple arithmetic/comparison expressions. Function calls, assignments, and other unsupported watch expressions are rejected explicitly.