From d8917f33fd7d32141d895fb7de530cfee2a416cf Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 28 Jun 2018 00:31:24 +0400 Subject: [PATCH] fix small regressions caused by ace update --- plugins/c9.ide.collab/chat/chat.js | 1 + plugins/c9.ide.immediate/style.css | 4 ++ plugins/c9.ide.layout.classic/layout.js | 2 +- plugins/c9.ide.run.debug/callstack.js | 14 ++++-- plugins/c9.ide.run.debug/watches.js | 2 + plugins/c9.ide.terminal/style.css | 6 ++- plugins/c9.ide.terminal/terminal.js | 13 +++-- plugins/c9.vfs.standalone/standalone.js | 2 +- .../ace_tree/lib/ace_tree/edit.js | 2 +- .../node_modules/architect-build/transform.js | 47 ++++++++++--------- 10 files changed, 57 insertions(+), 36 deletions(-) diff --git a/plugins/c9.ide.collab/chat/chat.js b/plugins/c9.ide.collab/chat/chat.js index 5fec1315..2d400a14 100644 --- a/plugins/c9.ide.collab/chat/chat.js +++ b/plugins/c9.ide.collab/chat/chat.js @@ -89,6 +89,7 @@ define(function(require, exports, module) { minLines: 2, fontFamily: "inherit" }); + chatInput.ace.session.$enableVarChar = true; chatInput.ace.session.$setFontMetrics(chatInput.ace.renderer.$fontMetrics); plugin.addElement(chatInput); diff --git a/plugins/c9.ide.immediate/style.css b/plugins/c9.ide.immediate/style.css index bb7d9cff..03961789 100644 --- a/plugins/c9.ide.immediate/style.css +++ b/plugins/c9.ide.immediate/style.css @@ -143,6 +143,10 @@ .ace_lineWidgetContainer:after{ background: transparent; } +.ace_lineWidgetContainer { + z-index: 5; + position: absolute; +} /* ace_dark */ diff --git a/plugins/c9.ide.layout.classic/layout.js b/plugins/c9.ide.layout.classic/layout.js index 5d5ec6bb..6e18e0a2 100644 --- a/plugins/c9.ide.layout.classic/layout.js +++ b/plugins/c9.ide.layout.classic/layout.js @@ -483,7 +483,7 @@ define(function(require, exports, module) { return callback(); anims.animateSplitBoxNode(amlNode, { - height: amlNode.$ext.scrollHeight + "px", + height: amlNode.$ext.offsetHeight + "px", duration: 0.2, timingFunction: "cubic-bezier(.10, .10, .25, .90)" }, function() { diff --git a/plugins/c9.ide.run.debug/callstack.js b/plugins/c9.ide.run.debug/callstack.js index 8398ecfd..d46d1736 100644 --- a/plugins/c9.ide.run.debug/callstack.js +++ b/plugins/c9.ide.run.debug/callstack.js @@ -39,7 +39,7 @@ define(function(require, exports, module) { var sources = []; var frames = []; - var activeFrame, dbg, menu, button, lastException; + var activeFrame, dbg, menu, button, lastException, sourceListTimer; var loaded = false; function load() { @@ -578,7 +578,7 @@ define(function(require, exports, module) { function loadSources(input) { sources = input; - modelSources.setRoot(sources); + updateSourceTree(); } function clearFrames() { @@ -587,7 +587,15 @@ define(function(require, exports, module) { function addSource(source) { sources.push(source); - modelSources.setRoot(sources); + updateSourceTree(); + } + + function updateSourceTree() { + if (sourceListTimer) return; + sourceListTimer = setTimeout(function() { + sourceListTimer = null; + modelSources.setRoot(sources); + }, 100); } function updateAll() { diff --git a/plugins/c9.ide.run.debug/watches.js b/plugins/c9.ide.run.debug/watches.js index 2ea4d7e5..1802d2f3 100644 --- a/plugins/c9.ide.run.debug/watches.js +++ b/plugins/c9.ide.run.debug/watches.js @@ -100,6 +100,8 @@ define(function(require, exports, module) { updateAll(); }); debug.on("exception", function(e) { + if (errorWatch) + removeWatch(errorWatch); errorWatch = e.exception; addWatch(errorWatch); model.expand(errorWatch); diff --git a/plugins/c9.ide.terminal/style.css b/plugins/c9.ide.terminal/style.css index 1d5a2c84..af9b5058 100644 --- a/plugins/c9.ide.terminal/style.css +++ b/plugins/c9.ide.terminal/style.css @@ -103,4 +103,8 @@ .c9terminalcontainer .cover-link:hover { opacity: 1; text-decoration: underline; -} \ No newline at end of file +} + +.terminal > .ace_line { + contain: style size layout!important; +} diff --git a/plugins/c9.ide.terminal/terminal.js b/plugins/c9.ide.terminal/terminal.js index 6544af1a..d79e7154 100644 --- a/plugins/c9.ide.terminal/terminal.js +++ b/plugins/c9.ide.terminal/terminal.js @@ -668,13 +668,12 @@ define(function(require, exports, module) { var screenBottom = config.height - coverHeight + config.offset + 2; var screenRight = (cols - this.width) * config.characterWidth; - html.push("
", - "
", - "
" - ); + markerLayer.elt("c9terminalcontainer cover bottom", + "height:" + coverHeight + "px;" + "left:0; right: " + screenRight + "px; top:" + screenBottom + "px;"); + markerLayer.elt("c9terminalcontainer cover right", + "width:" + screenRight + "px; height: " + screenBottom + "px; top:0; right:0;"); + markerLayer.elt("c9terminalcontainer cover", + "width:" + screenRight + "px; bottom:0; top:" + screenBottom + "px; right:0;"); }; aceSession.addDynamicMarker(marker, true); aceSession.term.tmuxDotCover = marker; diff --git a/plugins/c9.vfs.standalone/standalone.js b/plugins/c9.vfs.standalone/standalone.js index c0110683..acb03690 100644 --- a/plugins/c9.vfs.standalone/standalone.js +++ b/plugins/c9.vfs.standalone/standalone.js @@ -227,7 +227,7 @@ function plugin(options, imports, register) { var base = __dirname + "/../../"; var blacklistfile = base + "/test/blacklist.txt"; var filefinder = require(base + "/test/lib/filefinder.js"); - filefinder.find(base, "plugins", ".*_test.js", blacklistfile, function(err, result) { + filefinder.find(base, "plugins", ".*_test.(js|ts)", blacklistfile, function(err, result) { result.all = result.list.concat(result.blacklist); async.filterSeries(result.list, function(path, next) { fs.readFile(base + path, "utf8", function(err, file) { diff --git a/plugins/node_modules/ace_tree/lib/ace_tree/edit.js b/plugins/node_modules/ace_tree/lib/ace_tree/edit.js index f8f24452..8c258655 100644 --- a/plugins/node_modules/ace_tree/lib/ace_tree/edit.js +++ b/plugins/node_modules/ace_tree/lib/ace_tree/edit.js @@ -145,7 +145,7 @@ var EditableTree = function(tree) { tree.renderer.fontMetrics = new FontMetrics(tree.renderer.container); } tree.renderer.fontMetrics.checkForSizeChanges(); - + editor.session.$enableVarChar = true; editor.session.$setFontMetrics(tree.renderer.fontMetrics); return editor; diff --git a/plugins/node_modules/architect-build/transform.js b/plugins/node_modules/architect-build/transform.js index 74979551..6d645049 100644 --- a/plugins/node_modules/architect-build/transform.js +++ b/plugins/node_modules/architect-build/transform.js @@ -10,19 +10,7 @@ exports.transform = function(code, options) { code = "define(function(require, exports, module) {" + code + "\n})"; } - if (options.mode == "babel") { - var babel = require("babel"); - return babel.transform(code, { - "presets": [ - ["env", { - "targets": { - "browsers": ["last 2 versions", "ie >= 11"] - } - }] - ] - }).code; - } - else if (options.mode == "ts" || options.mode == "es5") { + if (options.mode == "ts" || options.mode == "es5") { var ts = require("typescript"); return ts.transpileModule(code, { compilerOptions: { @@ -30,13 +18,13 @@ exports.transform = function(code, options) { suppressExcessPropertyErrors: true, removeComments: true, newLine: "lf", - module: ts.ModuleKind.CommonJS - } + module: ts.ModuleKind.CommonJS, + sourceMap: !!options.srcPath, + inlineSourceMap: true + }, + fileName: options.srcPath }).outputText; } - else if (options.mode == "buble") { - return require("buble").transform(code).code; - } return code; }; @@ -47,14 +35,28 @@ exports.sendFile = function(req, res, next) { var transform = req.params.transform; var filePath = moduleDeps.resolveModulePath(path, req.pathConfig.pathMap); - if (!/\.js$/.test(filePath) || /(browserified|\.min|test\d)\.js$/.test(filePath)) { + if (!/\.(js|ts)$/.test(filePath) || /(browserified|\.min|test\d)\.js$/.test(filePath)) { return send(req, filePath.substr(req.pathConfig.root.length)) .root(req.pathConfig.root) .on('error', next) .pipe(res); } - fs.stat(filePath, function(err, stat) { + function resolvePath(callback) { + fs.stat(filePath, function(err, stat) { + if (err && err.code == "ENOENT") { + var tsPath = filePath.replace(/\.js$/, ".ts"); + if (tsPath != filePath) { + return fs.stat(tsPath, function(err, stat) { + callback(err, stat, tsPath); + }); + } + } + callback(err, stat); + }); + } + + resolvePath(function(err, stat, srcPath) { if (err) return next(err); var mtime = stat.mtime.valueOf(); var etag = 'W/"' + stat.size.toString(16) + "-" + mtime.toString(16) + '"'; @@ -72,15 +74,16 @@ exports.sendFile = function(req, res, next) { return sendResponse(cache[key].value); res.setHeader("ETag", etag); cache[key] = null; - fs.readFile(filePath, "utf8", function(err, value) { + fs.readFile(srcPath || filePath, "utf8", function(err, value) { if (err) return next(err); var t = Date.now(); try { value = exports.transform(value, { path: filePath, - mode: transform, + mode: srcPath ? "ts" : transform, amd: true, + srcPath: srcPath ? path.replace(/\.js/, ".ts") : "" }); } catch (e) { return next(e);