VS Code Features

Norn is not just a file format. The extension adds editor actions, test integration, Swagger coverage tooling, and environment-aware execution inside VS Code.

CodeLens in .norn Files

Clickable CodeLens actions appear directly above relevant lines in .norn files.

  • ▶ Send Request appears above standalone HTTP requests outside sequences.
  • ▶ Run Sequence appears above runnable sequence and test sequence declarations.
  • ▷ Debug Sequence appears next to runnable sequences for step-through debugging.
  • env: ... or + Add env file appears next to request and sequence actions so you can switch or create environments without leaving the editor.
  • Open Contract and View Contract appear on matchesSchema assertions.
.norn
GET https://api.example.com/health

test sequence ContractCheck
    GET https://api.example.com/users/1
    assert $1.body matchesSchema "./schemas/user.schema.json"
end sequence

▶ Send Request does not appear for requests inside a sequence because those requests run as part of the sequence action instead.

Contract Validation

Schema assertions integrate with the editor workflow, so you can move from a failing response to the exact contract mismatch quickly.

  • Open Contract opens the schema file referenced by a matchesSchema assertion. Paths can be relative or use the @/ alias for the workspace contracts/ folder.
  • View Contract reruns the enclosing sequence and opens a contract report for that assertion.
  • Hovering a validated matchesSchema line shows the current pass or fail status, schema path, last run, and a shortcut to open the contract view.
  • When schema validation fails in the response panel, the assertion output includes View Contract Details so you can inspect the mismatch directly from the run results.
.norn
test sequence GetUserContract
    GET {{baseUrl}}/users/1
    assert $1.status == 200
    assert $1.body matchesSchema "@/users/get-user-200.schema.json"
end sequence

The contract report separates breaking issues from warnings and lets you switch between the annotated response, the issue list, and the resolved schema.

CodeLens in .nornapi Files

Swagger lines in .nornapi files expose API-definition actions.

  • Import Endpoints parses the OpenAPI/Swagger spec and generates endpoint definitions.
  • Generate Schemas creates JSON Schema files from response definitions.
  • Show Coverage opens API coverage for that .nornapi file and its folder scope.
.nornapi
swagger "https://petstore.swagger.io/v2/swagger.json"

CodeLens in .nornenv Files

Secret declarations in .nornenv files get secret-management actions.

  • Encrypt Secret appears on plaintext secret values.
  • View Decrypted, Rotate Secret, and Delete Secret appear on encrypted secret lines.
.nornenv
[env:prelive]
secret apiKey = ENC[NORN_AGE_V1:kid=team-main:abc123xyz]

SQL Files (.nornsql)

SQL files get dedicated editor support so database setup and verification behave like first-class Norn assets instead of opaque scripts.

  • .nornsql files have syntax highlighting for declaration lines and SQL bodies.
  • Import completion in .norn files suggests .nornsql files alongside other Norn imports.
  • Diagnostics catch invalid SQL-file structure, bad imports, duplicate SQL operation names, and invalid run sql calls.
  • The sidebar home card includes a .nornsql starter action that can scaffold sample.nornsql and norn.sql.json in the workspace root.
.nornsql
connection appDb

query ListUsersByStatus(status)
select Id, Email, Status
from Users
where Status = :status
end query

command UpdateUserStatus(id, status)
update Users
set Status = :status
where Id = :id
end command

Test Explorer

Norn integrates with VS Code's built-in Testing sidebar.

  • All test sequence blocks are discovered automatically.
  • Plain sequence blocks stay as helpers and do not show up as tests.
  • Tests are grouped by file, and then by their primary tag when tags exist.
  • @data and @theory sequences show one child test per data case.
  • Both run and debug profiles are available.
  • Execution output streams into the test run so you can inspect requests, assertions, waits, scripts, and print statements.
.norn
@smoke
test sequence HealthCheck
    GET {{baseUrl}}/health
    assert $1.status == 200
end sequence

@data(1, 2, 3)
test sequence TodoTest(id)
    GET {{baseUrl}}/todos/{{id}}
    assert $1.status == 200
end sequence

Swagger Coverage

Norn can calculate coverage for Swagger-defined endpoints and response codes.

  • Coverage counts response codes separately, not just endpoints.
  • Show Coverage on a swagger line scopes coverage to that .nornapi file and its folder plus subfolders.
  • When a .nornapi file is active and Swagger data exists, the status bar shows Coverage with a shortcut to the coverage panel.
  • Norn: Refresh API Coverage recalculates the panel.
  • Coverage updates after sequence execution.
.norn
test sequence OrderTests
    var found = GET GetOrderById(1)
    assert found.status == 200

    var missing = GET GetOrderById(999999)
    assert missing.status == 404
end sequence

TLS Verification

HTTPS certificate verification is enabled by default in the extension.

settings.json
{
  "norn.security.verifyTlsCertificates": true
}

Set norn.security.verifyTlsCertificates to false only for trusted local development environments with self-signed certificates. The setting affects both request execution and Swagger/OpenAPI fetches.

If you need the same behavior in the CLI, use --insecure for that run instead of changing editor settings globally.