Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1fe3c9e
Initial commit for replacing ace with monaco editor
umesh-timalsina Jul 22, 2020
4ca2c63
WIP- Remove ace from TextEditor
umesh-timalsina Jul 22, 2020
9a3c5c8
Merge remote-tracking branch 'origin/master' into 571-monaco-text-editor
umesh-timalsina Jul 28, 2020
d1a0513
Merge remote-tracking branch 'origin/master' into 571-monaco-text-editor
umesh-timalsina Aug 6, 2020
55194d7
Merge remote-tracking branch 'origin/master' into 571-monaco-text-editor
umesh-timalsina Aug 10, 2020
e96cbcf
WIP- Integrate vim keybindings
umesh-timalsina Aug 10, 2020
c0cfa6e
Merge remote-tracking branch 'origin/master' into 571-monaco-text-editor
umesh-timalsina Aug 17, 2020
ebaed91
Merge remote-tracking branch 'origin/master' into 571-monaco-text-editor
umesh-timalsina Aug 25, 2020
e43a7d4
Merge branch 'master' into 571-monaco-text-editor
brollb Sep 9, 2020
510ea50
Ensure editor hasn't been destroyed while loading vim keybindings
brollb Sep 9, 2020
4f48e92
Remove dummy python code for ''
brollb Sep 9, 2020
b98dd98
Merge remote-tracking branch 'origin/master' into 571-monaco-text-editor
umesh-timalsina Sep 9, 2020
4fe19be
Merge remote-tracking branch 'origin/571-monaco-text-editor' into 571…
umesh-timalsina Sep 9, 2020
38d040d
WIP- Add support for additional themes
umesh-timalsina Sep 9, 2020
c0fcb27
WIP- Fix eslint issues, remove unused functions in LogViewerWidget
umesh-timalsina Sep 9, 2020
f59eede
WIP- Fix more eslint and code climate fixes
umesh-timalsina Sep 9, 2020
078de16
WIP- Fix model dispose problem by disposing editor only
umesh-timalsina Sep 16, 2020
bcc5244
WIP-Remove console.log statement from TextEditorWidget.js
umesh-timalsina Sep 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ config.blob.fsDir = process.env.DEEPFORGE_BLOB_DIR || config.blob.fsDir;

config.requirejsPaths.deepforge = './src/common';
config.requirejsPaths['aws-sdk-min'] = './node_modules/aws-sdk/dist/aws-sdk.min';
config.requirejsPaths.ace = './src/visualizers/widgets/TextEditor/lib/ace';
config.requirejsPaths.vs = './node_modules/monaco-editor/min/vs';
config.seedProjects.defaultProject = 'project';

config.plugin.allowBrowserExecution = true;
Expand Down
9 changes: 7 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"lodash.merge": "^4.5.1",
"lodash.template": "^4.4.0",
"minimatch": "^3.0.4",
"monaco-editor": "^0.20.0",
"mongodb": "^2.2.10",
"node-fetch": "^2.6.0",
"pacote": "^11.1.10",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*globals define */
/*globals define, monaco*/
/*jshint browser: true*/

define([
Expand All @@ -18,13 +18,12 @@ define([
TextEditorWidget.call(this, logger, container);
this.lineOffset = 0;
// Add the shift-enter command
this.editor.commands.addCommand({
name: 'executeOrStopJob',
bindKey: {
mac: 'Shift-Enter',
win: 'Shift-Enter'
},
exec: () => this.executeOrStopJob()
this.editor.addCommand(
monaco.KeyMod.Shift | monaco.KeyCode.Enter,
this.executeOrStopJob
);
this.editor.updateOptions({
lineNumbers: this.updateOffset.bind(this)
});
};

Expand All @@ -50,40 +49,16 @@ define([
OperationCodeEditorWidget.prototype.setLineOffset = function (offset) {
if (this.lineOffset !== offset) {
this.lineOffset = offset;
this.updateOffset();
}
};

OperationCodeEditorWidget.prototype.updateOffset = function () {
OperationCodeEditorWidget.prototype.updateOffset = function (originalLineNumber) {
var lines,
actualOffset;

lines = this.currentHeader.match(/\n/g);
actualOffset = this.lineOffset - (lines ? lines.length : 0);
this.editor.setOption('firstLineNumber', actualOffset);
};

OperationCodeEditorWidget.prototype.getCompleter = function () {
var completer = TextEditorWidget.prototype.getCompleter.call(this),
getBasicCompletions = completer.getCompletionsFor,
self = this;

// TODO: update completions for python stuff
completer.getCompletionsFor = function(obj) {
if (obj === 'attributes') {
return self.getOperationAttributes().map(attr => {
return {
name: attr,
value: attr,
score: 4,
meta: 'operation'
};
});
} else {
return getBasicCompletions.apply(this, arguments);
}
};
return completer;
actualOffset = this.lineOffset - (lines ? lines.length + 1 : 0);
return (originalLineNumber + actualOffset);
};

return OperationCodeEditorWidget;
Expand Down
45 changes: 45 additions & 0 deletions src/visualizers/widgets/TextEditor/MonacoLanguages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"python": {
"id": "python",
"extensions": [
".py",
".pyc"
],
"aliases": [
"py",
"PY"
],
"mimetypes": [
"application/text"
],
"comment": "#"
},
"javascript": {
"id": "javascript",
"extensions": [
"js",
"jsx"
],
"mimetypes": [
"application/text"
],
"comment": "//"
},
"yaml": {
"id": "yaml",
"extensions": [
"yaml",
"yml"
],
"aliases": [
"yml",
"yaml",
"YML",
"YAML"
],
"mimetypes": [
"application/text"
],
"comment": "#"
}
}
Loading