Skip to content

Commit 5e87e70

Browse files
authored
Merge pull request #13 from CodinGame/update-monaco-0.32
Update monaco 0.32
2 parents 8697e21 + b60786d commit 5e87e70

29 files changed

+8374
-777
lines changed

package-lock.json

Lines changed: 8140 additions & 671 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codingame/monaco-editor-wrapper",
3-
"version": "1.4.3",
3+
"version": "1.5.0",
44
"private": false,
55
"description": "Enhanced Monaco editor with TextMate grammars and more",
66
"scripts": {
@@ -22,19 +22,19 @@
2222
],
2323
"types": "dist/index.d.ts",
2424
"dependencies": {
25-
"@codingame/monaco-emacs": "^0.2.2",
25+
"@codingame/monaco-emacs": "^0.2.3",
2626
"delay": ">=5.0.0",
27-
"monaco-editor": "npm:@codingame/monaco-editor@^0.31.8",
28-
"monaco-vim": "^0.1.19",
27+
"monaco-editor": "npm:@codingame/monaco-editor@^0.32.0",
28+
"monaco-vim": "^0.2.0",
2929
"vscode-oniguruma": "^1.6.1"
3030
},
3131
"devDependencies": {
32-
"@babel/core": "7.16.12",
32+
"@babel/core": "7.17.5",
3333
"@babel/plugin-proposal-class-properties": "7.16.7",
3434
"@babel/plugin-proposal-optional-chaining": "7.16.7",
3535
"@babel/preset-env": "7.16.11",
3636
"@babel/preset-typescript": "7.16.7",
37-
"@babel/runtime": "7.16.7",
37+
"@babel/runtime": "7.17.2",
3838
"@rollup/plugin-alias": "3.1.9",
3939
"@rollup/plugin-babel": "5.3.0",
4040
"@rollup/plugin-commonjs": "21.0.1",
@@ -45,12 +45,12 @@
4545
"@types/ini": "1.3.31",
4646
"@types/node": "14.14.31",
4747
"@types/rollup-plugin-node-builtins": "^2.1.2",
48-
"@typescript-eslint/eslint-plugin": "5.10.1",
49-
"@typescript-eslint/parser": "5.10.1",
48+
"@typescript-eslint/eslint-plugin": "5.12.0",
49+
"@typescript-eslint/parser": "5.12.0",
5050
"babel-eslint": "10.1.0",
5151
"cson-parser": "4.0.9",
5252
"deep-equal": "2.0.5",
53-
"eslint": "8.8.0",
53+
"eslint": "8.9.0",
5454
"eslint-config-standard": "16.0.3",
5555
"eslint-config-standard-jsx": "10.0.0",
5656
"eslint-plugin-import": "2.25.4",
@@ -61,15 +61,15 @@
6161
"fast-plist": "0.1.2",
6262
"ini": "2.0.0",
6363
"json5": "2.2.0",
64-
"postcss": "8.4.5",
65-
"rollup": "2.66.1",
64+
"postcss": "8.4.6",
65+
"rollup": "2.67.3",
6666
"rollup-plugin-json5": "1.0.0",
6767
"rollup-plugin-node-builtins": "^2.1.2",
6868
"rollup-plugin-string": "^3.0.0",
6969
"rollup-plugin-uglify": "^6.0.4",
7070
"rollup-plugin-visualizer": "5.5.4",
7171
"rollup-plugin-web-worker-loader": "1.6.1",
72-
"ts-node": "10.4.0",
72+
"ts-node": "10.5.0",
7373
"tslib": "^2.3.1",
7474
"typescript": "4.5.5",
7575
"vscode-languageserver-protocol": "3.16.0",
@@ -83,5 +83,9 @@
8383
"safari >= 12",
8484
"not IE 11",
8585
"not IE_Mob 11"
86-
]
87-
}
86+
],
87+
"volta": {
88+
"node": "16.14.0",
89+
"npm": "8.5.0"
90+
}
91+
}

src/configuration/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ configurationRegistry.registerDefaultConfigurations([{
1515
overrides: extensions.configurationDefaults
1616
}])
1717

18-
const simpleConfigurationService = monaco.editor.StaticServices.configurationService.get() as monaco.extra.SimpleConfigurationService
18+
const simpleConfigurationService = monaco.extra.StandaloneServices.get(monaco.extra.IConfigurationService) as monaco.extra.StandaloneConfigurationService
1919

2020
export const onConfigurationChanged = simpleConfigurationService.onDidChangeConfiguration
2121

src/extensions/autofold.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function setup (editor: monaco.editor.IStandaloneCodeEditor): voi
66
label: 'Fold all autofold regions',
77
run: async (editor: monaco.editor.ICodeEditor) => {
88
const foldingController = monaco.extra.FoldingController.get(editor)
9-
const foldingModelPromise: Promise<monaco.extra.FoldingModel> | null = foldingController.getFoldingModel()
9+
const foldingModelPromise: Promise<monaco.extra.FoldingModel> | null = foldingController?.getFoldingModel()
1010
if (foldingModelPromise != null) {
1111
return foldingModelPromise.then(foldingModel => {
1212
const editorModel = editor.getModel()

src/hacks.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11

22
import * as monaco from 'monaco-editor'
33

4-
monaco.errorHandler.setUnexpectedErrorHandler(error => {
5-
console.error('Unexpected error', error)
6-
})
7-
84
/* Add custom blocks parsing (for tech.io):
95
// { [autofold]
106
// custom block content
117
// }
128
*/
139
const CUSTOM_BLOCK_BEGIN_REGEX = '^\\w*(?:\\/\\/|#).*\\{'
1410
const CUSTOM_BLOCK_END_REGEX = '^\\w*(?:\\/\\/|#).*\\}'
15-
const original = monaco.languages.LanguageConfigurationRegistryImpl.prototype.getFoldingRules
16-
monaco.languages.LanguageConfigurationRegistryImpl.prototype.getFoldingRules = function (languageId: string) {
17-
const foldingRules: monaco.languages.FoldingRules = original.call(this, languageId)
18-
19-
const markers = foldingRules.markers
11+
export function addCustomFoldingMarkers (configuration: monaco.extra.ILanguageConfiguration): monaco.extra.ILanguageConfiguration {
12+
const markers = configuration.folding?.markers
2013
return {
21-
...foldingRules,
22-
markers: {
23-
start: markers != null ? new RegExp(markers.start.source + '|' + CUSTOM_BLOCK_BEGIN_REGEX) : new RegExp(CUSTOM_BLOCK_BEGIN_REGEX),
24-
end: markers != null ? new RegExp(markers.end.source + '|' + CUSTOM_BLOCK_END_REGEX) : new RegExp(CUSTOM_BLOCK_END_REGEX)
14+
...configuration,
15+
folding: {
16+
...configuration.folding ?? {},
17+
markers: {
18+
start: markers != null ? new RegExp(markers.start.source + '|' + CUSTOM_BLOCK_BEGIN_REGEX) : new RegExp(CUSTOM_BLOCK_BEGIN_REGEX),
19+
end: markers != null ? new RegExp(markers.end.source + '|' + CUSTOM_BLOCK_END_REGEX) : new RegExp(CUSTOM_BLOCK_END_REGEX)
20+
}
2521
}
2622
}
2723
}

src/languages/extensions/configurations/cpptools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,12 @@
22002200
"markdownDescription": "Controls whether the extension will report errors detected in `c_cpp_properties.json`.",
22012201
"scope": 4
22022202
},
2203+
"C_Cpp.default.dotConfig": {
2204+
"type": "string",
2205+
"default": null,
2206+
"markdownDescription": "%c_cpp.configuration.default.dotConfig.markdownDescription%",
2207+
"scope": 4
2208+
},
22032209
"C_Cpp.updateChannel": {
22042210
"type": "string",
22052211
"enum": [

src/languages/extensions/configurations/java.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646
"scope": 3
4747
},
4848
"java.configuration.checkProjectSettingsExclusions": {
49+
"deprecationMessage": "Please use 'java.import.generatesMetadataFilesAtProjectRoot' to control whether to generate the project metadata files at the project root. And use 'files.exclude' to control whether to hide the project metadata files from the file explorer.",
4950
"type": "boolean",
50-
"default": true,
51+
"default": false,
5152
"description": "Controls whether to exclude extension-generated project settings files (.project, .classpath, .factorypath, .settings/) from the file explorer.",
5253
"scope": 3
5354
},

src/languages/extensions/configurations/lua.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@
226226
],
227227
"type": "string"
228228
},
229+
"codestyle-check": {
230+
"default": "None",
231+
"description": "%config.diagnostics.codestyle-check%",
232+
"enum": [
233+
"Any",
234+
"Opened",
235+
"None"
236+
],
237+
"type": "string"
238+
},
229239
"count-down-loop": {
230240
"default": "Any",
231241
"description": "%config.diagnostics.count-down-loop%",
@@ -640,6 +650,17 @@
640650
],
641651
"type": "string"
642652
},
653+
"codestyle-check": {
654+
"default": "Warning",
655+
"description": "%config.diagnostics.codestyle-check%",
656+
"enum": [
657+
"Error",
658+
"Warning",
659+
"Information",
660+
"Hint"
661+
],
662+
"type": "string"
663+
},
643664
"count-down-loop": {
644665
"default": "Warning",
645666
"description": "%config.diagnostics.count-down-loop%",
@@ -1042,6 +1063,17 @@
10421063
"scope": 4,
10431064
"type": "integer"
10441065
},
1066+
"Lua.format.defaultConfig": {
1067+
"markdownDescription": "%config.format.defaultConfig%",
1068+
"scope": 4,
1069+
"type": "object"
1070+
},
1071+
"Lua.format.enable": {
1072+
"default": "true",
1073+
"markdownDescription": "Enable code formatter.",
1074+
"scope": 4,
1075+
"type": "boolean"
1076+
},
10451077
"Lua.hint.arrayIndex": {
10461078
"default": "Auto",
10471079
"enum": [
@@ -1428,6 +1460,9 @@
14281460
"default": null,
14291461
"markdownDescription": "Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Privacy-Policy).\n",
14301462
"scope": 4,
1463+
"tags": [
1464+
"telemetry"
1465+
],
14311466
"type": [
14321467
"boolean",
14331468
"null"

src/languages/extensions/configurations/scalameta.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"properties": {
55
"metals.serverVersion": {
66
"type": "string",
7-
"default": "0.11.1+97-0ef9a93b-SNAPSHOT",
7+
"default": "0.11.1+114-58f06ff8-SNAPSHOT",
88
"markdownDescription": "The version of the Metals server artifact. Requires reloading the window.\n\n**Change only if you know what you're doing**",
99
"scope": 3
1010
},
@@ -169,6 +169,12 @@
169169
"type": "string",
170170
"markdownDescription": "Optional Eclipse format profile to use.",
171171
"scope": 3
172+
},
173+
"metals.suggestLatestUpgrade": {
174+
"type": "boolean",
175+
"default": false,
176+
"markdownDescription": "Once in a day, notify if there are new server releases (including snapshots)",
177+
"scope": 3
172178
}
173179
}
174180
}

src/languages/extensions/configurations/typescript-language-features.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,12 @@
645645
"double"
646646
],
647647
"default": "auto",
648-
"markdownDescription": "Preferred quote style to use for quick fixes: `single` quotes, `double` quotes, or `auto` infer quote type from existing imports.",
648+
"markdownDescription": "Preferred quote style to use for quick fixes.",
649+
"markdownEnumDescriptions": [
650+
"Infer quote type from existing code",
651+
"Always use single quotes: `'`",
652+
"Always use double quotes: `\"`"
653+
],
649654
"scope": 5
650655
},
651656
"typescript.preferences.quoteStyle": {
@@ -656,7 +661,12 @@
656661
"double"
657662
],
658663
"default": "auto",
659-
"markdownDescription": "Preferred quote style to use for quick fixes: `single` quotes, `double` quotes, or `auto` infer quote type from existing imports.",
664+
"markdownDescription": "Preferred quote style to use for quick fixes.",
665+
"markdownEnumDescriptions": [
666+
"Infer quote type from existing code",
667+
"Always use single quotes: `'`",
668+
"Always use double quotes: `\"`"
669+
],
660670
"scope": 5
661671
},
662672
"javascript.preferences.importModuleSpecifier": {
@@ -739,7 +749,7 @@
739749
"none"
740750
],
741751
"markdownEnumDescriptions": [
742-
"Insert `={}` or `=\"\"` after attribute names based on the prop type.",
752+
"Insert `={}` or `=\"\"` after attribute names based on the prop type. See `javascript.preferences.quoteStyle` to control the type of quotes used for string attributes.",
743753
"Insert `={}` after attribute names.",
744754
"Only insert attribute names."
745755
],
@@ -755,7 +765,7 @@
755765
"none"
756766
],
757767
"markdownEnumDescriptions": [
758-
"Insert `={}` or `=\"\"` after attribute names based on the prop type.",
768+
"Insert `={}` or `=\"\"` after attribute names based on the prop type. See `typescript.preferences.quoteStyle` to control the type of quotes used for string attributes.",
759769
"Insert `={}` after attribute names.",
760770
"Only insert attribute names."
761771
],

0 commit comments

Comments
 (0)