Skip to content

Commit

Permalink
feat: monaco fine tuned
Browse files Browse the repository at this point in the history
  • Loading branch information
raxhvl authored and gnidan committed Mar 29, 2024
1 parent 37d9121 commit c36dbaa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/web/src/components/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,8 @@ export default function Playground(props: PlaygroundProps): JSX.Element {
// Compile all schemas to Ajv instance
const ajv = new Ajv({
schemas: Object.values(schemas),
strict: false,
allErrors: true,
verbose: true,
messages: true,
code: {
source: true,
},
strict: false,
});

// State to hold editor input
Expand All @@ -84,7 +79,7 @@ export default function Playground(props: PlaygroundProps): JSX.Element {
const validate = ajv.getSchema(props.schema.id);
if (!validate) return showError("Unable to validate schema");
const sourceMap = getParsedEditorInput();
const isValid = validate(sourceMap.data);
validate(sourceMap.data);

showValidationErrors(validate.errors, sourceMap);
}
Expand Down Expand Up @@ -172,6 +167,11 @@ export default function Playground(props: PlaygroundProps): JSX.Element {
defaultValue={JSON.stringify(exampleSchema, undefined, TAB_WIDTH)}
onChange={handleEditorChange}
onMount={handleEditorDidMount}
options={{
contextmenu: false,
autoIndent: "advanced",
tabSize: TAB_WIDTH,
}}
/>
</section>
);
Expand Down

0 comments on commit c36dbaa

Please sign in to comment.