-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to sync xml syntax from vscode repo
- Loading branch information
1 parent
48f128b
commit e9c74a4
Showing
3 changed files
with
57 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const fetch = require('node-fetch'); | ||
var fsExtra = require('fs-extra'); | ||
(async () => { | ||
const json = await (await fetch('https://raw.githubusercontent.com/microsoft/vscode/main/extensions/xml/syntaxes/xml.tmLanguage.json')).json() | ||
json.scopeName = 'scenegraph.xml'; | ||
json.name = 'scenegraph'; | ||
json.fileTypes = ['xml']; | ||
delete json.information_for_contributors; | ||
delete json.version; | ||
//find the CDATA pattern | ||
var pattern = json.patterns.find(x => x.name === 'string.unquoted.cdata.xml'); | ||
pattern.name = 'source.brighterscript.embedded.scenegraph'; | ||
pattern.patterns = [{ | ||
include: "source.brs" | ||
}]; | ||
fsExtra.outputFileSync(`${__dirname}/../syntaxes/scenegraph.tmLanguage.json`, JSON.stringify(json, null, 4)); | ||
})().catch(e => console.error(e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters