* Add Rust side artifacts for startSketchOn face or plane * Add Rust-generated artifacts to ExecOutcome * Add output of artifact commands * Add new output files * Wire the artifact commands to the artifact graph creation * Fix to use real PartialEq implemented in modeling commands * Fix modeling commands with zero fields to work * Fix missing artifactCommands field in errors * Change artifact graph to be built from artifact commands * Wire up ExecState artifacts, but not using them yet Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch> * Remove unneeded local var * Fix test to fail with a helpful error message when command isn't found * Rename and deprecate orderedCommands * Update comment about borrowing * Move ArtifactCommand tracking to the EngineManager trait * Update artifact commands since tracking in the engine * Upgrade kittycad-modeling-cmds from 0.2.85 to 0.2.86 * Remove unneeded JsonSchema derive to speed up build * Fix to not fail on floating point differences in CI * Update artifact commands output since truncating floating point numbers * Fix to ensure artifact commands get cleared after a clear scene * Update artifact commands snapshot after clearing them on clear scene * Remove all remnants of OrderedCommands * Update output for new simulation tests --------- Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
42 lines
924 B
TypeScript
42 lines
924 B
TypeScript
import { kclErrorsToDiagnostics, KCLError } from './errors'
|
|
|
|
describe('test kclErrToDiagnostic', () => {
|
|
it('converts KCL errors to CodeMirror diagnostics', () => {
|
|
const errors: KCLError[] = [
|
|
{
|
|
name: '',
|
|
message: '',
|
|
kind: 'semantic',
|
|
msg: 'Semantic error',
|
|
sourceRange: [0, 1, true],
|
|
operations: [],
|
|
artifactCommands: [],
|
|
},
|
|
{
|
|
name: '',
|
|
message: '',
|
|
kind: 'type',
|
|
msg: 'Type error',
|
|
sourceRange: [4, 5, true],
|
|
operations: [],
|
|
artifactCommands: [],
|
|
},
|
|
]
|
|
const diagnostics = kclErrorsToDiagnostics(errors)
|
|
expect(diagnostics).toEqual([
|
|
{
|
|
from: 0,
|
|
to: 1,
|
|
message: 'Semantic error',
|
|
severity: 'error',
|
|
},
|
|
{
|
|
from: 4,
|
|
to: 5,
|
|
message: 'Type error',
|
|
severity: 'error',
|
|
},
|
|
])
|
|
})
|
|
})
|