@coderline/alphatab-monaco 1.8.2 → 1.8.3
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/dist/alphaTab.monaco.mjs +14 -14
- package/dist/alphatex.mjs +21 -22
- package/dist/lsp.mjs +174 -221
- package/dist/lspMonacoMappings.mjs +237 -344
- package/dist/textmate.mjs +80 -86
- package/dist/types.mjs +11 -12
- package/dist/types2.mjs +17 -0
- package/dist/worker.mjs +4609 -5116
- package/package.json +10 -13
package/dist/textmate.mjs
CHANGED
|
@@ -1,94 +1,88 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import * as
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
* alphaTab Monaco v1.8.3 (, build 32)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* @preserve
|
|
11
|
+
* @license
|
|
12
|
+
*/
|
|
13
|
+
import * as monaco from "monaco-editor";
|
|
14
|
+
import * as oniguruma from "vscode-oniguruma";
|
|
15
|
+
import { INITIAL, Registry, parseRawGrammar } from "vscode-textmate";
|
|
16
|
+
//#region src/textmate.ts
|
|
18
17
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
* Adds TextMate grammar support to Monaco via `vscode-oniguruma` and `vscode-textmate`
|
|
19
|
+
* @param onigurumaWasm The `onig.wasm` file shipped together with vscode-oniguruma.
|
|
20
|
+
*/
|
|
22
21
|
function addTextMateGrammarSupport(onigurumaWasm) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
registry: registry,
|
|
48
|
-
grammars
|
|
49
|
-
};
|
|
22
|
+
const grammars = {};
|
|
23
|
+
return {
|
|
24
|
+
registry: new Registry({
|
|
25
|
+
onigLib: (async () => {
|
|
26
|
+
await oniguruma.loadWASM(onigurumaWasm);
|
|
27
|
+
return {
|
|
28
|
+
createOnigScanner(patterns) {
|
|
29
|
+
return new oniguruma.OnigScanner(patterns);
|
|
30
|
+
},
|
|
31
|
+
createOnigString(s) {
|
|
32
|
+
return new oniguruma.OnigString(s);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
})(),
|
|
36
|
+
loadGrammar: async (scopeName) => {
|
|
37
|
+
if (scopeName in grammars) {
|
|
38
|
+
const grammar = await grammars[scopeName]();
|
|
39
|
+
return parseRawGrammar(grammar, grammar.startsWith("{") ? `${scopeName}.tmLanguage.json` : void 0);
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
grammars
|
|
45
|
+
};
|
|
50
46
|
}
|
|
51
47
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
* Registers a TextMate grammar in moncao.
|
|
49
|
+
* @param grammarSupport The support object in which to register the grammar.
|
|
50
|
+
* @param languageId The ID of the language
|
|
51
|
+
* @param loadGrammar A promise to load the grammar source code.
|
|
52
|
+
* @param loadLanguageConfiguration A promise to load the monaco language configuration.
|
|
53
|
+
*/
|
|
58
54
|
async function registerGrammar(grammarSupport, languageId, loadGrammar, loadLanguageConfiguration) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
});
|
|
55
|
+
const sourceScope = `source.${languageId}`;
|
|
56
|
+
grammarSupport.grammars[sourceScope] = loadGrammar;
|
|
57
|
+
const grammar = await grammarSupport.registry.loadGrammar(sourceScope);
|
|
58
|
+
monaco.languages.register({ id: languageId });
|
|
59
|
+
monaco.languages.setLanguageConfiguration(languageId, await loadLanguageConfiguration());
|
|
60
|
+
monaco.languages.setTokensProvider(languageId, {
|
|
61
|
+
getInitialState() {
|
|
62
|
+
return INITIAL;
|
|
63
|
+
},
|
|
64
|
+
tokenize(line, state) {
|
|
65
|
+
const tokenizerState = state;
|
|
66
|
+
const textMateResult = grammar.tokenizeLine(line, tokenizerState, 500);
|
|
67
|
+
if (textMateResult.stoppedEarly) return {
|
|
68
|
+
endState: state,
|
|
69
|
+
tokens: textMateResult.tokens.map((t) => ({
|
|
70
|
+
...t,
|
|
71
|
+
scopes: t.scopes.reverse().join(" ")
|
|
72
|
+
}))
|
|
73
|
+
};
|
|
74
|
+
let endState;
|
|
75
|
+
if (state.equals(textMateResult.ruleStack)) endState = tokenizerState;
|
|
76
|
+
else endState = textMateResult.ruleStack;
|
|
77
|
+
return {
|
|
78
|
+
endState,
|
|
79
|
+
tokens: textMateResult.tokens.map((t) => ({
|
|
80
|
+
...t,
|
|
81
|
+
scopes: t.scopes.reverse().join(" ")
|
|
82
|
+
}))
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
92
86
|
}
|
|
93
|
-
|
|
87
|
+
//#endregion
|
|
94
88
|
export { addTextMateGrammarSupport, registerGrammar };
|
package/dist/types.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
* alphaTab Monaco v1.8.3 (, build 32)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* @preserve
|
|
11
|
+
* @license
|
|
12
|
+
*/
|
package/dist/types2.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Monaco v1.8.3 (, build 32)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* @preserve
|
|
11
|
+
* @license
|
|
12
|
+
*/
|
|
13
|
+
import { TextDocuments } from "vscode-languageserver";
|
|
14
|
+
import { DocumentDiagnosticReportKind, PositionEncodingKind as PositionEncodingKind$1, TextDocumentSyncKind } from "vscode-languageserver-protocol";
|
|
15
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
16
|
+
import { CompletionItemKind as CompletionItemKind$1, DiagnosticSeverity, InsertTextFormat as InsertTextFormat$1, ParameterInformation, SignatureInformation, TextEdit, uinteger } from "vscode-languageserver-types";
|
|
17
|
+
export { ParameterInformation as a, TextDocument as c, TextEdit as d, uinteger as f, InsertTextFormat$1 as i, TextDocumentSyncKind as l, DiagnosticSeverity as n, PositionEncodingKind$1 as o, DocumentDiagnosticReportKind as r, SignatureInformation as s, CompletionItemKind$1 as t, TextDocuments as u };
|