Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved from Ace editor to Monaco editor #84

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,12 @@ out/
# Generated file
js/
files/
lib/_npm/
lib/_npm
*.pyc
.serve_files_secret
\.DS_Store
playground/*.js*
playground/*.js*

# this SHOULD keep critical files ... but it doesn't for some reason
!lib/_npm/vs
!lib/_npm/monaco
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, what are you doing here, and what are these "critical files"? If I'm not mistaken, the very idea is that lib/_npm should be populated during project build, and not kept in this repo.

2 changes: 1 addition & 1 deletion Playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body>
<script>
loader.paths = {
"yamljs": "lib/_npm/yamljs/yaml",
"yamljs": "lib/_npm/js-yaml/js-yaml",
GreyCat marked this conversation as resolved.
Show resolved Hide resolved
"KaitaiStream": "lib/_npm/kaitai-struct/KaitaiStream",
"kaitai-struct-compiler": "lib/_npm/kaitai-struct-compiler/kaitai-struct-compiler"
};
Expand Down
23 changes: 21 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<link rel="stylesheet" type="text/css" href="lib/_npm/font-awesome/css/font-awesome.min.css" />

<script src="lib/_npm/requirejs/require.js"></script>

<script src="lib/_npm/jquery/jquery.min.js"></script>
<script src="lib/_npm/bootstrap/js/bootstrap.min.js"></script>
<script src="lib/_npm/yamljs/yaml.js"></script>
<script src="lib/_npm/ace/ace.js"></script>
<script src="lib/_npm/monaco/loader.js"></script>

<script src="js/autorefresh.js"></script>
<script src="js/extensions.js"></script>
Expand All @@ -37,9 +37,28 @@
["bowser", "jstree", "localforage", "goldenlayout", "vue", "kaitai-struct-compiler", "dateformat"].forEach(
name => paths[name] = `../../lib/_npm/${name}/${name}`);
paths["big-integer"] = "../../lib/_npm/BigInteger/BigInteger";
paths["vs"] = "../../lib/_npm/monaco";

requirejs.config({ baseUrl: "js/v1/", paths: paths });
require(["app.unsupportedBrowser"]);
require(["../../lib/_npm/js-yaml/js-yaml"], (YAML) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if require.js can be dropped and ECMAScript modules used instead.

window.YAML = YAML;
});
require(["vs/editor/editor.main"], () => {
require(["vs/language/yaml/monaco.contribution", "vs/language/yaml/ksySchema"], () => {
monaco.languages.yaml.yamlDefaults.setDiagnosticsOptions({
enableSchemaRequest: true,
validate: true,
schemas: [
{
uri: `http://myserver/ksy-schema.json`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fileMatch: [monaco.Uri.parse("inmemory://model/main").toString()],
schema: ksySchema
}
]
});
})
});
require(["jstree", "app"]);
</script>
</head>
Expand Down
143 changes: 143 additions & 0 deletions lib/PUT THESE IN _npm/monaco/base/worker/workerMain.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions lib/PUT THESE IN _npm/monaco/basic-languages/apex/apex.js

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

7 changes: 7 additions & 0 deletions lib/PUT THESE IN _npm/monaco/basic-languages/azcli/azcli.js

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

7 changes: 7 additions & 0 deletions lib/PUT THESE IN _npm/monaco/basic-languages/bat/bat.js

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

Loading