* Fix loading a project
Chrome DevTools suggest that `.map()` does not exist here. I think that the right one is `.forEach()`.
https://stuk.github.io/jszip/documentation/api_jszip/for_each.html
* Remove `Promise.all()`
`zip.forEach()` does not return a value, hence waiting on it does not make sense.
This change allows for only dumping a single pass (the one selected). In order
to populate the list of available dumps, it now queries GCC for the enabled
passes.
It can still be misleading to users as a pass can be enabled but for some reason
does not dump anything. In order to avoid this, the only solution seems to be to
still dump all files and filter the list... This defeats the initial goal and
only adds complexity for the current compilers.
But this makes #2868 easier to implement (see #2985 that was a aborted first
attempt) and if someday another libgccjit-based compiler is added, it could be
easily hooked to this.
It also changes the naming in the drop down menu. For example, instead of :
'009t.omplower' it now uses 'omplower (tree)' (ie.
'<pass-name> (tree|ipa|rtl)').
Fixes#3014
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
The formatter-registry will now use the site settings when querying the Format API. For compilers that do not support multiple styles, __DefeaultStyle is passed.
* Await for things
We had a number of things that aren't await()ing their promises.
That led to non-deterministic compiler settings like Intel support.
I used the IDE to find them all and fix the ones that I thought looked
important.
More generally we should use tslint (once we're all typescript) to
ensure this more generally. I tried the eslint equivalent but it
either overreacted or didn't catch anything.
Closes#3085
This is a refactor for core methods of the Pane API. In this patch:
1. Rename initializeDOMRoot to getInitialHTML() - This logic is common for all of the panes. Returning the HTML is more type-safe and makes the method pure.
2. Make createEditor return the monaco editor - Allows us to set the editor in the constructor. Returning the editor is more type-safe and makes the method pure.
3. Rename id parameters to compilerId in onCompileResult, onCompiler and onCompilerClose - It's not easy to tell what these ids were, this makes it easier to understand what we're using here.
4. Type compiler, options and result as unkown in onCompiler, onCompileResult - These parameters don't have types at the moment, so it's safer for implementors to manually override and type as any/whichever type they wish.
5. Add plenty of code documentation to onCompiler and onCompileResult
This change only gets the GNAT Debug expanded generated code (-gnatD).
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Co-authored-by: Mats Larsen <me@supergrecko.com>
Fetch is a modern, promise-based API for sending HTTP requests from the browser (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
This patch introduces whatwg-fetch as the polyfill for fetch, as well as installing it inside the main script.
Decouples the individual initial pane states for each pane from the BasePaneState type.
This will allow easier re-use of the state the various constructors receive
Non-functional change.
When `files` is unspecified `input` defaults to `**/*`.
This pattern still only matches valid typescript extensions.
When `outDir` is specified it is implicitly added to `exclude`,
which takes priority over `include` and breaks the build.
Co-authored-by: Matt Godbolt <matt@godbolt.org>
The pane would still show <no output> for unsupported compiler.
Let the onCompiler callback correctly write the message in case the compiler is
not supported.
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
This will convert static/colour.js to typescript (see #2981)
Changes are pretty much the same as with the other conversions I did.
Assumed that param colours in applyColours is of type number[] as this is the only fitting type.
Signed-off-by: Markus <28785953+MarkusJx@users.noreply.github.com>
Site settings for tab width and tabs vs spaces are now being used when sent to the /api/format APIs.
This patch also includes some tiny internal refactoring on the bits related to the formatting API.