If it turns out people use this, we can support a custom schema request
service implementation instead.
Also error responses for schema requests are now handled.
This is set to the raw value for primitives by the YAML language service.
The demo now uses this value as the title attribute on the breadcrumbs.
Closes#137
For better ESM compatibility, this adds a file extension for nested
package files.
This also removes the nested special handling of
`vscode-languageserver-types` and `vscode-languageserver-document`
imports. This is unnecessary, because they use the `"module"` field in
`package.json`.
- Both `js-yaml` and `yaml-languageserver-parser` have been replaced with
`yaml`.
- `jsonc-parser` has been externalized.
- All defaults are now specified explicitly.
- The new property `yamlVersion` has been added to match
`yaml-language-server`. The default is `1.2`.
- `DiagnosticsOptions` properties are now sorted alphabetically and
documentation has been enhanced.
Closes#117
It was defined once, but it was passed into various functions. This
added unnecessary complexity.
It is now defined in a constants file, which is imported where
necessary.
- ESLint config `remcohaszing/typechecking` is extended.
- Various previously disabled ESLint rules have now been enabled.
- Various `any` types have been fixed.
- Removed useless type check of diagnostic code.
- The diagnostics adapter listener has been turned into an actual map.
TypeScript is better at inferring types when using simple functions and
objects instead of classes. As a result many type annotations have now
been removed without impacting type safety.
Some other benefits are this can be minified better and private fields
are now truly private variables.
The YAML language service doesn’t support formatting ranges.
In practice this means the “Format Selection” option which does the same
as “Format Document” is no longer available in the menu that’s opened
when pressing F1.
This is much more flexible than `monaco-plugin-helpers`. Because of
this, it’s possible to use Prettier as an external dependency, so users
can ignore it in their own build process of they choose not to support
formatting.
Instead of rewriting YAML language service imports in the build tool, I
decided to just import them from where they need to be imported in the
source code.
Closes#63
This removes the need to explain certain statements and imports need to
happen in a specific order. Users can now just use:
```ts
import { setDiagnosticsOptions } from 'monaco-yaml';
setDiagnosticsOptions({});
```
This is a preparation for `monaco-editor@^0.22.0`. In this version the global
`monaco` object was removed for ESM users.
A choice was made to use `monaco-editor` imports, because this probably has
best compatibility for most users. If users want to use `monaco-editor-core`,
they will have to create an alias in their own build process.