Fix SourceRange values in OrderedCommands to match the TS type (#4785)

* Fix SourceRange type to match WASM commands

* Update artifact graph test snap

* Update artifact graph test
This commit is contained in:
Jonathan Tran
2024-12-13 14:03:24 -05:00
committed by GitHub
parent a32f150fc1
commit 10cc5bce59
4 changed files with 59 additions and 40 deletions

View File

@ -65,6 +65,7 @@ export type { BinaryPart } from '../wasm-lib/kcl/bindings/BinaryPart'
export type { Literal } from '../wasm-lib/kcl/bindings/Literal'
export type { LiteralValue } from '../wasm-lib/kcl/bindings/LiteralValue'
export type { ArrayExpression } from '../wasm-lib/kcl/bindings/ArrayExpression'
export type { SourceRange as RustSourceRange } from 'wasm-lib/kcl/bindings/SourceRange'
export type SyntaxType =
| 'Program'
@ -117,6 +118,13 @@ export function defaultSourceRange(): SourceRange {
return [0, 0, true]
}
/**
* Create a default RustSourceRange for testing or as a placeholder.
*/
export function defaultRustSourceRange(): RustSourceRange {
return [0, 0, 0]
}
export const wasmUrl = () => {
// For when we're in electron (file based) or web server (network based)
// For some reason relative paths don't work as expected. Otherwise we would