Skip to content

Commit

Permalink
Improved autocomplete functionality by allowing completion even with …
Browse files Browse the repository at this point in the history
…invalid variable types.

Allow autocomplete to succeed and show the ERROR parameter value. The user will see this error in the editor and manually have to fix it.
  • Loading branch information
goetzrrGit committed Jan 14, 2025
1 parent 997c56d commit e107e24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utilities/codemirror/codemirror-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ export function getDefaultVariableArgs(parameters: VariableDeclaration[]): strin
return parameter.allowable_values && parameter.allowable_values.length > 0
? `"${parameter.allowable_values[0]}"`
: parameter.enum_name
? `${parameter.enum_name}`
? `"${parameter.enum_name}"`
: 'UNKNOWN';
default:
throw Error(`unknown argument type ${parameter.type}`);
console.log(`Unknown argument type ${parameter.type}`);
return `ERROR:"${parameter.name}"`;
}
}) as string[];
}
Expand Down

0 comments on commit e107e24

Please sign in to comment.