Adds a new checkbox setting for automatically formatting the code upon compilation request. I added a note in the setting text indicating that it only runs for languages that have a formatter set up.
* Adds more behaviours for Ctrl-S'ing an editor
It keeps backwards compatibility with the old setting
Fixes#3266
* Fix quotes
The new Node version did not run the commit checks
* Update static/panes/editor.js
Co-authored-by: Mats Larsen <me@supergrecko.com>
Co-authored-by: Mats Larsen <me@supergrecko.com>
* Rename static/libs-widget-ext.js to static/libs-widget-ext.ts
* Initial Typescript copy&paste
* File now compiles its TS
* First TSfy pass
Types need to still be sorted out, but this now compiles and works
:)
* Further work towards porting libs widget to TS
* Expand the scope of the PR and fix some TS issues elsewhere
Still releated to libs though
* Renames
* Address PR review
* Fixes some minor errors and finishes the tests
* Remove unused interface properties
As suggested by partouf in the PR
* Remove unused this
Noticed by Partouf in the PR review
* Remove more unused options interface properties
* Fixes last issues with the ts libs widget
* Remove console.log
Refactors the handler for the AsmDocs API to reduce code duplication.
**Breaking changes proposed**
- API will now return 404. This used to return 200 with "Unknown opcode" which is what led to issue #3117. Following cases has been changed:
1. archiecture was not found
2. instruction opcode was not found
- API will now return 406 not acceptable when the accepted content type is not text or json
- There is no longer a `result` field on a 200 request, instead the assembly documentation object is returned.
- There is no longer a `found` field on any request, the HTTP codes indicate whether it was found or not (200 means found)
**New features**
- The frontend will only request the opcode for an instruction set at most once, caching every single outgoing request.
- The "There was an error fetching the documentation for this opcode" has been adjusted to contain what went wrong.
Relevant tests have been added and updated.
Small refactoring for handling -Zunpretty calls:
- reuse options from main compiler invocation instead of crafting new ones.
- factor out common part.
Now also handles HIR output in a dedicated pane.
Still a lot of copy/pasting from the macro expansion.
fixes#2567
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
* 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