Add ability to create named constant without code (#5840)

* Add support for forcing kcl input create variable

* Command palette padding tweak

* Make traverse function work for ExpressionStatements

* Add utilities for getting earliest safe index in AST

* Fix the insertIndex logic to not be based on the selection anymore

* Add workflow to create a named constant

* Fix bug with nameEndInDigits matcher

* Tweak command config

* Add a three-dot menu to feature tree pane to create parameters

* Add E2E test for create parameter flow

* Remove edit flow oops

* Fix tsc error

* Fix E2E test

* Update named constant position in edit flow test

* Add tags into consideration for safe insert index

Per @Irev-dev's helpful feedback, with unit tests!
This commit is contained in:
Frank Noirot
2025-03-19 11:58:53 -04:00
committed by GitHub
parent af492d2cb6
commit 533fa749b2
21 changed files with 477 additions and 26 deletions

View File

@ -19,6 +19,7 @@ import { ContextFrom } from 'xstate'
import { settingsMachine } from 'machines/settingsMachine'
import { FeatureTreePane } from './FeatureTreePane'
import { kclErrorsByFilename } from 'lang/errors'
import { FeatureTreeMenu } from './FeatureTreeMenu'
export type SidebarType =
| 'code'
@ -85,6 +86,7 @@ export const sidebarPanes: SidebarPane[] = [
id={props.id}
icon="model"
title="Feature Tree"
Menu={FeatureTreeMenu}
onClose={props.onClose}
/>
<FeatureTreePane />