Skip to content

Commit

Permalink
Feat/vml grammar (#1472)
Browse files Browse the repository at this point in the history
* wip - parsing simple variables and blocks

* test passes with sequence edits, grammar wip

* grammar highlighting, more tests

* limited folding, more highlighting

* issue and spawn may be lower case, added sequence

* create lint errors for grammar errors

* wip-connect cdl to vml

* wip-basic arg type linting

* vml if block folding

* removed unit test reference to restricted file

* if highlighting with vml

* don't require newline after END MODULE

* simple tooltips on commands

* vml argument tooltips

* string argument support

* fold for and while blocks

* parse mro dictionary, enum value checking

* highlight header

* extracted vml linter and added spell check

* comment out local only test case

* update imports since token moved

* content assist on enum args

* include arguments in stem completion

* more flexible grammar

* fix edge case when block's first child is comment

* vml format option

* readability and type linting

* linting (explicit type assertions), extract grammar rule and token string constants

* move vml format to own file

* corrected alignment of engines in format

* include parameters in indentation logic

* columns with block indentation

* removed conditionalKeywords from adaptation layer

* block highlighting supported in both VML and seqN

* formatting supports simple_call and external_call

* tooltips for sequence engines

* block library parameter parsing

* type linting

* hooked up form editor for enum and number vml args

* replaced more grammar literals with constants

* replaced more literals with constants

* connect format to indent code

* fixed stream view for repeat args

* removed console.log() debug statement

* added more CDL parsing test

* hooked up add missing arguments for vml

* ensure we await transpilation to seq.json

* PR feedback -- add fixed_string type

* PR feedback, blockTheme doesn't change, don't reset it

* improved readability, removed some unused code

* pr feedback -- move highlight code out of language definition

* pr feedback

* pr feedback - use getFromAndTo

* more detailed grammar unit test

* added parse group for Statement subtypes

* pr feedback -- template literal readability

* pr feedback, add type declaration for reactive variable

* pr feedback -- don't recreate debounced instance of same function in reactive block

* pr feedback -- don't recreate debounced instance of same function in reactive block -- use cached debounce function in onMount too

* pr feedback - kebab-case.ts -> camelCase.ts

* update import

* removed unused argument, variable rename

* move theme to dedicated directory

* update another import, typescript plugin doesn't detect import path changes in svelte files

* unit tests for vml tree navigation

* code readability and minor improvement on sequence spacing

* split up unit tests for vml, extract some reused non-test specific code to tree-utils

* hide output buttons and editor for languages that aren't converted

* fix import for vml files

* Include context for parse errors

* group adjacent token errors

* check vml mode in single place

* pr feedback - simplify height logic, make undefined check explicit

* cleaned up grammar warning, only allow sequence import for new sequences

* always show import button
  • Loading branch information
joswig authored Oct 30, 2024
1 parent 6a4afaa commit 1747bb9
Show file tree
Hide file tree
Showing 36 changed files with 4,449 additions and 321 deletions.
13 changes: 10 additions & 3 deletions src/components/sequencing/ArgumentTooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
import { getAllEnumSymbols } from '../../utilities/sequence-editor/sequence-linter';
export let arg: FswCommandArgument;
export let commandDictionary: CommandDictionary;
export let commandDictionary: CommandDictionary | null;
let enumSymbolsDisplayStr: string;
const MAX_ENUMS_TO_DISPLAY = 20;
let enumSymbolsDisplayStr: string = '';
$: if (commandDictionary && arg?.arg_type === 'enum') {
const enumValues = getAllEnumSymbols(commandDictionary.enumMap, arg.enum_name);
enumSymbolsDisplayStr = enumValues?.join(' | ') ?? '';
const values = enumValues ?? [];
enumSymbolsDisplayStr = values.slice(0, MAX_ENUMS_TO_DISPLAY).join(' | ');
const numHiddenValues = values.length - MAX_ENUMS_TO_DISPLAY;
if (numHiddenValues > 0) {
enumSymbolsDisplayStr += ` ... ${numHiddenValues} more`;
}
}
</script>

Expand Down
Loading

0 comments on commit 1747bb9

Please sign in to comment.