Crate kcl_lib

Source
Expand description

Rust support for KCL (aka the KittyCAD Language).

KCL is written in Rust. This crate contains the compiler tooling (e.g. parser, lexer, code generation), the standard library implementation, a LSP implementation, generator for the docs, and more.

Modules§

exec
lint
native_engine
pretty
std
Functions implemented for language execution.
std_utils
test_server
Types used to send data to the test server.
walk

Structs§

CacheInformation
Information for the caching an AST and smartly re-executing it if we can.
CompilationError
An error which occurred during parsing, etc.
Configuration
High level configuration.
CopilotLspBackend
ExecState
State for executing a program.
ExecutorContext
The executor context. Cloning will return another handle to the same engine connection/session, as this uses Arc under the hood.
ExecutorSettings
The executor settings.
FormatOptions
Format options.
KclErrorWithOutputs
KclLspBackend
The lsp server backend.
KclLspServerSubCommand
A subcommand for running the server.
MetaSettings
ModuleId
Identifier of a source file. Uses a u32 to keep the size small.
OldAstState
The old ast and program memory.
Point2d
Program
ProjectConfiguration
High level project configuration.
SourceRange
The first two items are the start and end points (byte offsets from the start of the file). The third item is whether the source range belongs to the ‘main’ file, i.e., the file currently being rendered/displayed in the editor.

Enums§

ConnectionError
How did KCL client fail to connect to the engine
ExecError
How did the KCL execution fail
ExecutionKind
The mode of execution. When isolated, like during an import, attempting to send a command results in an error.
KclError
UnitLength
The valid types of length units.

Traits§

CoreDump
EngineManager

Functions§

modify_ast_for_sketch
Update the AST to reflect the new state of the program after something like a move or a new line.