modern-monaco 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -6
- package/dist/core.mjs +3 -2
- package/dist/editor-core.mjs +9638 -4388
- package/dist/editor-worker.mjs +77 -77
- package/dist/index.mjs +8 -8
- package/dist/lsp/client.mjs +1 -1
- package/dist/lsp/css/setup.mjs +2 -2
- package/dist/lsp/css/worker.mjs +43 -43
- package/dist/lsp/html/setup.mjs +2 -1
- package/dist/lsp/html/worker.mjs +31 -31
- package/dist/lsp/json/setup.mjs +5 -3
- package/dist/lsp/json/worker.mjs +31 -31
- package/dist/lsp/typescript/libs.mjs +0 -1
- package/dist/lsp/typescript/setup.mjs +1 -1
- package/dist/lsp/typescript/worker.mjs +3 -3
- package/dist/shiki-wasm.mjs +1 -1
- package/dist/shiki.mjs +58 -56
- package/package.json +7 -5
- package/types/lsp.d.ts +33 -2
package/README.md
CHANGED
|
@@ -309,29 +309,69 @@ You can configure built-in LSPs in the `lazy`, `init`, or `hydrate` functions.
|
|
|
309
309
|
|
|
310
310
|
```js
|
|
311
311
|
lazy({
|
|
312
|
-
// configure LSP for each language
|
|
313
312
|
lsp: {
|
|
313
|
+
// formatting options for all languages
|
|
314
|
+
formatting: {/* ... */},
|
|
315
|
+
// configure LSP for languages
|
|
314
316
|
html: {/* ... */},
|
|
317
|
+
css: {/* ... */},
|
|
315
318
|
json: {/* ... */},
|
|
316
319
|
typescript: {/* ... */},
|
|
317
320
|
},
|
|
318
321
|
});
|
|
319
322
|
```
|
|
320
323
|
|
|
321
|
-
The `
|
|
324
|
+
The `LSPConfig` interface is defined as:
|
|
322
325
|
|
|
323
326
|
```ts
|
|
324
|
-
export interface
|
|
327
|
+
export interface LSPConfig {
|
|
328
|
+
/** Formatting options. */
|
|
329
|
+
formatting?: {
|
|
330
|
+
/** Size of a tab in spaces. Default: 4. */
|
|
331
|
+
tabSize?: number;
|
|
332
|
+
/** Prefer spaces over tabs. Default: true.*/
|
|
333
|
+
insertSpaces?: boolean;
|
|
334
|
+
/** Trim trailing whitespace on a line. Default: true. */
|
|
335
|
+
trimTrailingWhitespace?: boolean;
|
|
336
|
+
/** Insert a newline character at the end of the file if one does not exist. Default: false. */
|
|
337
|
+
insertFinalNewline?: boolean;
|
|
338
|
+
/** Trim all newlines after the final newline at the end of the file. Default: false. */
|
|
339
|
+
trimFinalNewlines?: boolean;
|
|
340
|
+
/** Semicolon preference for JavaScript and TypeScript. Default: "insert". */
|
|
341
|
+
semicolon?: "ignore" | "insert" | "remove";
|
|
342
|
+
}
|
|
343
|
+
/** HTML language configuration. */
|
|
325
344
|
html?: {
|
|
326
345
|
attributeDefaultValue?: "empty" | "singlequotes" | "doublequotes";
|
|
327
346
|
customTags?: ITagData[];
|
|
328
347
|
hideAutoCompleteProposals?: boolean;
|
|
348
|
+
hideEndTagSuggestions?: boolean;
|
|
329
349
|
};
|
|
330
|
-
|
|
350
|
+
/** CSS language configuration. */
|
|
351
|
+
css?: {
|
|
352
|
+
/** Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown. */
|
|
353
|
+
useDefaultDataProvider?: boolean;
|
|
354
|
+
/** Provides a set of custom data providers. */
|
|
355
|
+
dataProviders?: { [providerId: string]: CSSDataV1 };
|
|
356
|
+
};
|
|
357
|
+
/** JSON language configuration. */
|
|
331
358
|
json?: {
|
|
332
|
-
|
|
333
|
-
|
|
359
|
+
/** By default, the validator will return syntax and semantic errors. Set to false to disable the validator. */
|
|
360
|
+
validate?: boolean;
|
|
361
|
+
/** Defines whether comments are allowed or not. Default is disallowed. */
|
|
362
|
+
allowComments?: boolean;
|
|
363
|
+
/** A list of known schemas and/or associations of schemas to file names. */
|
|
364
|
+
schemas?: JSONSchemaSource[];
|
|
365
|
+
/** The severity of reported comments. Default is "error". */
|
|
366
|
+
comments?: SeverityLevel;
|
|
367
|
+
/** The severity of reported trailing commas. Default is "error". */
|
|
368
|
+
trailingCommas?: SeverityLevel;
|
|
369
|
+
/** The severity of problems from schema validation. Default is "warning". */
|
|
370
|
+
schemaValidation?: SeverityLevel;
|
|
371
|
+
/** The severity of problems that occurred when resolving and loading schemas. Default is "warning". */
|
|
372
|
+
schemaRequest?: SeverityLevel;
|
|
334
373
|
};
|
|
374
|
+
/** TypeScript language configuration. */
|
|
335
375
|
typescript?: {
|
|
336
376
|
/** The compiler options. */
|
|
337
377
|
compilerOptions?: ts.CompilerOptions;
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules
|
|
1
|
+
// node_modules/@esm.sh/import-map/dist/import-map.mjs
|
|
2
2
|
function parseImportMapFromJson(json, baseURL) {
|
|
3
3
|
const importMap = {
|
|
4
4
|
$baseURL: new URL(baseURL ?? ".", "file:///").href,
|
|
@@ -40,7 +40,7 @@ function isObject(v) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
|
-
var version = "0.3.
|
|
43
|
+
var version = "0.3.5";
|
|
44
44
|
|
|
45
45
|
// src/core.ts
|
|
46
46
|
import { getExtnameFromLanguageId, getLanguageIdFromPath, grammars, initShiki, setDefaultWasmLoader, themes } from "./shiki.mjs";
|
|
@@ -216,6 +216,7 @@ function lazy(options) {
|
|
|
216
216
|
theme = theme.toLowerCase().replace(/ +/g, "-");
|
|
217
217
|
}
|
|
218
218
|
const highlighter = await initShiki({ ...options, theme, langs });
|
|
219
|
+
renderOptions.theme = highlighter.getLoadedThemes()[0];
|
|
219
220
|
let prerenderEl;
|
|
220
221
|
for (const el of this.children) {
|
|
221
222
|
if (el.className === "monaco-editor-prerender") {
|