Skip to content

Commit 426e7be

Browse files
committed
Fix loading of mode-rust.js
The reason the ACE editor was failing to load the rust syntax highlighting is because the syntax highlighting was being created *after* the editor was created. If the editor is created first, then ACE tries to load `ace/mode/rust`. Since it isn't already defined, it tried to compute the URL and load it manually. However, since the URLs now have a hash in it (via rust-lang#1368), it was unable to load. The solution here is to make sure `ace/mode/rust` is defined before creating the editors. Then ACE knows that it can just load the module directly instead of trying to fetch it from the server. Fixes rust-lang#2700
1 parent 564c80b commit 426e7be

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/front-end/templates/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@
297297

298298
{{#if playground_js}}
299299
<script src="{{ resource "ace.js" }}"></script>
300-
<script src="{{ resource "editor.js" }}"></script>
301300
<script src="{{ resource "mode-rust.js" }}"></script>
301+
<script src="{{ resource "editor.js" }}"></script>
302302
<script src="{{ resource "theme-dawn.js" }}"></script>
303303
<script src="{{ resource "theme-tomorrow_night.js" }}"></script>
304304
{{/if}}

tests/gui/move-between-pages.goml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// This tests pressing the left and right arrows moving to previous and next page.
22

3-
// We disable the requests checks because `mode-rust.js` is not found.
4-
fail-on-request-error: false
5-
63
go-to: |DOC_PATH| + "index.html"
74

85
// default page is the first numbered page

0 commit comments

Comments
 (0)