monaco-editor 0.16.1 → 0.16.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Monaco Editor Changelog
2
2
 
3
+ ## [0.16.2] (19.03.2018)
4
+ * Fixes for HTML and JSON (https://github.com/Microsoft/monaco-editor/issues/1367, https://github.com/Microsoft/monaco-editor/issues/1254)
5
+
3
6
  ## [0.16.1] (14.03.2018)
4
7
  * Fixes issue with context menu (https://github.com/Microsoft/monaco-editor/issues/1357)
5
8
 
@@ -15066,13 +15066,50 @@ define('vscode-uri', ['vscode-uri/index'], function (main) { return main; });
15066
15066
  //# sourceMappingURL=htmlLanguageService.js.map;
15067
15067
  define('vscode-html-languageservice', ['vscode-html-languageservice/htmlLanguageService'], function (main) { return main; });
15068
15068
 
15069
- define('vs/language/html/htmlWorker',["require", "exports", "vscode-html-languageservice", "vscode-languageserver-types"], function (require, exports, htmlService, ls) {
15069
+ /*---------------------------------------------------------------------------------------------
15070
+ * Copyright (c) Microsoft Corporation. All rights reserved.
15071
+ * Licensed under the MIT License. See License.txt in the project root for license information.
15072
+ *--------------------------------------------------------------------------------------------*/
15073
+ define('vs/language/html/fillers/polyfills',["require", "exports"], function (require, exports) {
15074
+ "use strict";
15075
+ Object.defineProperty(exports, "__esModule", { value: true });
15076
+ function polyfill() {
15077
+ // Object.assign, for IE11
15078
+ if (typeof Object['assign'] != 'function') {
15079
+ Object.defineProperty(Object, "assign", {
15080
+ value: function assign(destination, sources) {
15081
+ 'use strict';
15082
+ if (destination !== null) {
15083
+ for (var i = 1; i < arguments.length; i++) {
15084
+ var source = arguments[i];
15085
+ if (source) {
15086
+ for (var key in source) {
15087
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
15088
+ destination[key] = source[key];
15089
+ }
15090
+ }
15091
+ }
15092
+ }
15093
+ ;
15094
+ }
15095
+ return destination;
15096
+ },
15097
+ writable: true,
15098
+ configurable: true
15099
+ });
15100
+ }
15101
+ }
15102
+ exports.polyfill = polyfill;
15103
+ });
15104
+
15105
+ define('vs/language/html/htmlWorker',["require", "exports", "vscode-html-languageservice", "vscode-languageserver-types", "./fillers/polyfills"], function (require, exports, htmlService, ls, poli) {
15070
15106
  /*---------------------------------------------------------------------------------------------
15071
15107
  * Copyright (c) Microsoft Corporation. All rights reserved.
15072
15108
  * Licensed under the MIT License. See License.txt in the project root for license information.
15073
15109
  *--------------------------------------------------------------------------------------------*/
15074
15110
  'use strict';
15075
15111
  Object.defineProperty(exports, "__esModule", { value: true });
15112
+ poli.polyfill();
15076
15113
  var HTMLWorker = /** @class */ (function () {
15077
15114
  function HTMLWorker(ctx, createData) {
15078
15115
  this._ctx = ctx;
@@ -1651,7 +1651,7 @@ define('vs/language/json/languageFeatures',["require", "exports", "vscode-langua
1651
1651
  return worker.doValidation(resource.toString()).then(function (diagnostics) {
1652
1652
  var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); });
1653
1653
  var model = monaco.editor.getModel(resource);
1654
- if (model.getModeId() === languageId) {
1654
+ if (model && model.getModeId() === languageId) {
1655
1655
  monaco.editor.setModelMarkers(model, languageId, markers);
1656
1656
  }
1657
1657
  });
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Type definitions for monaco-editor v0.16.1
3
+ * Type definitions for monaco-editor v0.16.2
4
4
  * Released under the MIT license
5
5
  *-----------------------------------------------------------*/
6
6
  /*---------------------------------------------------------------------------------------------
@@ -0,0 +1,30 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ export function polyfill() {
6
+ // Object.assign, for IE11
7
+ if (typeof Object['assign'] != 'function') {
8
+ Object.defineProperty(Object, "assign", {
9
+ value: function assign(destination, sources) {
10
+ 'use strict';
11
+ if (destination !== null) {
12
+ for (var i = 1; i < arguments.length; i++) {
13
+ var source = arguments[i];
14
+ if (source) {
15
+ for (var key in source) {
16
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
17
+ destination[key] = source[key];
18
+ }
19
+ }
20
+ }
21
+ }
22
+ ;
23
+ }
24
+ return destination;
25
+ },
26
+ writable: true,
27
+ configurable: true
28
+ });
29
+ }
30
+ }
@@ -5,6 +5,8 @@
5
5
  'use strict';
6
6
  import * as htmlService from './_deps/vscode-html-languageservice/htmlLanguageService.js';
7
7
  import * as ls from './_deps/vscode-languageserver-types/main.js';
8
+ import * as poli from './fillers/polyfills.js';
9
+ poli.polyfill();
8
10
  var HTMLWorker = /** @class */ (function () {
9
11
  function HTMLWorker(ctx, createData) {
10
12
  this._ctx = ctx;
@@ -77,7 +77,7 @@ var DiagnosticsAdapter = /** @class */ (function () {
77
77
  return worker.doValidation(resource.toString()).then(function (diagnostics) {
78
78
  var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); });
79
79
  var model = monaco.editor.getModel(resource);
80
- if (model.getModeId() === languageId) {
80
+ if (model && model.getModeId() === languageId) {
81
81
  monaco.editor.setModelMarkers(model, languageId, markers);
82
82
  }
83
83
  });
@@ -2045,14 +2045,14 @@ define("vs/language/typescript/monaco.contribution",["require","exports","vs/edi
2045
2045
  define("vs/language/css/monaco.contribution",["require","exports","vs/editor/editor.api"],function(o,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=monaco.Emitter,n=function(){function e(e,n){this._onDidChange=new t,this._languageId=e,this.setDiagnosticsOptions(n)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!0,configurable:!0}),e.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},e}(),i={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"}},r=new(e.LanguageServiceDefaultsImpl=n)("css",i),s=new n("scss",i),a=new n("less",i);function u(){return new Promise(function(e,n){o(["./cssMode"],e,n)})}monaco.languages.css={cssDefaults:r,lessDefaults:a,scssDefaults:s},monaco.languages.onLanguage("less",function(){u().then(function(e){return e.setupMode(a)})}),monaco.languages.onLanguage("scss",function(){u().then(function(e){return e.setupMode(s)})}),monaco.languages.onLanguage("css",function(){u().then(function(e){return e.setupMode(r)})})});
2046
2046
  /*!-----------------------------------------------------------------------------
2047
2047
  * Copyright (c) Microsoft Corporation. All rights reserved.
2048
- * monaco-json version: 2.5.0(d9372e494455263f6e92265cc27bdd615e597e6f)
2048
+ * monaco-json version: 2.5.1(b4d1a1e6b28e15a0f913a6ed6f733af32cd67470)
2049
2049
  * Released under the MIT license
2050
2050
  * https://github.com/Microsoft/monaco-json/blob/master/LICENSE.md
2051
2051
  *-----------------------------------------------------------------------------*/
2052
2052
  define("vs/language/json/monaco.contribution",["require","exports","vs/editor/editor.api"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=monaco.Emitter,n=function(){function e(e,n){this._onDidChange=new o,this._languageId=e,this.setDiagnosticsOptions(n)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!0,configurable:!0}),e.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},e}(),i=new(e.LanguageServiceDefaultsImpl=n)("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1});monaco.languages.json={jsonDefaults:i},monaco.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc"],aliases:["JSON","json"],mimetypes:["application/json"]}),monaco.languages.onLanguage("json",function(){new Promise(function(e,n){t(["./jsonMode"],e,n)}).then(function(e){return e.setupMode(i)})})});
2053
2053
  /*!-----------------------------------------------------------------------------
2054
2054
  * Copyright (c) Microsoft Corporation. All rights reserved.
2055
- * monaco-html version: 2.5.0(7df6821309bcfbb236e3b749e6308a2fff72b46c)
2055
+ * monaco-html version: 2.5.1(22c0d87c2360bcfd43c81508bc230815dc86fb4d)
2056
2056
  * Released under the MIT license
2057
2057
  * https://github.com/Microsoft/monaco-html/blob/master/LICENSE.md
2058
2058
  *-----------------------------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-html version: 2.5.0(7df6821309bcfbb236e3b749e6308a2fff72b46c)
3
+ * monaco-html version: 2.5.1(22c0d87c2360bcfd43c81508bc230815dc86fb4d)
4
4
  * Released under the MIT license
5
5
  * https://github.com/Microsoft/monaco-html/blob/master/LICENSE.md
6
6
  *-----------------------------------------------------------------------------*/