Skip to content

feat: add missing builtins — fields(), system(), raw() — and embed hover docs #3

Description

@SchoolyB

Summary

The following builtins exist in the language spec (STANDARD.md §9.1, §3.1.11) but are missing from the LSP's BUILTINS array and/or DOCS object:

Builtin Needs Completion Needs Hover Docs
fields(instance) -> [string] Yes Yes
system(command string) -> int Yes Yes
raw(variable) -> ^T Yes Yes
embed(path string) -> string No (already in BUILTINS) Yes (missing from DOCS)

Details

  • fields() — Returns field names of a struct as [string] in declaration order. Accepts struct instances and pointers to structs.
  • system() — Runs a shell command and returns exit code. Returns -1 if killed by signal.
  • raw() — Like addr(), but returns an unsafe raw pointer with no nil-check or const-source write protection.
  • embed() — Already in the BUILTINS array for completion, but has no hover docs entry in the DOCS object.

Scope

  • Add fields, system, raw to the BUILTINS array in completion.ts
  • Add hover doc entries for all four in the DOCS object in hover.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions