Commit graph

102 commits

Author SHA1 Message Date
Remco Haszing
45d8d1ae57
Update dependencies
This adds support for marker tags. This is used for unused anchors.
2022-02-15 11:24:56 +01:00
Remco Haszing
5efe47e449
Fix type issue 2022-01-18 10:19:41 +01:00
Remco Haszing
e28f7fec9f
Update dependencies
Most notably this updates yaml-language-server to 1.3.0.
2022-01-17 17:01:12 +01:00
Remco Haszing
ef35d1be2b
Merge branch 'main' into flatten-output-paths 2021-11-23 15:10:34 +01:00
Remco Haszing
a959e028ce
Merge pull request #140 from remcohaszing/esm-import-extensions
Use extensions for directly importing files
2021-11-23 15:07:08 +01:00
Remco Haszing
f42c5e97e0
Merge pull request #139 from remcohaszing/fix-type-issue
Fix a small type issue
2021-11-23 14:51:45 +01:00
Remco Haszing
af88581fbb
Merge pull request #141 from remcohaszing/support-document-symbol-detail
Add support for document symbol details
2021-11-23 14:51:32 +01:00
Remco Haszing
bd0ae90018
Remove support for the prefix option
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.
2021-11-20 12:39:43 +01:00
Remco Haszing
3a873e083c
Add support for document symbol details
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
2021-11-20 12:21:51 +01:00
Remco Haszing
ccfbbbe9d8
Use extensions for directly importing files
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`.
2021-11-20 12:05:44 +01:00
Remco Haszing
5bb55b6e96
Fix a small type issue
The language server completion kind and monaco completion kind are
compatible by coincidence, not by definition.
2021-11-19 16:21:07 +01:00
Remco Haszing
90d895a214
Flatten output paths
`lib/esm/monaco.contribution.js` → `index.js`
`lib/esm/yaml.worker.js` → `yaml.worker.js`

Closes #132
2021-11-15 18:33:26 +01:00
Remco Haszing
786cdb5dbb
Implement definition provider 2021-11-10 22:28:06 +01:00
Remco Haszing
5507d53dee
Merge branch 'main' into update-dependencies 2021-11-10 21:40:56 +01:00
Melvin Laplanche
f3decc20dd
Update monaco to 0.30 2021-11-09 10:43:15 -08:00
Remco Haszing
554699887d
Update dependencies
- 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
2021-10-17 12:32:19 +02:00
Remco Haszing
0f2e5536bf
Merge pull request #114 from remcohaszing/remove-hover-content-checks
Remove checks for hover content
2021-10-02 16:16:00 +02:00
Remco Haszing
da51564fbb
Remove checks for hover content
The hover implementation of the YAML language service always returns
`MarkupContent`.
2021-09-17 16:33:13 +02:00
Remco Haszing
7313780510
Extract languageId into constants
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.
2021-09-17 16:21:27 +02:00
Remco Haszing
65e91a1d43
Merge pull request #109 from patrickshipe/restore-options-updates
Restore ability to change options after loading
2021-09-15 21:52:57 +02:00
Patrick Shipe
2bece31f56 Fix crashes from null model 2021-09-15 08:59:40 -06:00
Patrick Shipe
7a96d822b1 Restore ability to change options after loading 2021-09-14 13:37:14 -06:00
Remco Haszing
8d278d3d19
Merge pull request #101 from remcohaszing/stylistic-fixes
Apply various stylistic fixes
2021-09-06 12:11:42 +02:00
Kai Schlamp
9506aef618 Add custom tags option 2021-09-04 13:50:57 +00:00
Remco Haszing
9739d143d3
Apply various stylistic fixes
- 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.
2021-09-02 22:11:00 +02:00
Remco Haszing
99dcdff6fe
Update dependencies
All caret ranges are now defined as `^x.0.0`.

A small ESLint issue was fixed, which was reported by the updates ESLint
configuration.
2021-09-02 15:39:23 +02:00
Remco Haszing
26173cdbad
Remove logic for unloading the language
It’s not supported in `monaco-editor` nor is it planned.

See https://github.com/microsoft/monaco-editor/issues/2642
2021-09-01 21:23:26 +02:00
Remco Haszing
cf4b843ce5
Merge branch 'main' into support-json-links 2021-08-25 19:23:42 +02:00
Remco Haszing
0da9f2cdfd
Resolve JSON pointers as links 2021-08-25 17:39:53 +02:00
Remco Haszing
a95fdc4463
Use type-fest Promisable for worker return types
Monaco turns the synchronous return values into promises anyway.
2021-08-23 17:19:36 +02:00
Remco Haszing
2228054e58
Update yaml-language-server to 0.22.0 2021-08-21 23:19:37 +02:00
Remco Haszing
6860281373
Merge pull request #84 from remcohaszing/async-await
Convert promise chains to async/await
2021-08-21 21:33:56 +02:00
Remco Haszing
8f6cb81147
Remove doResolve from yaml worker
It’s unused. It’s also not available in the latest version of
yaml-language-server.
2021-08-21 13:20:57 +02:00
Remco Haszing
ba395c9d23
Convert promise chains to async/await 2021-08-19 17:55:46 +02:00
Remco Haszing
57e820ed0c
Merge pull request #82 from remcohaszing/classes-to-factories
Convert classes to factory functions
2021-08-19 17:46:47 +02:00
Remco Haszing
40243d4e83
Remove os filler
It’s unused
2021-08-19 17:21:38 +02:00
Remco Haszing
8fa3ca4252
Convert classes to factory functions
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.
2021-08-19 17:06:42 +02:00
Remco Haszing
df88461b0c
Merge pull request #78 from remcohaszing/remove-commented-code
Remove commented code
2021-08-19 08:50:21 +02:00
Remco Haszing
d7e5aa7744
Merge pull request #77 from remcohaszing/remove-document-range-formatting-edit-provider
Remove DocumentRangeFormattingEditProvider
2021-08-19 08:50:02 +02:00
Remco Haszing
dd64c96d59
Fix mismatched enum types
These enums were annotated as numbers, but they could be more specific.
2021-08-18 21:46:06 +02:00
Remco Haszing
3dc04e2150
Remove commented code 2021-08-18 16:04:56 +02:00
Remco Haszing
cdef13351a
Remove unused format option 2021-08-18 15:56:45 +02:00
Remco Haszing
288c34cd37
Remove DocumentRangeFormattingEditProvider
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.
2021-08-18 15:47:50 +02:00
Remco Haszing
95fd123191
Build project using esbuild
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
2021-08-15 12:37:13 +02:00
Remco Haszing
7174aff026
Expose setDiagnosticsOptions in monaco-yaml
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({});
```
2021-07-18 14:58:42 +02:00
Remco Haszing
7a6fcf0c64
Add missing diagnostics options in types
Also JSON schemas have been typed to be more specific using
`@types/json-schema`.
2021-07-18 14:20:41 +02:00
Remco Haszing
ac7b6fe307
Introduce ESLint
The ESLint preset `eslint-config-remcohaszing` is used.
2021-07-17 17:12:17 +02:00
Remco Haszing
f327e73f66
Bump dependencies 2021-07-17 14:20:08 +02:00
Remco Haszing
52c457a196
Use monaco-editor/esm/vs/editor/editor.api
This doesn’t enforce users to pull in all of monaco-editor.
2021-04-22 20:00:34 +02:00
Remco Haszing
c4a95e2dd5
Replace monaco namespace with monaco-editor imports
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.
2021-04-13 21:18:18 +02:00