Skip to content

Commit 797891a

Browse files
authored
Merge pull request #9 from CodinGame/fix-extension-configurations
Fix extension configurations
2 parents 5eda461 + a257a08 commit 797891a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+12357
-9617
lines changed

package-lock.json

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

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codingame/monaco-editor-wrapper",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"private": false,
55
"description": "Enhanced Monaco editor with TextMate grammars and more",
66
"scripts": {
@@ -28,28 +28,28 @@
2828
"vscode-oniguruma": "^1.6.1"
2929
},
3030
"devDependencies": {
31-
"@babel/core": "7.16.7",
31+
"@babel/core": "7.16.12",
3232
"@babel/plugin-proposal-class-properties": "7.16.7",
3333
"@babel/plugin-proposal-optional-chaining": "7.16.7",
34-
"@babel/preset-env": "7.16.7",
34+
"@babel/preset-env": "7.16.11",
3535
"@babel/preset-typescript": "7.16.7",
3636
"@babel/runtime": "7.16.7",
3737
"@rollup/plugin-alias": "3.1.9",
3838
"@rollup/plugin-babel": "5.3.0",
3939
"@rollup/plugin-commonjs": "21.0.1",
4040
"@rollup/plugin-eslint": "8.0.1",
4141
"@rollup/plugin-json": "4.1.0",
42-
"@rollup/plugin-node-resolve": "13.1.2",
42+
"@rollup/plugin-node-resolve": "13.1.3",
4343
"@rollup/plugin-typescript": "^8.3.0",
4444
"@types/ini": "1.3.31",
4545
"@types/node": "14.14.31",
4646
"@types/rollup-plugin-node-builtins": "^2.1.2",
47-
"@typescript-eslint/eslint-plugin": "5.8.1",
48-
"@typescript-eslint/parser": "5.8.1",
47+
"@typescript-eslint/eslint-plugin": "5.10.1",
48+
"@typescript-eslint/parser": "5.10.1",
4949
"babel-eslint": "10.1.0",
5050
"cson-parser": "4.0.9",
5151
"deep-equal": "2.0.5",
52-
"eslint": "8.6.0",
52+
"eslint": "8.8.0",
5353
"eslint-config-standard": "16.0.3",
5454
"eslint-config-standard-jsx": "10.0.0",
5555
"eslint-plugin-import": "2.25.4",
@@ -61,16 +61,16 @@
6161
"ini": "2.0.0",
6262
"json5": "2.2.0",
6363
"postcss": "8.4.5",
64-
"rollup": "2.62.0",
64+
"rollup": "2.66.1",
6565
"rollup-plugin-json5": "1.0.0",
6666
"rollup-plugin-node-builtins": "^2.1.2",
6767
"rollup-plugin-string": "^3.0.0",
6868
"rollup-plugin-uglify": "^6.0.4",
69-
"rollup-plugin-visualizer": "5.5.2",
69+
"rollup-plugin-visualizer": "5.5.4",
7070
"rollup-plugin-web-worker-loader": "1.6.1",
7171
"ts-node": "10.4.0",
7272
"tslib": "^2.3.1",
73-
"typescript": "4.5.4",
73+
"typescript": "4.5.5",
7474
"vscode-languageserver-protocol": "3.16.0",
7575
"vscode-textmate": "6.0.0",
7676
"yaml": "1.10.2"

rollup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { babel } from '@rollup/plugin-babel'
1010
import * as rollup from 'rollup'
1111
import builtins from 'rollup-plugin-node-builtins'
1212
import { uglify } from 'rollup-plugin-uglify'
13-
import pkg from './package.json'
1413
import path from 'path'
14+
import pkg from './package.json'
1515

1616
const externals = Object.keys(pkg.dependencies)
1717

src/features/extensionConfigurations.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import * as monaco from 'monaco-editor'
2-
import extensionConfigurations from '../languages/extensions/extensionConfigurations.json'
2+
import extensionConfigurationLoader from '../languages/extensions/extensionConfigurationLoader'
33

44
const configurationRegistry = monaco.extra.Registry.as<monaco.extra.IConfigurationRegistry>(monaco.extra.ConfigurationExtensions.Configuration)
55

6-
configurationRegistry.registerConfigurations(extensionConfigurations as unknown as monaco.extra.IConfigurationNode[])
6+
export async function loadConfigurationForExtension (extensionId: string): Promise<void> {
7+
const loader = extensionConfigurationLoader[extensionId]
8+
if (loader == null) {
9+
throw new Error(`Unknown extension ${extensionId}`)
10+
}
11+
const configuration = await loader()
12+
configurationRegistry.registerConfigurations(configuration)
13+
}
714

815
/**
916
* comes from https://github.com/microsoft/vscode/blob/16d0a319b28caa4b6cf4e6801fd508282b7533e0/src/vs/workbench/contrib/files/browser/files.contribution.ts#L132

src/languages/extensions/configurationLoader.ts

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[
2+
{
3+
"title": "Angular Language Service",
4+
"properties": {
5+
"angular.log": {
6+
"type": "string",
7+
"enum": [
8+
"off",
9+
"terse",
10+
"normal",
11+
"verbose"
12+
],
13+
"default": "off",
14+
"description": "Enables logging of the Angular server to a file. This log can be used to diagnose Angular Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.",
15+
"scope": 3
16+
},
17+
"angular.view-engine": {
18+
"type": "boolean",
19+
"default": false,
20+
"description": "Use legacy View Engine language service. This option is incompatible with projects using Angular v13 and above.",
21+
"scope": 3
22+
},
23+
"angular.enable-strict-mode-prompt": {
24+
"type": "boolean",
25+
"default": true,
26+
"markdownDescription": "Prompt to enable the [strictTemplates](https://angular.io/guide/angular-compiler-options#stricttemplates) flag in [angularCompilerOptions](https://angular.io/guide/angular-compiler-options). Note that strict mode is only available when using Ivy.",
27+
"scope": 3
28+
},
29+
"angular.trace.server": {
30+
"type": "string",
31+
"scope": 3,
32+
"enum": [
33+
"off",
34+
"messages",
35+
"verbose"
36+
],
37+
"default": "off",
38+
"description": "Traces the communication between VS Code and the Angular language server."
39+
},
40+
"angular.suggest.includeAutomaticOptionalChainCompletions": {
41+
"type": "boolean",
42+
"default": true,
43+
"markdownDescription": "Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires TS 3.7+, strict null checks to be enabled and the `legacy View Engine` option to be disabled.",
44+
"scope": 3
45+
},
46+
"angular.suggest.includeCompletionsWithSnippetText": {
47+
"type": "boolean",
48+
"default": true,
49+
"markdownDescription": "Enable/disable snippet completions from Angular language server. Requires using TypeScript 4.3+ in the workspace and the `legacy View Engine` option to be disabled.",
50+
"scope": 3
51+
}
52+
}
53+
}
54+
]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
[
2+
{
3+
"title": "COBOL Language Support",
4+
"properties": {
5+
"cobol-lsp.cpy-manager.profiles": {
6+
"type": "string",
7+
"description": "Current default profile for copybook downloader",
8+
"scope": 3
9+
},
10+
"cobol-lsp.cpy-manager.paths-local": {
11+
"type": "array",
12+
"items": {
13+
"type": "string"
14+
},
15+
"description": "Default list of relative local paths to search for copybooks",
16+
"uniqueItems": true,
17+
"scope": 3
18+
},
19+
"cobol-lsp.cpy-manager.paths-dsn": {
20+
"type": "array",
21+
"items": {
22+
"type": "string"
23+
},
24+
"description": "Default list of datasets to search for copybooks",
25+
"uniqueItems": true,
26+
"scope": 3
27+
},
28+
"cobol-lsp.subroutine-manager.paths-local": {
29+
"type": "array",
30+
"items": {
31+
"type": "string"
32+
},
33+
"description": "List of relative local paths to search for subroutines",
34+
"uniqueItems": true,
35+
"scope": 3,
36+
"default": [
37+
"/tmp/project"
38+
]
39+
},
40+
"cobol-lsp.logging.level.root": {
41+
"type": "string",
42+
"default": "ERROR",
43+
"enum": [
44+
"ERROR",
45+
"WARN",
46+
"INFO",
47+
"DEBUG",
48+
"TRACE",
49+
"ALL"
50+
],
51+
"enumDescriptions": [
52+
"ERROR level logs error events which may or not be fatal to the application",
53+
"WARN level logs potentially harmful situations",
54+
"INFO level logs informational messages highlighting overall progress of the application",
55+
"DEBUG level logs informational events of very low importance",
56+
"TRACE level logs informational events of very low importance",
57+
"ALL level is used to turn on all logging"
58+
],
59+
"description": "The logging level for COBOL LS backend",
60+
"scope": 3
61+
},
62+
"cobol-lsp.target-sql-backend": {
63+
"type": "string",
64+
"default": "DB2_SERVER",
65+
"enum": [
66+
"DB2_SERVER",
67+
"DATACOM_SERVER"
68+
],
69+
"enumDescriptions": [
70+
"DB2_SERVER - IBM DB2 SQL Server",
71+
"DATACOM_SERVER - CA DATACOM Server"
72+
],
73+
"description": "The target SQL backend server which will be used in mainframe",
74+
"scope": 3
75+
}
76+
}
77+
}
78+
]

0 commit comments

Comments
 (0)