Commit Graph
773 Commits
Author SHA1 Message Date
narpfel ccd62cfc61 Parse terminal hyperlinks in command output (#7318)
Some compilers (such as `gcc` and `rustc`) support emitting hyperlinks
to the documentation for error messages and/or warnings. This PR adds a
parser for the respective `OSC 8` ANSI escape sequence (see
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) and
makes them clickable in the output window.

For example: https://godbolt.org/z/o1v7WzPc6

For GCC, this would make `-Wreturn-type` a clickable link to
https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wno-return-type.

For Rust, this would make `E0425` a clickable link to
https://doc.rust-lang.org/error_codes/E0425.html.

Note that this also applies to execution output. A malicious program
could (when executed) produce output that contains clickable links to
anything.

Related feature requests:
* #5284 for `rustc` (`-Z terminal-urls=yes`)
* #7310 for `gcc` (`-fdiagnostics-urls=always`)
2025-01-29 10:46:17 -06:00
Ofek 97b5735c21 Opt-remarks for gcc (#7230)
![gccoptrem](https://github.com/user-attachments/assets/4662c5d1-3a4e-443b-a989-bc4dc109e90b)
2024-12-20 10:19:33 +02:00
Matt Godbolt 02951a20db Unify types for tool args (#7199)
- Uses strings across the board in the UI part (no functional change
here from before; all state is the same as it was before).
- Sends _arrays_ in the POST, using the same `splitArguments` code as
the backend.
- Backend _still supports_ strings (though doesn't advertise), also
using same `splitArguments`.
- Moves `splitArguments` into common utils, and rephrases to avoid
unnecessary use of underscore and ES2021+ code.

Tested locally:
- with both old and new client code (ran new backend and old webcode to
show sending strings still works)
- with creating and removing tool windows (checked with `ldd` locally)
- with various strings on the client `moo foo "this is bad" #moo` and
even "error" things like `this is "badger` (with a missing close quote).
All works as you'd expect

Happy to break the "move the splitArguments" code into a separate PR if
that'd be easier to review separately.

Fixes #7195
2024-12-07 14:44:42 -06:00
Ofek b75542bfac Fix #3264: move emitShortLinkEvent from editor-pane to main window (#7163)
When settings are set to emit-short-link upon ctrl+S, managing the logic
in `Editor` is problematic since the editor may lose focus and not
receive the event.

Also logically this is a cross-site event, and doesn't belong in any
particular editor (there can be multiple).
2024-12-02 10:41:12 +02:00
Partouf 99de0f1dac hotfix diff view 2024-11-28 10:03:19 +01:00
Ofek 20b8ccaa6f Remove ICompiler, other minor type fixes (#7079) 2024-11-25 18:36:20 +02:00
Ofek 4399adc523 Some minor additions to frontend typing (#7082) 2024-11-14 17:07:51 +02:00
Ofek 717c9173ad Unify OptCodeEntry and LLVMOptInfo (#7077) 2024-11-14 13:05:26 +02:00
Partouf ea382a8aed fix #7083 2024-11-11 16:53:07 +01:00
Patrick Quist 29b9fe406d Bugfix Unknown file (#7072) 2024-11-08 17:54:43 +01:00
Patrick Quist 6f97ab5518 Close button fix (#7050) 2024-11-08 16:25:55 +01:00
Sirui Mu a6ca0fed18 Add ClangIR compilation options (#6914)
This patch adds two options to the clangir pane that affects the clangir
compilation pipeline:

* Flat CIR enables the emission of flat clangir CFG;
* -fclangir-mem2reg enables the mem2reg pass on the flat clangir CFG.
2024-11-02 10:53:33 +02:00
OfekandMats Jun 679b908c39 Tooltips for llvm opt output (#7036)
This does fix #7019, but unfortunately in IR lines like -
```
  %2 = mul nsw i32 %0, %0
```
Monaco assigns both the `mul` and `nsw` tokens with type
'operators.llvm-ir' (handled as asm keyword by this PR) and requests the
backend for their docs. Only `mul` is an actual documented keyword -
`nsw` is just a modifier and the request fails with errors like `GET
http://localhost:10240/api/asm/llvm/nsw 404 (Not Found)` thrown at
[getAssemblyDocumentation](https://github.com/compiler-explorer/compiler-explorer/blob/63dd5e35a5856bcd1670b7b1cf21ffd854928ef7/static/api/api.ts#L50-L51).

This draft PR is meant for discussion. Would it be enough eg to wrap the
request in `getAssemblyDocumentation` in a try-catch? Maybe the right
thing to do would be to intervene in the monarch parsing for llvm-ir?
Other ideas that I'm missing?

---------

Co-authored-by: Mats Jun <mats@jun.codes>
2024-10-28 19:41:38 +09:00
narpfel 01a873ab27 Reintroduce [already open] for “new tool” buttons (#7035)
Fixing the merge conflicts in #6974 accidentally removed the
`new-pane-button` class from the buttons in the “Add tool...” menu from
#7002:

https://github.com/compiler-explorer/compiler-explorer/pull/6974/files#diff-40ca496bc7fcf6c9bcd41d530708fe3a7bcc5f58cd9bad27ab919b5033f557deL2695-L2696

See https://godbolt.org/z/fd7v8zfE5 (click on “Add tool...”, `ldd` is
disabled but does say `[already open]`).

This PR reintroduces that change. However, the implementation in #7002
would also show `[already open]` for the “No tools available” button if
there are no tools. In this PR, the `new-pane-button` class is only
added to the “real” new tool buttons.
2024-10-28 16:43:31 +09:00
Ofek b6386887a8 Make 'new source editor' preserve the origin language (#7031)
When doing 'Add new...'/'Source editor' from, e.g., a Rust editor - open
a new Rust editor and not a C++ one.


![image](https://github.com/user-attachments/assets/861c53bc-fb1e-44c0-ac23-09d2ac839bdb)
2024-10-27 11:06:51 +02:00
Ofek a0fe0e3d4f In diff view, protect against undefined asm (case of a failed build) (#7030)
Fixes #7029
2024-10-27 09:20:31 +02:00
Ofek ab4b662ee0 Extra safety around executeParameters.args (#7028)
Hopefully fixes #7027
2024-10-27 09:09:44 +02:00
Patrick Quist 4fe8397fac Remote execution (#6700) 2024-10-26 17:42:22 +02:00
Ofek 648795d0f5 Unify CompileChildLibraries and SelectedVersionLibraries (#7022) 2024-10-26 15:53:27 +03:00
Ofek c312beae24 TSify StackUsage and others (#7021) 2024-10-26 11:35:35 +03:00
Ofek 4e5348ab77 Tsify tools (mostly) (#7018)
This includes among others:
 - Proper tsification of various tools code,
 - Elimination of the `CompilationInfo2` type,
 - Use of `CompilationInfo` instead of `Record<any, any>` in some places
 - These lines in CompilationResult:
```
    // Temp hack until we get all code to agree on type of asm
    asm?: ResultLine[] | string;
```

The next task would be to get all code to agree on the type of
CompilationResult.asm, thereby enabling fixing of most the remaining
TSification.
2024-10-26 10:58:30 +03:00
Ofek 93133510c2 Move ToolState to component.interfaces, to avoid duplicate tool.interface.ts 2024-10-25 22:02:30 +03:00
Ofek c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +03:00
narpfel 02b574b4a9 Show that pane is already open when disabling the button to create a new pane (#7002)
When a new pane (such as the LLVM IR view) is opened using a button in
the “Add new...” or “Add tool...” menu, the button is disabled. This can
be confusing when the pane is not visible (e. g. when it is in a tab in
the background), because it can also be interpreted as “this is not
supported“.

This PR adds an `[already open]` to the button when it is disabled.
2024-10-24 21:24:54 +03:00
Ofek e98d361127 Add display for internal compiler id (#7010)
Implement #6985
2024-10-24 14:28:51 +03:00
Ofek 2df8d32758 Tsify #6 (#6941)
Another tsification batch. 347 to go and I'm running out of easy fixes
:(
2024-10-22 21:41:44 +03:00
Mats Jun 6753449778 Simplify TypeScript types for JQuery elements (#6991)
_No functional changes intended_

The existing type functions a little like this:

"Take the intersection of all common properties of all values in
HTMLElementTagNameMap"

This very much just happens to be the same as HTMLElement, since that's
the declared base for all of the types in HTMLElementTagNameMap. This
small patch simplifies this type (and makes it significantly easier to
read the code)
2024-10-22 19:33:03 +09:00
Matt Godbolt 5e4b209125 Minor bump (#6986) 2024-10-20 18:03:08 -05:00
Ofek caca3ea6c7 Eliminate all google-analytics dead code (#6954)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-10-10 21:21:43 +03:00
Ofek 9dd45914aa Tooltips for llvm ir (#6937)
The docenizer was there - just needed some updating.

There is some duplicity created between `ir-view` and `compiler` that I
hope to address in a future PR.
2024-10-07 08:37:10 +03:00
Ofek 709b1f168b First-aid for opt-pipeline on clangir 2024-10-01 11:36:57 +03:00
Ofek 7097a240a7 Introduce opt-pipeline for ClangIr (#6917)
Thank @Lancern for the CIR flags analogous to clang's
`--print-before|after-all.`


![cir](https://github.com/user-attachments/assets/78742d83-799d-40cd-bcef-7a2e69a83c54)
2024-09-30 22:11:30 -05:00
Sirui Mu a49dbc6dd7 Add ClangIR output for clangir compiler (#6798)
Currently the clangir compiler is implemented by a special clang variant
whose compilation options list gets appended with `-Xclang -fclangir
-Xclang -emit-cir`. This introduces a problem: we no longer gets access
to its LLVM IR output and assembly output because `-emit-cir` is an
exclusive option.

This patch resolves this problem by introducing a new ClangIR pane,
similar to the LLVM IR pane or Rust MIR pane. A new output kind named
`ClangIR` is added to the "Add new..." drop down menu and it toggles the
ClangIR pane. This patch then removes `-Xclang -emit-cir` from the
options list of the clangir compiler. The clangir compiler will then
output assembly code just like other clang compilers. The removed
options will be added back when compiled from the ClangIR pane.
2024-09-12 19:43:26 +03:00
Ofek 730a45c2c7 Fix #6801: handle changeLangage before selectize initialization (#6811) 2024-09-07 10:11:23 +02:00
Ofek d6f0807e9f More fixes for pane-renaming in various scenarios (#6781) 2024-08-22 11:00:00 +03:00
Ofek 09fc2c1ca4 Final (?) pane-renaming fix (#6774)
Some major-ish fixes to tree and minor fixes in multifile-service.
This hopefully fixes #6770, #5734, and maybe others.
2024-08-21 23:42:26 +03:00
Ofek d83bb38f1a add paneName fallback to filename in editor.getPaneName() (#6773) 2024-08-18 09:57:13 +03:00
Ofek 12f6bfcc12 Make pane-renaming central (#6772)
When each `Pane` (and others) create their own `PaneRenaming`, which
extends `EventEmitter.EventEmitter`, when one actor emits `renamePane`
no other actor can hear it.

This PR makes `PaneRenaming` stop using its own event emission, and
instead use the central `Hub` it now receives at its ctor.
2024-08-17 22:51:11 +03:00
narpfel 3beeef8fe3 Implement more diff types (#6730)
Add support for diffing clang ASTs, LLVM IR, and Rust HIR, MIR and macro
expansions. These new options are only shown in the picker when the
compiler supports the respective output type (e. g. when diffing `g++`
output, there will be no item to select LLVM IR).

Because the specified output must be activated manually, this PR also
adds help texts so that the user isn’t shown an empty pane. E. g. when
diffing execution stdout but “Execute the code” is not checked, the diff
viewer will show “<activate 'Output...' → 'Execute the code' in this
compiler's pane>”.

Resolves #6726.
2024-07-29 22:19:59 -05:00
Abril Rincón Blanco feb7b35754 Fix paneRenaming not affecting source editor (#6611) 2024-06-29 03:06:11 +02:00
A. Rincón Blanco f63005116f Add a way to filter opt-pipeline passes (#6570) 2024-06-16 11:06:04 +02:00
Jeremy Rifkin fad25749a8 Remember scroll position on recompile (#6605)
This is a proposed fix for #6516
2024-06-15 11:50:21 -05:00
Jeremy Rifkin 7db4a4d253 Horizontal scroll the entire execution pane (#6606)
Fixes #6210
2024-06-14 20:40:41 -05:00
Ofek f886da7241 Add 'wrap lines' toggle to ir-view (#6595)
Mostly for rust - IR line length there can be legendary.

![irwrap](https://github.com/compiler-explorer/compiler-explorer/assets/73080/1d584ea2-3911-4592-867b-01793425f3e0)
2024-06-12 20:27:44 +03:00
Ofek ca28aec7a8 Remove unused events filtersChange, requestFilters, some added types to BaseCompiler.compile (#6486)
Just some minor housekeeping.
2024-05-29 18:10:21 +02:00
Patrick Quist d2c7a5222e Local/Remote Execution environment (#6413) 2024-05-26 22:09:01 +02:00
Ofek 930ee1d4fc Fix and investigate weird exception in stack-usage-view (#6501) 2024-05-19 22:31:22 +03:00
Ofek 42533d8dbb Stop duplicating hasXXoutput + XXoutput (#6476)
When you need to check if `XXoutput` exists, check it directly.
+some TSification in CompilationResult
2024-05-14 20:11:09 +03:00
Ofek bcb397f56b Add noUnusedLocals to tsconfig + fix the new alerts (#6396)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-05-14 18:46:22 +03:00
Ofek cf358fb075 Add 'wrap lines' button to opt-view (#6477)
![wrapopt](https://github.com/compiler-explorer/compiler-explorer/assets/73080/bcd63dff-5463-4822-944d-e426165b2987)

I thought I already added it but seems I didn't.
2024-05-14 10:57:51 +03:00