Skip to content

Replace ace editor to Monaco with config hints#1980

Merged
AlexxIT merged 16 commits intoAlexxIT:masterfrom
skrashevich:monaco-editor-141225
Dec 27, 2025
Merged

Replace ace editor to Monaco with config hints#1980
AlexxIT merged 16 commits intoAlexxIT:masterfrom
skrashevich:monaco-editor-141225

Conversation

@skrashevich
Copy link
Collaborator

@skrashevich skrashevich commented Dec 14, 2025

obsolete #1121

Requires testing in different browsers. tested in Safari

image

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 14, 2025

  • No second level key hints
  • No validation for duplicate keys (at the same level)
  • No validation for key type (number instead of string)
  • Autocompletion at the second level sometimes works correctly, sometimes completely incorrectly
  • It's better to download schema.json from the internet (will be posted on go2rtc.org in the future)

@AlexxIT AlexxIT added the doubt label Dec 14, 2025
Integrates js-yaml for parsing and adds comprehensive YAML linting with schema-based type checking, duplicate key detection, and improved error reporting. Refactors and extends parsing utilities, enhances completion logic, and introduces a schema tools abstraction for type and property resolution.
@skrashevich
Copy link
Collaborator Author

  • It's better to download schema.json from the internet (will be posted on go2rtc.org in the future)

Why better?

@felipecrs
Copy link
Contributor

Maybe to decrease the binary size, but the schema is probably very small, specially if compressed.

@skrashevich
Copy link
Collaborator Author

Maybe to decrease the binary size, but the schema is probably very small, specially if compressed.

~20 Kb uncompressed. Dismissively small

Adds detection for inconsistent indentation and unexpected indentation at the document root. Enhances block scalar handling by tracking parent indentation and skipping content lines accordingly. Also improves error reporting for missing map keys or list items.
Introduces a hover provider to the YAML editor using Monaco, displaying property descriptions from the schema when hovering over keys. This enhances the editor's usability by providing inline documentation for YAML properties.
Refactored the logic for detecting the YAML language in Monaco editor to handle cases where getLanguages may not be available or Monaco is not loaded. This increases robustness and prevents potential runtime errors.
Updated the editor configuration in config.html to set wordBasedSuggestions to false and disable word suggestions in the suggestion widget. This change aims to refine the suggestion behavior for a more focused coding experience.
Deleted an unnecessary 'min-height: 0;' CSS rule from the #config selector, as a fixed min-height is already set.
Replaces optional chaining with explicit null checks and more robust object property access throughout the file. Refactors destructuring and object spreading to use Object.assign for better compatibility. These changes improve code reliability and compatibility with older browsers or environments lacking support for newer JavaScript features.
Simplifies the logic for handling block scalar content by restructuring the conditional checks for blockScalarParentIndent. This improves readability and ensures correct processing of indented lines.
Adds logic to trigger the suggestion widget when completing a property if it expects a block or has value suggestions, improving the user experience in the config editor.
Enhances the YAML linter to validate scalar values against enum and pattern constraints defined in the schema. Adds utility functions for value comparison, schema constraint collection, and applies these checks during linting to provide more precise error messages for invalid values.
@AlexxIT AlexxIT removed the doubt label Dec 27, 2025
@AlexxIT AlexxIT merged commit 07fb78d into AlexxIT:master Dec 27, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Dec 27, 2025

Thanks! Awesome changes.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 20, 2026

57Darling02 pushed a commit to 57Darling02/go2nvr that referenced this pull request Feb 17, 2026
57Darling02 pushed a commit to 57Darling02/go2nvr that referenced this pull request Feb 17, 2026
Replace ace editor to Monaco with config hints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants