-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Initial commit for replacing ace with monaco editor * WIP- Remove ace from TextEditor * WIP- Integrate vim keybindings * Ensure editor hasn't been destroyed while loading vim keybindings * Remove dummy python code for '' * WIP- Add support for additional themes * WIP- Fix eslint issues, remove unused functions in LogViewerWidget * WIP- Fix more eslint and code climate fixes * WIP- Fix model dispose problem by disposing editor only * WIP-Remove console.log statement from TextEditorWidget.js Co-authored-by: Brian Broll <[email protected]>
- Loading branch information
1 parent
c97136f
commit a700a9e
Showing
1,057 changed files
with
14,797 additions
and
314,908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"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": "#" | ||
}, | ||
"plaintext": { | ||
"id": "plaintext", | ||
"extensions": [ | ||
"txt", | ||
"text" | ||
], | ||
"aliases": [ | ||
"text", | ||
"PLAINTEXT" | ||
], | ||
"mimetypes": [ | ||
"application/text" | ||
], | ||
"comment": "#" | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/visualizers/widgets/TextEditor/MonacoThemesProvider.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* globals monaco, define */ | ||
|
||
define(['text!./Themes/themelist.json'], function (ThemeList) { | ||
const DEFAULT_THEMES = ['vs-dark', 'vs', 'hc-black']; | ||
ThemeList = JSON.parse(ThemeList); | ||
|
||
class MonacoThemesProvider { | ||
constructor() { | ||
this.importedThemes = DEFAULT_THEMES; | ||
this.themes = DEFAULT_THEMES.concat(Object.keys(ThemeList)); | ||
} | ||
|
||
async setTheme(theme) { | ||
if (this.importedThemes.includes(theme)){ | ||
monaco.editor.setTheme(theme); | ||
} else if (this.themes.includes(theme)){ | ||
const themeData = await this._importTheme(theme); | ||
monaco.editor.defineTheme(theme, themeData); | ||
monaco.editor.setTheme(theme); | ||
} else { | ||
monaco.editor.setTheme(DEFAULT_THEMES[0]); | ||
} | ||
} | ||
|
||
async _importTheme(theme) { | ||
return new Promise((resolve, reject) => { | ||
const importName = `text!widgets/TextEditor/Themes/${(ThemeList[theme])}.json`; | ||
require([importName], (themeJSON) => { | ||
resolve(JSON.parse(themeJSON)); | ||
}, reject); | ||
}); | ||
} | ||
} | ||
|
||
return MonacoThemesProvider; | ||
}); |
Oops, something went wrong.