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`.
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.
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 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.