Official Visual Studio Code extension that wires up a TypeScript language-service plugin to inject Golt Runtime typings into your workspace when a golt.json file is present.
Repository: https://github.com/Aztekode/golt-vscode
- Activates when VS Code detects
golt.jsonin the workspace. - Registers a TypeScript Server Plugin named
golt-ts-plugin(enabled for workspace TypeScript versions). - When a Golt project is detected, injects the global typings file golt.d.ts into the TypeScript language service so you get IntelliSense without imports.
This repo contains two parts:
- VS Code extension entrypoint: extension.ts
- On activation, it currently only logs:
[Golt] Languaje Server Plugin Injected successfully.
- On activation, it currently only logs:
- TypeScript Server Plugin: golt-ts-plugin/index.js
create(info)logs initialization and returns the existinglanguageServiceunchanged.getExternalFiles(project)checks whethergolt.jsonexists inproject.getCurrentDirectory().- If present, it returns the resolved path to golt.d.ts, causing TypeScript to include those global types in the project.
- If not present, it returns an empty list (no types injected).
- Open VS Code.
- Go to Extensions (
Ctrl+Shift+X). - Search for
golt-vscode(orGolt Runtimeif published under that name). - Install the extension.
- Install dependencies:
pnpm install- Build the extension:
pnpm run compile- Run the extension in the VS Code Extension Development Host:
- Open this repo in VS Code
- Press
F5
- Add a
golt.jsonfile to the directory TypeScript considers the project root for your workspace (commonly the workspace root). - Open any
.ts/.jsfile in that project. - Use the global
Goltnamespace (no imports required).
If IntelliSense does not appear immediately, run “Developer: Reload Window” and retry.
No user-facing settings are currently defined. Project detection is file-based:
- Required:
golt.jsonin the TypeScript project directory (project.getCurrentDirectory()).
All types are injected globally from golt.d.ts. The most important surfaces are summarized here.
function fetch(url: string, options?: {
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
headers?: Record<string, string>;
body?: string;
timeout?: number;
}): Promise<{
ok: boolean;
status: number;
statusText: string;
headers: { get(name: string): string | null };
text(): Promise<string>;
json<T = any>(): Promise<T>;
}>;Golt.env: Record<string, string | undefined>Golt.App(): Golt.AppInstanceGolt.db: Golt.DatabaseGolt.fs: Golt.FsGolt.crypto: Golt.CryptoGolt.jwt: Golt.JwtGolt.logger(config?): Golt.Middleware
Golt.AppInstance supports:
use(middleware)get(path, handler),post(...),put(...),delete(...)static(prefix, dirPath, spa?)notFound(handler)serve(port)
Handlers receive a Golt.Context with helpers like:
Method(),Url(),Param(name),Query(key)GetHeader(key),SetHeader(key, value)Status(code),Send(body),Json(data)ValidateBody(schema)(simple schema inference for"string" | "number" | "boolean")
type DbDialect = "sqlite" | "postgres" | "mysql" | "sqlserver";
const client = Golt.db.connect("postgres", "postgres://user:pass@host:5432/db");
const rows = await client.query<{ id: number }>("select id from users where id = $1", 1);
client.close();const app = Golt.App();
app.get("/", (c) => {
c.Json({ message: "Hello from Golt!" });
});
app.serve(3000);const app = Golt.App();
app.use(Golt.logger({ format: "dev" }));
app.get("/health", (c) => {
c.Status(200).Send("ok");
});const res = await fetch("https://example.com/api", { method: "GET", timeout: 5000 });
const data = await res.json<{ ok: boolean }>();- No
GoltIntelliSense:- Ensure
golt.jsonexists in the TypeScript project directory (often the workspace root). - Reload the window.
- Make sure you are editing a file handled by TypeScript/JavaScript language features.
- Ensure
- Confirm plugin loaded:
- Open “TypeScript: Open TS Server Log”.
- Look for messages starting with
[Golt Plugin], such as:Initializing Golt Runtime Support...Golt project detected. Injecting global types: ...golt.d.ts
- src/extension.ts: VS Code extension activation entrypoint
- golt-ts-plugin/index.js: TypeScript Server Plugin (project detection + external typings)
- golt-ts-plugin/golt.d.ts: injected global typings
- package.json: activates on
workspaceContains:golt.jsonand contributes the TS server plugin