Commit Graph
61 Commits
Author SHA1 Message Date
Patrick Quist 6f97ab5518 Close button fix (#7050) 2024-11-08 16:25:55 +01: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 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 c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +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
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 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 d83bb38f1a add paneName fallback to filename in editor.getPaneName() (#6773) 2024-08-18 09:57:13 +03:00
Abril Rincón Blanco feb7b35754 Fix paneRenaming not affecting source editor (#6611) 2024-06-29 03:06:11 +02: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 d2ee6e18a5 Replace the deprecated monaco.editor.ICodeEditor.deltaDecorations (#6078)
Replace the deprecated `monaco.editor.ICodeEditor.deltaDecorations` with `monaco.editor.IEditorDecorationsCollection`

Seems that today the official way of colouring monaco editors is having
them `createDecorationsCollection`, keep the resulting
decorations-collection and call `set` on it with new decorations
whenever needed.
There are many possible design choices on where to put it, I opted to
put `editorDecorations` in `MonacoPane`, and have
`MonacoPane.createEditor` initialize it only in panes where decorations
are actually used.
Also some signatures changed which had a broad (but non-interesting)
impact.
2024-02-04 18:12:53 +02:00
Ofek Shilon 266706f4c4 Revert "Remove usage of the depracated monaco.IEditor deltaDecorations (#6049)"
This reverts commit 9705843bb7.
2024-01-30 14:25:59 +02:00
Ofek 9705843bb7 Remove usage of the depracated monaco.IEditor deltaDecorations (#6049)
…in favor of createDecorationsCollection.
Minor drive-by cleanups.
2024-01-27 17:02:21 +02:00
Ofek 836dfc875c Fix #5948 per the suggestion in the issue discussion (#6048)
<!-- 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-01-26 17:15:38 +02:00
Ofek 21fe5523c0 Since ES6 there's no reason to use underscores map and filter (#5989)
Mindless replacements of the form 
`_.filter(options, option =>...`  --> `options.filter(option =>...`.

One not *entirely* mindless replacement at the bottom of
compiler-dropin-tool.ts :
```
-        return _.filter(pathFilteredFlags) as string[];
+        return pathFilteredFlags.filter(Boolean) as string[];
```
6 files can now stop importing underscore.
2024-01-13 18:35:11 +02:00
Ofek cce6125929 Fix #5820 (#5831)
The same dropdown glitch described in the bug happens for the compiler
selection dropdown. This addresses both.
2023-12-10 14:06:45 -06:00
Matt Godbolt a7e6ec61e3 Bump remaining deps (#5781)
And reformat everything.
2023-11-20 22:04:57 -06:00
Patrick Quist d5fd1ae3a7 Fix shared state close issue (#5725) 2023-11-10 00:13:53 +01:00
Patrick Quist 2aad725797 Fix for old links where language is not set in the editor (#5378) 2023-08-25 15:53:58 +02:00
Jeremy Rifkin 4260313e13 Common utilities and type work (#5200)
This PR refactors some common utilities out of lib/ and into shared/ and
eliminates some use of underscore.js, as well as general type
improvements done along the way.
2023-06-28 20:13:10 -04:00
Jeremy Rifkin c779507000 Create a print view (#5161)
This PR adds a print view for CE

Closes #4617


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/92e5ceab-10cc-4289-a742-592e379627ef)

At the moment syntax highlighting isn't working. I think we need a way
to get style definitions from monaco. I've opened an issue at
https://github.com/microsoft/monaco-editor/issues/4031. For the CFG
pane, using the monaco classes "just works", but for some reason when
@media print is applied those definitions go away. We'd want to always
use light mode colors anyway.
2023-06-19 22:13:45 -04:00
Jeremy Rifkin 2affa339c9 Fix word wrapping bug (#5162)
Fixes #4486
2023-06-18 15:57:12 -04:00
Jeremy Rifkin 1d44b6d2b4 War on @ts-expect-error (#5171)
Following up on #5170, let's just get rid of @ts-expect-error and
@ts-ignore completely in the codebase. (Well almost)
On top of #5170
2023-06-18 15:21:50 -04:00
Jeremy Rifkin 764338eb21 Fix longstanding issue TypeError: e.map is not a function (#5170)
Fixes #4868
This took so long to track down. I am convinced `@ts-expect-error` is
*always an error*.
2023-06-18 15:12:03 -04:00
Jeremy 07b0df516e Revert "Fix word wrapping bug"
This reverts commit 567c45be12.
2023-06-17 15:14:37 -04:00
Jeremy 567c45be12 Fix word wrapping bug 2023-06-17 15:12:45 -04:00
Jeremy Rifkin 6e857a2546 Check for clipboard support better (#5146) 2023-06-14 15:45:46 +02:00
Jeremy 6dacb4d3e2 Add more info to an earlier triage attempt 2023-06-10 15:43:43 -04:00
Jeremy Rifkin 794a350a9e Add something to the context menu in place of paste when not supported (#5081)
In case anyone asks why "Paste" is missing from the context menu in the
future:


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/32070502-fa17-44e3-ba5c-8924294b7e74)

Paste is present in chrome and other browsers that support the clipboard
api, just not firefox. This should change upstream some day.
https://github.com/microsoft/vscode/blob/1052813be23485fd9c17ac77b517241479c21142/src/vs/editor/contrib/clipboard/browser/clipboard.ts#L27-L30

Closes #3113
2023-05-30 21:19:06 -05:00
Jeremy Rifkin 476b983a45 Better tab width handling (#5066)
Fixes #4877
2023-05-22 22:17:16 -05:00
Jeremy Rifkinandmmozeiko 2800d90be8 Set maxOptions for the language select (#4991)
Fixes #4988, haven't tested locally as I don't have >50 languages
installed locally

Co-authored-by: mmozeiko <martins.mozeiko@gmail.com>
2023-04-24 16:42:24 -04:00
Jeremy Rifkin 01935ecb2a Ensure a default language is provided for new editor panes (#4890)
Fixes #4889
2023-03-20 17:03:42 -04:00
Jeremy Rifkin 7a105ad0d0 Capture info to help triage an issue #4868 (#4871)
Trying to figure out #4868, unless anyone has an idea how to repro
locally
2023-03-13 12:06:47 -06:00
Jeremy Rifkin ca4ab7148b Give an error when no editor language is specified (#4864)
Following discussion at #4817 and with partouf/matt. An editor's
state.lang being undefined should probably always be an error since
it'll be susceptible to the same default language shenanigans.

Closes #4817
2023-03-12 19:40:12 -04:00
Matt Godbolt 515c130300 Make bracket colourisation configurable. (#4863)
See microsoft/monaco-editor#3013 for ways this can be improved in future
2023-03-12 16:25:34 -05:00
Matt Godbolt 82b1ca9cce Bump to latest monaco (#4854)
Fixes #4355
2023-03-12 12:58:22 -05:00
Mats Jun LarsenandMatt Godbolt 633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Jeremy Rifkin 384c297906 Fix trailing comma issue (#4775)
Make trailing commas more consistent throughout the project, fixes
config conflict between eslint and prettier. Resolves an oversight in
#4766.
2023-02-26 12:21:35 -05:00
Ross Brunton ba9fdedc8f Expose autoCloseQuotes and autoSurround editor settings (#4744) 2023-02-19 22:13:37 +00:00
Jeremy Rifkin 33167a3024 Tsify main (#4520) 2023-01-13 19:52:00 -05:00
Jeremy Rifkin 07f37abe76 The War of The Types (#4490) 2023-01-13 19:22:25 -05:00
Matt Godbolt 57a647b8a3 Add the result inside the CompilationResult (#4475) 2022-12-20 08:15:39 -06:00
Jeremy Rifkin 5ee5386678 Upgrade and audit npm packages (#4457)
* Upgrade and audit npm packages

* Go back to mocha 8.4.0

* Fix build, update for new api
2022-12-18 12:53:17 -05:00
Rubén Rincón Blanco 924799919c Make Alert and Compiler-Picker widgets (#4366) 2022-11-30 12:41:54 +01:00
Rubén Rincón Blanco f1a4f169a9 Fetch settings in initializeGlobalDependent (#4307) 2022-11-25 12:41:15 +01:00
Patrick Quist 750f1930a7 File drop support (#4247) 2022-11-12 15:14:51 +01:00
Rubén Rincón Blanco c7cfda6a3f Add language tooltips (#4237) 2022-11-09 02:53:04 +01:00