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

@ -186,7 +186,7 @@ export type CommandArgumentConfig<
}
| {
inputType: 'kcl'
createVariableByDefault?: boolean
createVariable?: 'byDefault' | 'force' | 'disallow'
variableName?:
| string
| ((
@ -306,7 +306,7 @@ export type CommandArgument<
}
| {
inputType: 'kcl'
createVariableByDefault?: boolean
createVariable?: 'byDefault' | 'force' | 'disallow'
variableName?:
| string
| ((