@werckmeister/language-features 1.0.0-45 → 1.0.0-46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"sarP":[function(require,module,exports) {
2
2
  var r;!function(t){var n={"&amp;":"&","&lt;":"<","&gt;":">","&apos;":"'","&quot;":'"'},s="@",e="#";function a(r){return r&&r.replace(/^\s+|\s+$/g,"")}function f(r){return r.replace(/(&(?:lt|gt|amp|apos|quot|#(?:\d{1,6}|x[0-9a-fA-F]{1,5}));)/g,function(r){if("#"===r[1]){var t="x"===r[2]?parseInt(r.substr(3),16):parseInt(r.substr(2),10);if(t>-1)return String.fromCharCode(t)}return n[r]||r})}function u(r,t,n){if(void 0!==n){var s=r[t];s instanceof Array?s.push(n):r[t]=t in r?[s,n]:n}}t.fromXML=r=function(r,t){return function r(t,n){if("string"==typeof t)return t;var o=t.r;if(o)return o;var i=function(r,t){if(!r.t)return;for(var n,e,o=r.t.split(/([^\s='"]+(?:\s*=\s*(?:'[\S\s]*?'|"[\S\s]*?"|[^\s'"]*))?)/),i=o.length,l=0;l<i;l++){var c=a(o[l]);if(c){n||(n={});var p=c.indexOf("=");if(p<0)c=s+c,e=null;else{e=c.substr(p+1).replace(/^\s+/,""),c=s+c.substr(0,p).replace(/\s+$/,"");var v=e[0],g=e[e.length-1];v!==g||"'"!==v&&'"'!==v||(e=e.substr(1,e.length-2)),e=f(e)}t&&(e=t(c,e)),u(n,c,e)}}return n}(t,n);var l;var c=t.f;var p=c.length;if(i||p>1)l=i||{},c.forEach(function(t){"string"==typeof t?u(l,e,t):u(l,t.n,r(t,n))});else if(p){var v=c[0];if(l=r(v,n),v.n){var g={};g[v.n]=l,l=g}}else l=t.c?null:"";n&&(l=n(t.n||"",l));return l}(function(r){for(var t=String.prototype.split.call(r,/<([^!<>?](?:'[\S\s]*?'|"[\S\s]*?"|[^'"<>])*|!(?:--[\S\s]*?--|\[[^\[\]'"<>]+\[[\S\s]*?]]|DOCTYPE[^\[<>]*?\[[\S\s]*?]|(?:ENTITY[^"<>]*?"[\S\s]*?")?[\S\s]*?)|\?[\S\s]*?\?)>/),n=t.length,s={f:[]},e=s,u=[],o=0;o<n;){var i=t[o++];i&&v(i);var l=t[o++];l&&c(l)}return s;function c(r){var t=r.length,n=r[0];if("/"===n)for(var s=r.replace(/^\/|[\s\/].*$/g,"").toLowerCase();u.length;){var a=e.n&&e.n.toLowerCase();if(e=u.pop(),a===s)break}else if("?"===n)p({n:"?",r:r.substr(1,t-2)});else if("!"===n)"[CDATA["===r.substr(1,7)&&"]]"===r.substr(-2)?v(r.substr(8,t-10)):p({n:"!",r:r.substr(1)});else{var f=function(r){var t={f:[]},n=(r=r.replace(/\s*\/?$/,"")).search(/[\s='"\/]/);n<0?t.n=r:(t.n=r.substr(0,n),t.t=r.substr(n));return t}(r);p(f),"/"===r[t-1]?f.c=1:(u.push(e),e=f)}}function p(r){e.f.push(r)}function v(r){(r=a(r))&&p(f(r))}}(r),t)}}("object"==typeof exports&&exports||{});
3
3
  },{}],"ol4r":[function(require,module,exports) {
4
- "use strict";function e(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=t(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){c=!0,i=e},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw i}}}}function t(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DocParser=exports.parseCommandDbJson=void 0;var i=require("from-xml"),u=function(){function e(t){r(this,e),this.rawObject=t}return a(e,[{key:"getName",value:function(){return(this.rawObject||{})["@name"]}},{key:"getIsOptional",value:function(){return"1"===(this.rawObject||{})["@optional"]}},{key:"getType",value:function(){return(this.rawObject||{})["@type"]}},{key:"getDescription",value:function(){return(this.rawObject||{})["#"]}},{key:"getIsDeprecated",value:function(){return(this.rawObject||{})["@deprecated"].length>0}},{key:"getDeprecatedText",value:function(){return(this.rawObject||{})["@deprecated"]}}]),e}(),c=function(){function e(t){r(this,e),this.rawObject=t}return a(e,[{key:"getDocumentContext",value:function(){var e,t,n=((null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.command)||{})["@where"];return n?n.split(",").map(function(e){return e.trim()}):[]}},{key:"getName",value:function(){var e,t;return((null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.command)||{})["@name"]}},{key:"getDescription",value:function(){var e,t;return((null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.command)||{})["#"]}},{key:"getParameter",value:function(){var e,t,n=null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.param;return n?(Array.isArray(n)||(n=[n]),(n||[]).map(function(e){return new u(e)})):[]}}]),e}();function l(e){var t={},n=JSON.parse(e);for(var r in n)t[r]=new c(n[r].rawObject);return t}exports.parseCommandDbJson=l;var s=function(){function t(){r(this,t),this.commandDb={}}return a(t,[{key:"getDocComment",value:function(t,n){var r,o=[],a=!1,i=e(t.split("\n"));try{for(i.s();!(r=i.n()).done;){var u=r.value,c=u.trim().startsWith(n);if(!a&&c&&(a=!0),a&&!c)break;c&&o.push(u.replace(n,"").trim())}}catch(l){i.e(l)}finally{i.f()}return o.join("\n")}},{key:"parseDocumentText",value:function(e){var t=i.fromXML("<doc>".concat(e,"</doc>")),n=new c(t),r=n.getName();r&&(this.commandDb[r]=n)}},{key:"parseLua",value:function(e){var t=this.getDocComment(e,"--");t&&this.parseDocumentText(t)}},{key:"parseHpp",value:function(e){var t=this.getDocComment(e,"///");t&&this.parseDocumentText(t)}}]),t}();exports.DocParser=s;
4
+ "use strict";function e(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=t(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){c=!0,i=e},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw i}}}}function t(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DocParser=exports.parseCommandDbJson=void 0;var i=require("from-xml"),u=function(){function e(t){r(this,e),this.rawObject=t}return a(e,[{key:"getName",value:function(){return(this.rawObject||{})["@name"]}},{key:"getIsOptional",value:function(){return"1"===(this.rawObject||{})["@optional"]}},{key:"getType",value:function(){return(this.rawObject||{})["@type"]}},{key:"getDescription",value:function(){var e=(this.rawObject||{})["#"];return e&&e.join?e.join("\n"):e}},{key:"getIsDeprecated",value:function(){return(this.rawObject||{})["@deprecated"].length>0}},{key:"getDeprecatedText",value:function(){return(this.rawObject||{})["@deprecated"]}}]),e}(),c=function(){function e(t){r(this,e),this.rawObject=t}return a(e,[{key:"getDocumentContext",value:function(){var e,t,n=((null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.command)||{})["@where"];return n?n.split(",").map(function(e){return e.trim()}):[]}},{key:"getName",value:function(){var e,t;return((null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.command)||{})["@name"]}},{key:"getDescription",value:function(){var e,t,n=((null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.command)||{})["#"];return n&&n.join?n.join("\n"):n}},{key:"getParameter",value:function(){var e,t,n=null===(t=null===(e=this.rawObject)||void 0===e?void 0:e.doc)||void 0===t?void 0:t.param;return n?(Array.isArray(n)||(n=[n]),(n||[]).map(function(e){return new u(e)})):[]}}]),e}();function l(e){var t={},n=JSON.parse(e);for(var r in n)t[r]=new c(n[r].rawObject);return t}exports.parseCommandDbJson=l;var s=function(){function t(){r(this,t),this.commandDb={}}return a(t,[{key:"getDocComment",value:function(t,n){var r,o=[],a=!1,i=e(t.split("\n"));try{for(i.s();!(r=i.n()).done;){var u=r.value,c=u.trim().startsWith(n);if(!a&&c&&(a=!0),a&&!c)break;c&&o.push(u.replace(n,"").trim())}}catch(l){i.e(l)}finally{i.f()}return o.join("\n")}},{key:"parseDocumentText",value:function(e){var t=i.fromXML("<doc>".concat(e,"</doc>")),n=new c(t),r=n.getName();r&&(this.commandDb[r]=n)}},{key:"parseLua",value:function(e){var t=this.getDocComment(e,"--");t&&this.parseDocumentText(t)}},{key:"parseHpp",value:function(e){var t=this.getDocComment(e,"///");t&&this.parseDocumentText(t)}}]),t}();exports.DocParser=s;
5
5
  },{"from-xml":"sarP"}],"f88W":[function(require,module,exports) {
6
6
 
7
7
  },{}],"Y3F9":[function(require,module,exports) {
@@ -26,7 +26,7 @@ var n,t=arguments[3],r=require("buffer").Buffer;(function(){var r,e=200,u="Unsup
26
26
  },{"./WerckmeisterAutoHintDb":"Y3F9","lodash":"B1iE"}],"zyF4":[function(require,module,exports) {
27
27
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GMInstruments=void 0,exports.GMInstruments=["Acoustic Grand Piano","Bright Acoustic Piano","Electric Grand Piano","Honky-tonk Piano","Electric Piano 1","Electric Piano 2","Harpsichord","Clavi","Celesta","Glockenspiel","Music Box","Vibraphone","Marimba","Xylophone","Tubular Bells","Dulcimer","Drawbar Organ","Percussive Organ","Rock Organ","Church Organ","Reed Organ","Accordion","Harmonica","Tango Accordion","Acoustic Guitar Nylon","Acoustic Guitar Steel","Electric Guitar Jazz","Electric Guitar Clean","Electric Guitar Muted","Overdriven Guitar","Distortion Guitar","Guitar harmonics","Acoustic Bass","Electric Bass Finger","Electric Bass Pick","Fretless Bass","Slap Bass 1","Slap Bass 2","Synth Bass 1","Synth Bass 2","Violin","Viola","Cello","Contrabass","Tremolo Strings","Pizzicato Strings","Orchestral Harp","Timpani","String Ensemble 1","String Ensemble 2","SynthStrings 1","SynthStrings 2","Choir Aahs","Voice Oohs","Synth Voice","Orchestra Hit","Trumpet","Trombone","Tuba","Muted Trumpet","French Horn","Brass Section","SynthBrass 1","SynthBrass 2","Soprano Sax","Alto Sax","Tenor Sax","Baritone Sax","Oboe","English Horn","Bassoon","Clarinet","Piccolo","Flute","Recorder","Pan Flute","Blown Bottle","Shakuhachi","Whistle","Ocarina","Lead 1 Square","Lead 2 Sawtooth","Lead 3 Calliope","Lead 4 Chiff","Lead 5 Charang","Lead 6 Voice","Lead 7 Fifths","Lead 8 Bass+Lead","Pad 1 New Age","Pad 2 Warm","Pad 3 Polysynth","Pad 4 Choir","Pad 5 Bowed","Pad 6 Metallic","Pad 7 Halo","Pad 8 Sweep","FX 1 Rain","FX 2 Soundtrack","FX 3 Crystal","FX 4 Atmosphere","FX 5 Brightness","FX 6 Goblins","FX 7 Echoes","FX 8 Sci-Fi","Sitar","Banjo","Shamisen","Koto","Kalimba","Bag pipe","Fiddle","Shanai","Tinkle Bell","Agogo","Steel Drums","Woodblock","Taiko Drum","Melodic Tom","Synth Drum","Reverse Cymbal","Guitar Fret Noise","Breath Noise","Seashore","Bird Tweet","Telephone Ring","Helicopter","Applause","Gunshot"];
28
28
  },{}],"ykR4":[function(require,module,exports) {
29
- "use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(a,o){function u(e){try{c(r.next(e))}catch(t){o(t)}}function i(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,i)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommandArgument=void 0;var a=require("../../Common"),o=require("./GMInstruments"),u=require("../../WerckmeisterAutoHintDb"),i=[a.Keywords.mod,a.Keywords.voicingStrategy,a.Keywords.do,a.Keywords.doOnce],c=[a.Keywords.volume,a.Keywords.pan],s=[].concat(c,i),m=function(){function t(){e(this,t),this.autoHintDb=u.getAutoHintDb()}return n(t,[{key:"getModName",value:function(e){e=e||"";var t=s.join("|"),n=new RegExp("\\s*(".concat(a.Keywords.modOnce,"|").concat(t,')\\s*:.*_use="?([a-zA-Z0-9]+)"?')).exec(e);return n||(n=new RegExp("\\s*(".concat(a.Keywords.modOnce,"|").concat(t,")\\s*:\\s*([a-zA-Z0-9]+)")).exec(e)),!n||n.length<2?"":n[2]}},{key:"getInstrumentConfModName",value:function(e){e=e||"";var t=s.join("|"),n=(new RegExp(".*(".concat(t,").*")).exec(e)||[])[1];if(n&&c.includes(n))return n;t=s.map(function(e){return"".concat(e,".*")}).join("|");var r=(new RegExp(".*(".concat(t,")")).exec(e)||[])[1];if(r){var a=r.match(/\s*_use="?([a-zA-Z0-9]+)"?/);return a&&a.length>1?a[1]:(t=s.join("|"),!(a=new RegExp("\\s*(".concat(t,")\\s*([a-zA-Z0-9]+)")).exec(r))||a.length<2?"":a[2])}}},{key:"isMod",value:function(e){return e===a.Keywords.mod||e===a.Keywords.modOnce||e===a.Keywords.voicingStrategy}},{key:"isInstrumentConf",value:function(e){return e===a.Keywords.instrumentConf}},{key:"getParameterSuggestion",value:function(e,t){var n=e.getParameter();return t&&(n=n.filter(function(e){return e.getName().startsWith(t)})),n.sort(function(e,t){return e.getName().localeCompare(t.getName())}).map(function(t){return{displayText:t.getName(),text:"_".concat(t.getName()),deprecated:t.getDeprecatedText(),command:e}})}},{key:"getInstrumentDefPcSuggestions",value:function(e,t,n){var r=o.GMInstruments.map(function(n,r){return{displayText:"".concat(n," (").concat(r,")"),text:r.toString(),command:e,parameter:t}});return n&&(r=r.filter(function(e){return e.displayText.toLowerCase().indexOf(n.toLowerCase())>=0})),r}},{key:"getValueSuggestion",value:function(e,t,n){var r=e.getParameter().filter(function(e){return e.getName()===t})[0];if(!r)return[];if(e.getName()===a.Keywords.instrumentDef&&"pc"==t)return this.getInstrumentDefPcSuggestions(e,r,n);var o=(r.getType()||"").match(/\[(.*)\]/);if(!o||!o[1])return[];var u=o[1].split(",").map(function(e){return e.trim()});return n&&(u=u.filter(function(e){return e.startsWith(n)})),u.map(function(t){return{displayText:t,text:'"'.concat(t,'"'),command:e,parameter:r}})}},{key:"getSuggestions",value:function(e,t,n){return r(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,a,o,u,i,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",[]);case 2:if(n=e.match(/.*?(\w+)\s*:.*?_(\w*)(="?(\w*))?$/)){t.next=5;break}return t.abrupt("return",[]);case 5:if(r=(n[1]||"").trim(),a=void 0!==n[3],o=(n[2]||"").trim(),this.isMod(r)&&(r=this.getModName(e)),this.isInstrumentConf(r)&&(r=this.getInstrumentConfModName(e)),u=this.autoHintDb[r]){t.next=13;break}return t.abrupt("return",[]);case 13:if(!a){t.next=17;break}return i=(n[2]||"").trim(),c=(n[4]||"").trim(),t.abrupt("return",this.getValueSuggestion(u,i,c));case 17:return t.abrupt("return",this.getParameterSuggestion(u,o));case 18:case"end":return t.stop()}},t,this)}))}}]),t}();exports.CommandArgument=m;
29
+ "use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{c(r.next(e))}catch(t){a(t)}}function u(e){try{c(r.throw(e))}catch(t){a(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommandArgument=void 0;var o=require("../../Common"),a=require("./GMInstruments"),i=require("../../WerckmeisterAutoHintDb"),u=[o.Keywords.mod,o.Keywords.voicingStrategy,o.Keywords.do,o.Keywords.doOnce],c=[o.Keywords.volume,o.Keywords.pan],s=[].concat(c,u),m=function(){function t(){e(this,t),this.autoHintDb=i.getAutoHintDb()}return n(t,[{key:"getModName",value:function(e){e=e||"";var t=s.join("|"),n=new RegExp("\\s*(".concat(o.Keywords.modOnce,"|").concat(t,')\\s*:.*_use="?([a-zA-Z0-9]+)"?')).exec(e);return n||(n=new RegExp("\\s*(".concat(o.Keywords.modOnce,"|").concat(t,")\\s*:\\s*([a-zA-Z0-9]+)")).exec(e)),!n||n.length<2?"":n[2]}},{key:"getInstrumentConfModName",value:function(e){e=e||"";var t=s.join("|"),n=(new RegExp(".*(".concat(t,").*")).exec(e)||[])[1];if(n&&c.includes(n))return n;t=s.map(function(e){return"".concat(e,".*")}).join("|");var r=(new RegExp(".*(".concat(t,")")).exec(e)||[])[1];if(r){var o=r.match(/\s*_use="?([a-zA-Z0-9]+)"?/);return o&&o.length>1?o[1]:(t=s.join("|"),!(o=new RegExp("\\s*(".concat(t,")\\s*([a-zA-Z0-9]+)")).exec(r))||o.length<2?"":o[2])}}},{key:"isMod",value:function(e){return e===o.Keywords.mod||e===o.Keywords.modOnce||e===o.Keywords.voicingStrategy}},{key:"isInstrumentConf",value:function(e){return e===o.Keywords.instrumentConf}},{key:"getParameterSuggestion",value:function(e,t){var n=e.getParameter();return t&&(n=n.filter(function(e){return e.getName().startsWith(t)})),n.sort(function(e,t){return e.getName().localeCompare(t.getName())}).map(function(t){return{displayText:t.getName(),text:"_".concat(t.getName()),deprecated:t.getDeprecatedText(),command:e,description:t.getDescription()}})}},{key:"getInstrumentDefPcSuggestions",value:function(e,t,n){var r=a.GMInstruments.map(function(n,r){return{displayText:"".concat(n," (").concat(r,")"),text:r.toString(),command:e,parameter:t}});return n&&(r=r.filter(function(e){return e.displayText.toLowerCase().indexOf(n.toLowerCase())>=0})),r}},{key:"getValueSuggestion",value:function(e,t,n){var r=e.getParameter().filter(function(e){return e.getName()===t})[0];if(!r)return[];if(e.getName()===o.Keywords.instrumentDef&&"pc"==t)return this.getInstrumentDefPcSuggestions(e,r,n);var a=(r.getType()||"").match(/\[(.*)\]/);if(!a||!a[1])return[];var i=a[1].split(",").map(function(e){return e.trim()});return n&&(i=i.filter(function(e){return e.startsWith(n)})),i.map(function(t){return{displayText:t,text:'"'.concat(t,'"'),command:e,parameter:r}})}},{key:"getSuggestions",value:function(e,t,n){return r(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,o,a,i,u,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",[]);case 2:if(n=e.match(/.*?(\w+)\s*:.*?_(\w*)(="?(\w*))?$/)){t.next=5;break}return t.abrupt("return",[]);case 5:if(r=(n[1]||"").trim(),o=void 0!==n[3],a=(n[2]||"").trim(),this.isMod(r)&&(r=this.getModName(e)),this.isInstrumentConf(r)&&(r=this.getInstrumentConfModName(e)),i=this.autoHintDb[r]){t.next=13;break}return t.abrupt("return",[]);case 13:if(!o){t.next=17;break}return u=(n[2]||"").trim(),c=(n[4]||"").trim(),t.abrupt("return",this.getValueSuggestion(i,u,c));case 17:return t.abrupt("return",this.getParameterSuggestion(i,a));case 18:case"end":return t.stop()}},t,this)}))}}]),t}();exports.CommandArgument=m;
30
30
  },{"../../Common":"I6jy","./GMInstruments":"zyF4","../../WerckmeisterAutoHintDb":"Y3F9"}],"nviV":[function(require,module,exports) {
31
31
  "use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function u(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Command=void 0;var o=require("lodash"),i=require("../../WerckmeisterAutoHintDb"),a=function(){function t(){e(this,t),this.commandDb=i.getAutoHintDb()}return n(t,[{key:"getSuggestions",value:function(e,t,n){return r(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.toLowerCase(),i=o(this.commandDb).filter(function(e,t){return t.toLowerCase().indexOf(r)>=0&&e.getDocumentContext().includes(n)}).value(),t.abrupt("return",i.map(function(e){return{displayText:e.getName(),text:e.getName(),description:e.getDescription()}}));case 3:case"end":return t.stop()}},t,this)}))}}]),t}();exports.Command=a;
32
32
  },{"lodash":"B1iE","../../WerckmeisterAutoHintDb":"Y3F9"}],"Tlxz":[function(require,module,exports) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@werckmeister/language-features",
3
- "version": "1.0.0-45",
3
+ "version": "1.0.0-46",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {