2706 Commits

Author SHA1 Message Date
Matt Godbolt
e91b5d12da Comply with some MS terms (#6627)
- Ensure MSVC license terms are clearly shown to the user.
- Simplify config of vc and vcpp slightly by extracting common stuff
into a group.
- Remove reference to MS privacy policy
2024-06-19 18:09:59 -05:00
Jeremy Rifkin
f1421bbf89 Add C23 keywords to our C highlighting mode (#6604)
This PR adds new C23 keywords from
https://en.cppreference.com/w/c/keyword. I have some FUD about always
highlighting things like `bool`, since what most people think of as C is
not C23. I think ideally we'd be able to only highlight C23 keywords
when `-std=c23` is being used, but that of course makes things a good
deal more complex. But also, it probably makes sense to just go ahead
and highlight these.

Possibly related to #6568.
2024-06-19 14:30:37 -05: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
03cbf20c92 Update ansi dark colors (#6573)
This PR tweaks some of the ansi colors for dark themes. It's fairly
subtle overall, I mainly:
- Decreased brightnesses of green/cyan/yellow
- Desaturated purple/blue/red and made them a bit lighter
- Switched white to a slightly off-white

| old | new |
|---|---|
|
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/edc17a12-fb8f-44e8-8111-f771d3591df0)
|
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/b36e7244-f354-447a-841d-f0f17d99ed93)
|

Old:

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/76e05892-3984-48fb-8e90-2a36f2e71107)

New:

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/d7573514-2307-440a-babf-bed5c646e8fe)
2024-06-15 12:10:09 -05: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
Matt Godbolt
7bab098a7f Reinstate a missing line 2024-06-10 21:49:34 -05:00
Afonso Bordado
c9ec0f2add Add webassembly language (#6429)
👋 Hey,

This PR adds support for the Webassembly Text Language (#1871).
Currently it only supports the
[wasmtime](https://github.com/bytecodealliance/wasmtime) compiler, but
it should be possible to add others (i.e. v8 / wasmer / etc...).

It looks like the monaco does not support the WAT language, so I've
added a simple mode for it, that is mostly copied from the clojure mode
with some changes. From what I've tested it seems to work reasonably
well.


![image](https://github.com/compiler-explorer/compiler-explorer/assets/1357143/9e38b28e-235c-47e5-a71e-50217e5d2056)

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2024-06-10 21:33:57 -05:00
Jeremy Rifkin
b940908b28 Use improved ansi colors for one dark pro (#6572)
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/a18aceb9-b1e2-410c-8a8d-663ef063fdc6)
2024-06-10 21:33:56 -05:00
Ofek
7cc4e371ab Fix bad paste (#6555) 2024-06-10 21:33:56 -05:00
Ofek
05f49a59c7 Some extra safety, following sentry-caught exceptions (#6553)
This is the crash:
https://compiler-explorer.sentry.io/issues/5427865018/

Looking at [where these values are
populated](2307e16fa4/lib/base-compiler.ts (L2711-L2715))
my conjecture is that `BigInt.toString` failed and returned undefined /
null, but I see no documented conditions that can trigger this (maybe
[just for ridiculous
values](https://stackoverflow.com/a/75593358/89706)).
2024-06-10 21:33:55 -05:00
Ofek Shilon
bce3a65d6d Add full-url capture for sentry messages triggered in front end 2024-06-03 22:11:52 +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
Ofek
2687f6a309 Make stack-usage display inline, same as opt-view (#6469)
Following the intention declaration
[here](https://github.com/compiler-explorer/compiler-explorer/pull/6393#issuecomment-2076787747):


![image](https://github.com/compiler-explorer/compiler-explorer/assets/73080/4c239691-07ac-4ab3-9745-43cf67dd5679)
2024-05-14 10:56:24 +03:00
Ofek
8559ea5937 Fix #6468: Don't trust hasStackUsageOutput/hasOptOutput (#6471) 2024-05-13 00:24:56 +03:00
Ofek Shilon
0741ec2fdc Fix: page refresh restores default code 2024-05-11 17:29:11 +03:00
Ofek
44d48dca16 Fix #6464: defend against empty saved layout (#6465)
Fix #6464, following the discord discussion.

2 protections are added here:

(1) Make the first code editor non-closable, to avoid an empty layout,
(2) If a loaded config has empty layout - fallback to the default
config.
2024-05-10 11:24:11 +03:00
Ofek
b5dcb4bab0 Init optRemarks in ctor (#6463)
Fix #6460: trying to access an `undefined` this.optRemarks.

The order of opt-view.ts invocations at opt-view pane open is:
1. `constructor`,
2. `registerButtons`,
3. `onCompileResult`

If someone manages to click the filter checkboxes after (2) but before
(3), then `showOptRemarks` would be triggered before `this.optRemakrs`
is initialized and this exception would ensue. The solution here is to
initialize `this.optRemakrs` at the constructor.

Couldn't reproduce, the solution is entirely hypothetical. If it would
happen again we'll revisit this.
2024-05-09 20:26:08 +03:00
Jeremy
c508d202d9 Update tooltip arrow color in one dark theme 2024-05-05 12:27:18 -05:00
Jeremy
aa7fc9bd82 Fix un-needed scrollbars on tooltips 2024-05-05 12:23:38 -05:00
Ofek
9d8c503b3d Improve initialization of decorations in MonacoPane (#6426)
Make MonacoPane calls `createDecorationsCollection` in a single place
instead of forcing many subclasses to remember to call
`initDecorations`. Some subclasses never use DecorationsCollection and
call init for no reason now, but it still seems healthier - this avoids
the possibility of a MonacoPane subclass trying to use an uninitialized
decoration collection.

Also remove the depracated `deltaDecorations` from stack-usage-view.
2024-05-05 10:17:57 +03:00
Ofek
9f5906abf3 Fix inline opt-remarks: toggling a filter off did not remove the remarks from the display. (#6407)
No idea how this worked on my machine prior to submitting...
Anyway, fixed now.
2024-04-28 21:48:15 +03:00
Ofek
f59bad3a7e Opt remarks: replace hover-over-sidebar display with inline text (#6393)
![inlineoptrem](https://github.com/compiler-explorer/compiler-explorer/assets/73080/6c306b3f-2256-4578-b1d3-beaa1494a083)
2024-04-25 12:37:57 +03:00
Ofek
eb5f370a6f Fix #6394: preserve optview filters when sharing (#6395) 2024-04-23 22:42:55 +03:00
Matt Godbolt
f358067cec Migrate to eslint-plugin-n; as ...-node is deprecated (#6387)
Replaces #6310
2024-04-23 06:45:55 -05:00
Patrick Quist
ee688190ac Disable GA (#6302) 2024-04-22 21:25:31 +02:00
Patrick Quist
adb8bd774a Dynamic instruction set for documentation (#6173) 2024-04-22 18:40:56 +02:00
Ofek
1c3b775577 Add simple filters for llvm optimiziation-remarks (#6354)
![optremfilters](https://github.com/compiler-explorer/compiler-explorer/assets/73080/1116998b-de9e-400c-a045-412fd59eb8e3)
2024-04-15 01:05:58 +03:00
Matthew Guidry
a47d3c68fc Fix one dark function like keywords (#6344)
I overlooked this one. It is sort of important for these to be a
different color than the background:

```
static_assert
alignof
typeid
static_cast
sizeof
reinterpret_cast
dynamic_cast
decltype
asm
```
2024-04-11 18:12:36 -05:00
Matthew Guidry
f710f316cd Correct several colors in one dark (#6341)
Fixed:
- Dropdown menu disabled color
- Dropdown menu active color
- General panel background color
- Separator line for minimap
- Output text-count color
- Remove pure white across theme
- Fix custom-select in popout
2024-04-10 20:23:10 -05:00
Jeremy
db3076e0ab Rescue users from real dark mode 2024-04-09 20:20:18 -05:00
Matthew Guidry
102b253f57 Add one dark theme (#6324)
Adds a new theme based on the One Dark theme from the Atom text editor.
Adds a new line highlighting theme "Soft Dark Rainbow" that works better
with the One Dark theme.
2024-04-06 23:30:39 -05:00
Mats Jun
5738ed00e7 Implement alert filters for library dialog (#6325)
Hey friends, it's been a while since last time :)

There are quite a few conditions/cases where the library alert will pop
up, without anything meaningful inside of it. This is particularly the
case for Rust where you have the 100 crates on stable, but zero support
in beta/nightly. I figured informing the user in cases like this would
be nice to have.

This PR adds a rather simple alerting mechanism to alert the user of any
conditions that might not be as apparent (such as Rust crates only being
on stable)

Below is a small gif of how it works. I'm not sure this is the easiest
way to convey this information (especially considering the modal popup
overshadows the alert) so please share any other ideas. Maybe it's
better to have the content fill the modal instead?

![Peek 2024-04-07
00-43](https://github.com/compiler-explorer/compiler-explorer/assets/42585241/53b8a8ad-3f5a-4500-83ce-af627f2e5655)

Relevant issues: #3766 #6250
2024-04-07 01:31:23 +02:00
partouf
5a0521279b swap mobile users back to dark+ 2024-04-02 16:29:40 +02:00
narpfel
f5efd390fa Optionally show disambiguating hashes in demangled Rust identifiers (#6265)
Demangled Rust identifiers under the `legacy` name mangling scheme rely
on a hash to disambiguate items with the same name, such as different
monomorphisations of the same function or different closures’
`call_once` methods.

In the `v0` mangling scheme, this is no longer a problem. However,
configuring the demangler to show hashes in `legacy` names will include
crate-id hashes in `v0` names, which are [mostly
unneeded](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#appendix-a---suggested-demangling).

This PR introduces a new checkbox *Options...* → *Verbose demangling*
that lets the user select if they want to include disambiguating hashes
in demangled identifiers.

This checkbox is only shown for compilers that support verbose
demangling, and deactivated when the *Demangle identifiers* checkbox is
unchecked.

Resolves #1754.
Resolves #6255.
2024-04-01 21:58:42 -05:00
Marc Auberer
5a352d6929 Add new keywords to LLVM IR mode (#6262)
Add new keywords to LLVM IR, taken from the list:
https://llvm.org/docs/LangRef.html#parameter-attributes
2024-04-01 13:54:57 +03:00
Jeremy Rifkin
c2fa676a8e Create the real dark mode (#6309) 2024-03-31 19:41:51 -05:00
Patrick Quist
cd1929bc91 Attempt to disable sticky scroll (#6266) 2024-03-21 05:37:40 +01:00
Jeremy Rifkin
c34b85c320 Ansi color theming (#5848) 2024-03-20 22:01:36 -05:00
narpfel
077f9c99cf Decode UTF-8 encoded strings in numeric tooltip (#6234)
Compilers like to encode short-ish strings into immediate arguments to
various assembly instructions. This makes it hard to read the assembly.

To improve readability, show a string representation of a number’s bytes
when they’re valid UTF-8.

This now also shows a string representation for *unprintable* ASCII
characters, such as `10` being shown as `"\n"` or `1` as `"\u0001"`.

Resolves #6220.

## Examples

([link](https://godbolt.org/z/7hzn6b8YG))

* 8583909746840200552: `8'583'909'746'840'200'552 =
0x7720'2C6F'6C6C'6568 = 6.5188685003648344e+265 = "hello, w"`
* 1684828783: `1'684'828'783 = 0x646C'726F = 1.74467096e+22f = "orld"`
* -6934491452449512253: `-6'934'491'452'449'512'253 =
0x9FC3'BCC3'B6C3'A4C3 = -1.1500622354593239e-155 = "äöüß"`
* 1633837924: `1'633'837'924 = 0x6162'6364 = 2.61007876e+20f = "dcba"`
* 97: `97 = 0x61 = 1.35925951e-43f = "a"`
* 10: `10 = 0xA = 1.40129846e-44f = "\n"`
* 92: `92 = 0x5C = 1.28919459e-43f = "\\"`

## Open questions

* The code assumes little-endian encoding, so the string representation
is reversed compared to the numeric representation (see `integer`
example). Should this be configurable or should the bytes not be
reversed?
* Negative numbers are masked to 64-bit unsigned ints (same as in the
hex representation), so if the number is shorter than 8 bytes, it has
some leading `ff` bytes and is not valid UTF-8 (see
`small_negative_number` in the example link). Is this an acceptable
limitation?
* I'd like to add some tests for `getNumericToolTip`, but I’m not really
familiar with TypeScript. I tried to importing
`static/panes/compiler.ts` in a test file, but
([after](https://github.com/vitest-dev/vitest/discussions/1806#discussioncomment-3570047)
some [struggling](https://vitest.dev/config/#environment)) it seems that
that file needs a [specific DOM
element](3c26c64ca3/static/options.ts (L27))
that is not present during testing. The simplest solution I could come
up with is moving `getNumericToolTip` into another file (such as
`static/utils.ts`). Is that okay or is is it possible test
`static/panes/compiler.ts` some other way?

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2024-03-17 12:43:43 +02:00
Ofek
8dd09d1c1f Replace the deprecated substr with substring (#6236)
Just some minor homekeeping.
2024-03-10 10:04:29 +02:00
Ofek
45b743e22b Fix an element on('dragstart') applies to (#6226)
And change 'toggle' to 'hide' to better express the intention.
Fixes #6225.


<!-- 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-03-07 20:21:10 +02:00
narpfel
10c6074073 Add digit separators to long numbers in numeric tooltip (#6221)
Long numbers are sometimes hard to read in the numeric tooltip. To
improve readability, this PR adds language-specific digit separators to
the numeric tooltip.

Decimal numbers are grouped into chunks of three digits while
hexadecimal numbers are grouped into chunks of length four.

The digit separator is language-specific and chosen so that the number
is a valid token in the source language.

[Examples](https://godbolt.org/z/s86cMbjeK):
* for C++, hovering the number `8583909746840200552` shows this tooltip:
`8'583'909'746'840'200'552 = 0x7720'2C6F'6C6C'6568 =
6.5188685003648344e+265`
* for Python, hovering the number `-12345678` shows this tooltip:
`-123_456_789 = 0xFFFF_FFFF_F8A4_32EB = -2.66427945e+34f`

For languages that don’t have a `digitSeparator` set, the tooltip is not
changed.
2024-03-05 20:11:39 -06:00
Matt Godbolt
3cfffa68d2 Add a new sponsor: ThinkCell. Thank you! (#6213) 2024-03-02 15:45:25 -06:00