From 4c0f0748e892c6d134589ebc0ce519d538b35b6a Mon Sep 17 00:00:00 2001 From: David Gatti Date: Fri, 12 Jan 2018 14:31:11 +0100 Subject: [PATCH 1/2] Added support for CSP --- gulpfile.js | 3 ++- src/csp.ts | 47 ++++++++++++++++++++++++++++++++++++++ src/monaco.contribution.ts | 7 ++++++ test/csp.test.ts | 10 ++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/csp.ts create mode 100644 test/csp.test.ts diff --git a/gulpfile.js b/gulpfile.js index eb068c65..12d7511e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -81,7 +81,8 @@ gulp.task('release', ['clean-release','compile'], function() { bundleOne('src/mysql'), bundleOne('src/redshift'), bundleOne('src/pgsql'), - bundleOne('src/redis') + bundleOne('src/redis'), + bundleOne('src/csp') ) .pipe(uglify({ output: { diff --git a/src/csp.ts b/src/csp.ts new file mode 100644 index 00000000..d20787a2 --- /dev/null +++ b/src/csp.ts @@ -0,0 +1,47 @@ +// Create your own language definition here +// You can safely look at other samples without losing modifications. +// Modifications are not saved on browser refresh/close though -- copy often! +return { + // Set defaultToken to invalid to see what you do not tokenize yet + // defaultToken: 'invalid', + keywords: [], + typeKeywords: [], + operators: [], + symbols: /[=> Date: Fri, 2 Mar 2018 14:09:31 +0100 Subject: [PATCH 2/2] Make code compile --- src/csp.ts | 106 +++++++++++++++++++++++++++++----------------------- test/all.js | 3 +- 2 files changed, 62 insertions(+), 47 deletions(-) diff --git a/src/csp.ts b/src/csp.ts index d20787a2..5225bd89 100644 --- a/src/csp.ts +++ b/src/csp.ts @@ -1,47 +1,61 @@ -// Create your own language definition here -// You can safely look at other samples without losing modifications. -// Modifications are not saved on browser refresh/close though -- copy often! -return { - // Set defaultToken to invalid to see what you do not tokenize yet - // defaultToken: 'invalid', - keywords: [], - typeKeywords: [], - operators: [], - symbols: /[=>{ + // Set defaultToken to invalid to see what you do not tokenize yet + // defaultToken: 'invalid', + keywords: [], + typeKeywords: [], + tokenPostfix: '.csp', + operators: [], + symbols: /[=>