google / google/playground-elements
Ability to register additional grammars
- Dominant language
- TypeScript
- Stars
- 648
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Description
```html
$('playground-ide').config = {
files: {
'query.graphql': {
content: 'query SomeQuery($var: Int) { someQuery(var: $var) }'
}
}
};
```
**Expected**: file syntax-highlights
**Actual**: no syntax-highlighting
**Desired solution**:
```js
// ostensibly fetches then registers an additional grammar
await $('playground-ide').registerGrammar('https://big.old.grammar.store/grammars/graphql.grammar');
```
or maybe
```js
await $('playground-ide').registerGrammar({
language: 'graphql',
extentions: ['graphql'],
src: 'https://big.old.grammar.store/grammars/graphql.grammar',
});
```
and even
```html
```
This doesn't replace existing grammars unless the grammar in question overwrites something in `google-modes`
Thanks for the wonderful package and for considering this feature request.
Contributor guide
Assessment
This issue has not been assessed yet.