mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Add JSON with interpolation language support
Introduce a new 'json-interpolation' language that extends JSON with
${...} variable interpolation syntax. Features include:
- Monarch tokenizer with nextEmbedded for JavaScript inside ${...}
- Variable context API for custom completion and hover providers
- Diagnostics filtering to ignore errors inside interpolations
- Full JSON language service integration (formatting, symbols, etc.)
- Support for JSONC-style comments and trailing commas
Usage:
```typescript
monaco.languages.jsonInterpolation.jsonInterpolationDefaults.setVariableContext({
getVariables: () => [
{ name: 'env', type: 'string', value: 'production' }
]
});
```
This commit is contained in:
parent
c619ef9a3d
commit
4540e05e5a
6 changed files with 991 additions and 1 deletions
|
|
@ -37,6 +37,10 @@ export default defineConfig(async (args) => {
|
|||
__dirname,
|
||||
'../../src/language/json/monaco.contribution.ts'
|
||||
),
|
||||
'language/json-interpolation/monaco.contribution': resolve(
|
||||
__dirname,
|
||||
'../../src/language/json-interpolation/monaco.contribution.ts'
|
||||
),
|
||||
'language/typescript/monaco.contribution': resolve(
|
||||
__dirname,
|
||||
'../../src/language/typescript/monaco.contribution.ts'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue