Robot Companion.
Sections

    Reference.

    Everything it does, and what each part needs from your project.

    The overview makes the argument. This page is the inventory: every capability, stated with its real limits, plus the prerequisites that decide whether half of this extension does anything at all in your workspace. Where the behaviour is narrower than the name suggests, it says so here rather than letting you find out.

    01Writing documentation

    Prose that lives next to the step it describes

    A [Documentation] block puts all the explanation at the top of a test, while the steps it describes are fifty lines below. The two drift apart, and the block becomes the thing nobody updates. The alternative here is a comment marker: #> at the start of a comment makes it documentation, and it can sit directly above the step it is about.

    checkout.robotmarkers in place
    Guest Checkout Completes
        #> ## Guest checkout
        #> A shopper without an account completes an order.
        #>> The basket is prepared first, so the totals are known
        #>> before payment is attempted.
        ${basket}=    Add Item To Basket    SKU-4417
        #> -> the shop must accept the card and return a confirmation
        ${order}=     Place Order    ${basket}    shipping=EXPRESS
    02The panel

    A rendered document that is also a table of contents

    The sidebar renders the block your cursor is in as Markdown. The part that makes it a tool rather than a viewer is that the rendered text is the navigation: every line clicks back to the exact source line it came from, so you read the test as prose and jump into it at the point you care about.

    That binding is not positional. Earlier versions matched rendered lines to source lines by order, which broke whenever the Markdown renderer regrouped the output and later links drifted onto the wrong lines. Each item now carries an explicit marker embedded in the rendered Markdown, so the binding survives whatever the renderer does with the shape.

    03Colour

    Marking a line as a warning, not just writing "warning"

    Documentation supports a small set of tags, in the live preview and in both export formats. They are semantic first, with plain colours available when you just want a colour.

    Eight colour shortcuts — <red>, <orange>, <yellow>, <green>, <blue>, <pink>, <purple>, <gray> — sit alongside them, and <color value="#0f766e"> takes an arbitrary value.

    Anything else is text. An unsupported colour, an unexpected attribute, or arbitrary HTML is escaped and rendered as plain characters rather than interpreted. That is a deliberate guarantee and it is pinned by a test that feeds the renderer markup designed to execute and asserts it comes out as visible text.

    04Handing it over

    The documentation was always shareable

    A rendered test description is useful to people who will never open your editor — someone approving a release, someone asking what a suite actually covers. Four commands export the current block, or a multi-selection of blocks, with variables substituted and page breaks between test cases.

    05What it returns

    The question that costs you three open files

    A keyword returns an object. Its fields are declared in a Python class, which inherits most of them from a base class in another module, which is imported under an alias. Answering "what can I read off this" by hand means opening all of them. The Return Explorer answers it beside the cursor, in the only form that is actually useful — a string you can paste.

    Robot Return Explorerwhat you can access
    ${order.confirmation_number}
    ${order.status}
    ${order.shipping.method}
    ${order.items[0].name}
    ${order.items[0].line_total}

    The first version of this panel showed a type tree. Within two days it was rewritten to show access paths instead, because a test author does not want to browse a type — they want the expression. The tree survives underneath as Technical Details, for when you do want it.

    Two spellings of the same field. Some projects give their model classes a base that makes every snake_case attribute readable in camelCase as well. Where that is true, returnFieldNameStyle chooses which spelling the access paths use — camelCase, raw, or both. It cannot be inferred, so it is declared: camelCaseAliasBaseNames lists the base class names that mark a type as converting, matched as a substring against the whole inheritance chain, ignoring case, underscores and hyphens. It defaults to ["camelcase"], so a base called CamelCaseBase works untouched; add your own marker class to the list, or empty it to switch aliasing off. Types with no such base always render exactly the attribute names written in Python.

    06Arguments

    What this argument accepts, and which value is flowing in

    Hovering a named argument shows the members of the enum it accepts, with the value currently being passed marked and linked to the line that assigned it. That second half is the useful half: the question you have when a test fails is rarely "what is allowed" and usually "what did it actually get, and where did that come from".

    07Variables

    The one part that needs no Python at all

    Hovering a variable shows its value, resolved from Set Variable or a Robot Framework 7 VAR, including typed names like ${name: date}. Alias chains are followed. A variable embedded in a longer string resolves to whichever token your cursor is actually inside.

    The interesting case is a variable assigned in more than one branch:

    a variable with two futuresIF / ELSE
    IF    ${express}
        VAR    ${carrier}    OVERNIGHT
    ELSE
        VAR    ${carrier}    STANDARD
    END

    Hovering ${carrier} shows both candidates, because the branches are mutually exclusive and collapsing them to one would be a confident lie. Each candidate is individually clickable back to its assignment.

    Limit worth knowing. Only IF / ELSE IF / ELSE create branches. Assignments inside FOR, WHILE or TRY bodies are not branch-disambiguated — those blocks are tracked only so a stray END does not confuse the parser.

    08Completions

    Three kinds, on eight trigger characters

    09Folding

    Fold to the shape of the documentation

    Documentation markers act as section boundaries, so a long test collapses to its own outline. A heading owns everything until the next heading of equal or higher level; a #> peer closes at the next peer of the same depth; nested markers fold independently. Two commands — Fold to Headlines and Fold to Steps — plus Unfold, available from the palette and from the preview.

    One command changes your settings. Use Robot Companion as Default Folding Provider writes editor.foldingStrategy and editor.defaultFoldingRangeProvider into your [robotframework] language override — workspace scope when a workspace is open, otherwise global. It exists because competing folding providers otherwise merge into something neither of them intended.

    10Prerequisites

    What it needs from your project

    Sections 05, 06 and 08 all read the same Python index. If your project does not match these assumptions, those features do not fail loudly — they quietly find nothing. This is the part most worth reading before deciding the extension does not work.

    It needsOr else
    Python keywords decorated with @keyword(...), with parentheses A plain method that Robot Framework happily exposes as a keyword is invisible here. Every Python-derived feature — argument hints, annotations, return types, docstrings, Insert — is built from the decorated list only.
    Keyword .robot files under a path matching *keywords* They are skipped. .resource files are indexed from anywhere, so this only bites projects that define keywords in .robot files outside such a folder.
    indexExcludeFolderPatterns reviewed It excludes tests by default — a very common home for Robot suites and their resources.
    Return types that are structured classes A keyword returning a dict or an untyped object has nothing to resolve.

    Narrowing indexImportFolderPatterns to the folders that actually hold your keyword libraries — ["libs/**"] rather than ["**"] — is the single biggest lever if indexing feels slow in a large repository.

    11Speed

    Staying out of the way while you type

    Return resolution is real work — walking types through imports and inheritance — and doing it on the editor's main thread makes typing feel bad. It runs in a worker thread that has no filesystem access at all; it receives a snapshot and computes. Results are cached in memory and persisted per workspace on disk.

    If return resolution stops answering, the worker has exited: it does not restart, and it stays quiet for the rest of the session. Invalidate All Caches and a window reload bring it back, and the Robot Companion output channel will say what happened.

    12Commands

    Twelve, all under one category

    CommandDoes
    Focus Return ExplorerReveals the return panel.
    Open Current Documentation BlockOpens the preview at the block under the cursor.
    Export Current Documentation as MarkdownSave dialog, one block.
    Export Selected Documentation as MarkdownSave dialog, a chosen set of blocks.
    Export Current Documentation as PDFPrint-ready page, opened in your browser.
    Export Selected Documentation as PDFThe same, for several blocks, page-broken.
    Fold Documentation To HeadlinesCollapse to the outline.
    Fold Documentation To StepsCollapse to the documented steps.
    Unfold DocumentationExpand again.
    Use Robot Companion as Default Folding ProviderWrites two editor settings. See 09.
    Invalidate All CachesParser, index, worker memory, and the persisted disk cache.
    Show OutputOpens the diagnostic channel.
    13Settings

    Thirty-nine, and the ten that matter

    All under the robotCompanion. prefix, with full descriptions in the Settings UI. These are the ones that change what you see rather than how fast you see it.

    SettingDefaultWhy touch it
    indexImportFolderPatterns["**"]Narrow it to your library folders if indexing is slow.
    indexExcludeFolderPatternsincludes testsRemove tests if your suites live there.
    returnFieldNameStylecamelcaseAlias, raw, or both spellings of return members. See 05.
    umlautDecoratorNames["convert_umlaut_kwargs"]Name of the decorator mapping ASCII argument spellings onto diacritic ones. See 06.
    camelCaseAliasBaseNames["camelcase"]Which base classes mark a type as offering camelCase aliases. See 05.
    enumCompletionDisplayModenameInsert the member name, its value, or both.
    enableEnumArgumentFallbackfalseLooser enum matching. Off because it can be confidently wrong.
    enableDocumentationHoverPreviewfalseThe whole block on hover, if you want it.
    enableCodeLenstrueTurn off if the lens above every block is noise.
    logLevelwarntrace exists mainly for folding diagnostics.
    14Limits

    Where it stops

    How much of this is tested. npm run test:all runs twenty-three Node test groups plus three suites that drive a real VS Code Extension Development Host — clicking every rendered preview target through the actual webview bridge and asserting where the cursor lands, and asserting the exact resulting line text and caret position after an argument insertion. The folding work earned that: parser-level tests kept passing while the feature was visibly broken in a real window.