modern-monaco 0.0.0-beta.0 → 0.0.0-beta.2
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/LICENSE +1 -1
- package/README.md +129 -87
- package/dist/cache.js +1 -1
- package/dist/core.js +479 -0
- package/dist/editor-core.js +128 -21
- package/dist/index.js +29166 -449
- package/dist/lsp/css/setup.js +6 -7
- package/dist/lsp/css/worker.js +8961 -1355
- package/dist/lsp/html/setup.js +7 -8
- package/dist/lsp/html/worker.js +6506 -672
- package/dist/lsp/json/setup.js +5 -6
- package/dist/lsp/json/worker.js +395 -393
- package/dist/lsp/language-service.js +21 -21
- package/dist/lsp/typescript/libs.js +11 -9
- package/dist/lsp/typescript/setup.js +6 -7
- package/dist/shiki-wasm.js +1 -1
- package/dist/shiki.js +129 -751
- package/dist/ssr/index.js +13 -18
- package/dist/ssr/workerd.js +13 -18
- package/dist/util.js +7 -3
- package/dist/workspace.js +16 -16
- package/package.json +31 -13
- package/types/core.d.ts +4 -0
- package/types/index.d.ts +31 -8
- package/types/jsonSchema.d.ts +2 -0
- package/types/lsp.d.ts +7 -1
- package/types/ssr.d.ts +5 -5
- package/types/textmate.d.ts +1 -1
- package/types/cache.d.ts +0 -7
|
@@ -1184,8 +1184,8 @@ var Is;
|
|
|
1184
1184
|
// src/lsp/language-service.ts
|
|
1185
1185
|
import { cache } from "../cache.js";
|
|
1186
1186
|
var monaco;
|
|
1187
|
-
function
|
|
1188
|
-
monaco
|
|
1187
|
+
function init(monacoNS) {
|
|
1188
|
+
monaco = monacoNS;
|
|
1189
1189
|
}
|
|
1190
1190
|
function createHost(workspace) {
|
|
1191
1191
|
return workspace ? {
|
|
@@ -1221,7 +1221,7 @@ function lspRequest(req, token) {
|
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
1223
|
var registry = /* @__PURE__ */ new Map();
|
|
1224
|
-
function
|
|
1224
|
+
function registerBasicFeatures(languageId, worker, completionTriggerCharacters, workspace) {
|
|
1225
1225
|
const { editor, languages } = monaco;
|
|
1226
1226
|
const onDispose = async (model) => {
|
|
1227
1227
|
const workerProxy = await worker.withSyncedResources([]);
|
|
@@ -1237,7 +1237,7 @@ function enableBasicFeatures(languageId, worker, completionTriggerCharacters, wo
|
|
|
1237
1237
|
onDispose(model);
|
|
1238
1238
|
}
|
|
1239
1239
|
});
|
|
1240
|
-
|
|
1240
|
+
registerDiagnostics(languageId, worker);
|
|
1241
1241
|
languages.registerCompletionItemProvider(languageId, new CompletionAdapter(worker, completionTriggerCharacters));
|
|
1242
1242
|
languages.registerHoverProvider(languageId, new HoverAdapter(worker));
|
|
1243
1243
|
languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker));
|
|
@@ -1271,7 +1271,7 @@ function enableBasicFeatures(languageId, worker, completionTriggerCharacters, wo
|
|
|
1271
1271
|
});
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function registerDiagnostics(languageId, worker) {
|
|
1275
1275
|
const { editor } = monaco;
|
|
1276
1276
|
const modelChangeListeners = /* @__PURE__ */ new Map();
|
|
1277
1277
|
const doValidate = async (model) => {
|
|
@@ -1555,7 +1555,7 @@ function convertMarkedStringArray(contents) {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
return [convertMarkdownString(contents)];
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function registerSignatureHelp(languageId, worker, triggerCharacters) {
|
|
1559
1559
|
monaco.languages.registerSignatureHelpProvider(
|
|
1560
1560
|
languageId,
|
|
1561
1561
|
new SignatureHelpAdapter(worker, triggerCharacters)
|
|
@@ -1587,7 +1587,7 @@ var SignatureHelpAdapter = class {
|
|
|
1587
1587
|
};
|
|
1588
1588
|
}
|
|
1589
1589
|
};
|
|
1590
|
-
function
|
|
1590
|
+
function registerCodeAction(languageId, worker) {
|
|
1591
1591
|
monaco.languages.registerCodeActionProvider(languageId, new CodeActionAdaptor(worker));
|
|
1592
1592
|
}
|
|
1593
1593
|
var CodeActionAdaptor = class {
|
|
@@ -1708,7 +1708,7 @@ var DocumentRangeFormattingEditProvider = class {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
1710
|
};
|
|
1711
|
-
function
|
|
1711
|
+
function registerAutoComplete(langaugeId, worker, triggerCharacters) {
|
|
1712
1712
|
const { editor } = monaco;
|
|
1713
1713
|
const listeners = /* @__PURE__ */ new Map();
|
|
1714
1714
|
const validateModel = async (model) => {
|
|
@@ -1910,7 +1910,7 @@ var ReferenceAdapter = class {
|
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
1912
|
};
|
|
1913
|
-
function
|
|
1913
|
+
function registerDocumentLinks(langaugeId, worker) {
|
|
1914
1914
|
monaco.languages.registerLinkProvider(langaugeId, new DocumentLinkAdapter(worker));
|
|
1915
1915
|
}
|
|
1916
1916
|
var DocumentLinkAdapter = class {
|
|
@@ -1929,7 +1929,7 @@ var DocumentLinkAdapter = class {
|
|
|
1929
1929
|
}
|
|
1930
1930
|
}
|
|
1931
1931
|
};
|
|
1932
|
-
function
|
|
1932
|
+
function registerColorPresentation(langaugeId, worker) {
|
|
1933
1933
|
monaco.languages.registerColorProvider(langaugeId, new DocumentColorAdapter(worker));
|
|
1934
1934
|
}
|
|
1935
1935
|
var DocumentColorAdapter = class {
|
|
@@ -2100,7 +2100,7 @@ function convertInlayHintLabelPart(part) {
|
|
|
2100
2100
|
function convertPosition(position) {
|
|
2101
2101
|
return new monaco.Position(position.line + 1, position.character + 1);
|
|
2102
2102
|
}
|
|
2103
|
-
function
|
|
2103
|
+
function registerEmbedded(languageId, mainWorker, languages) {
|
|
2104
2104
|
const { editor, Uri } = monaco;
|
|
2105
2105
|
const listeners = /* @__PURE__ */ new Map();
|
|
2106
2106
|
const validateModel = async (model) => {
|
|
@@ -2130,7 +2130,7 @@ function attachEmbeddedLanguages(languageId, mainWorker, embeddedLanguages) {
|
|
|
2130
2130
|
}
|
|
2131
2131
|
}
|
|
2132
2132
|
};
|
|
2133
|
-
const attachAll = () =>
|
|
2133
|
+
const attachAll = () => languages.forEach(attachEmbeddedLanguage);
|
|
2134
2134
|
listeners.set(modelUri, model.onDidChangeContent(attachAll));
|
|
2135
2135
|
attachAll();
|
|
2136
2136
|
};
|
|
@@ -2140,7 +2140,7 @@ function attachEmbeddedLanguages(languageId, mainWorker, embeddedLanguages) {
|
|
|
2140
2140
|
listeners.get(uri).dispose();
|
|
2141
2141
|
listeners.delete(uri);
|
|
2142
2142
|
}
|
|
2143
|
-
|
|
2143
|
+
languages.forEach((languageId2) => {
|
|
2144
2144
|
const uri2 = Uri.parse(model.uri.path + getEmbeddedExtname(languageId2));
|
|
2145
2145
|
editor.getModel(uri2)?.dispose();
|
|
2146
2146
|
});
|
|
@@ -2227,18 +2227,18 @@ export {
|
|
|
2227
2227
|
RenameAdapter,
|
|
2228
2228
|
SelectionRangeAdapter,
|
|
2229
2229
|
SignatureHelpAdapter,
|
|
2230
|
-
attachEmbeddedLanguages,
|
|
2231
2230
|
convertRange,
|
|
2232
2231
|
convertTextEdit,
|
|
2233
2232
|
createHost,
|
|
2234
2233
|
createWorkerWithEmbeddedLanguages,
|
|
2235
|
-
enableAutoComplete,
|
|
2236
|
-
enableBasicFeatures,
|
|
2237
|
-
enableCodeAction,
|
|
2238
|
-
enableColorPresentation,
|
|
2239
|
-
enableDocumentLinks,
|
|
2240
|
-
enableSignatureHelp,
|
|
2241
2234
|
fromPosition,
|
|
2242
2235
|
fromRange,
|
|
2243
|
-
|
|
2236
|
+
init,
|
|
2237
|
+
registerAutoComplete,
|
|
2238
|
+
registerBasicFeatures,
|
|
2239
|
+
registerCodeAction,
|
|
2240
|
+
registerColorPresentation,
|
|
2241
|
+
registerDocumentLinks,
|
|
2242
|
+
registerEmbedded,
|
|
2243
|
+
registerSignatureHelp
|
|
2244
2244
|
};
|