Skip to content

Commit

Permalink
🐛 Fix regression with custom script typings: they were not loaded on …
Browse files Browse the repository at this point in the history
…project load
  • Loading branch information
CosmoMyzrailGorynych committed Aug 9, 2020
1 parent dd4d70a commit f1d62ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/js/loadProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@
document.title = global.currentProject.settings.title + ' — ct.js';
}

glob.scriptTypings = {};
for (const script of global.currentProject.scripts) {
glob.scriptTypings[script.name] = [
monaco.languages.typescript.javascriptDefaults.addExtraLib(script.code),
monaco.languages.typescript.typescriptDefaults.addExtraLib(script.code)
];
}

const {loadAllTypedefs, resetTypedefs} = require('./data/node_requires/resources/modules/typedefs');
resetTypedefs();
loadAllTypedefs();
Expand Down
7 changes: 0 additions & 7 deletions src/riotTags/project-settings/scripts-setttings.tag
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ scripts-settings
this.currentProject.scripts = this.currentProject.scripts || [];

const glob = require('./data/node_requires/glob');
glob.scriptTypings = glob.scriptTypings || {};
for (const script of global.currentProject.scripts) {
glob.scriptTypings[script.name] = [
monaco.languages.typescript.javascriptDefaults.addExtraLib(script.code),
monaco.languages.typescript.typescriptDefaults.addExtraLib(script.code)
];
}

this.addNewScript = () => {
var script = {
Expand Down

0 comments on commit f1d62ab

Please sign in to comment.