This commit upgrades all CodeMirror related packages to official major
version 6. There are no specific features that we need though bug fixes
are always nice.
The issue I encountered in 7d96c4c8ca do
not exist anymore (either we or CodeMirror changed something).
Migrating this Monaco callsite seems low risk because it is a read-only
JSON view. The main Monaco feature used here appears to be code folding,
which CodeMirror also provides.
Overall I've identified the following features/characteristics:
- Read-only
- Syntax highlighting for JSON
- Code folding for JSON
- Fixed editor height
- Idendation guides
There is no "default" extension for idendation guides, so this feature
was not migrated. However, if this is strongly desired it's possible to
build a custom extension for that.
Since this it the first Monaco migration outside of Notebooks and the
search query input I also added a couple of default extensions meant to
be shared by other CodeMirror instances in the future. Specifically I
added a syntax highlighting theme to use our existing colors and tried
to approximate Monaco's theme.
**Note:** I'm deliberately using v0.20.0 of @codemirror/lang-json
because using the latest version would require updating the other
@codemirror/* packages. Those seem to cause some focus issue with our
main search query input and the menu though.
* Stub in basic example Tooltip compound component
* Add new Wildcard Tooltip using Radix, basic Storybook story
* Simplify Tooltip API, add Wildcard styles
* Updates from PR feedback
* Finalize Tooltip tests, ESLint rule
* Additional PR feedback, support conditional tooltips
* Fix existing Tooltip imports
* Remove old ESLint rule disabling import of Tooltip component from Wildcard
* Update which Tooltip component is used in main JetBrains app file
This PR fixes a lot if bugs that we had with our preview component. Specifically we:
- Change the content encoding in our JS -> Java bridge to be a base64 representation to avoid issues in the JSON parsing libraries (it would through before we could even do any workarounds in user space).
- Use a proper base64 encoding library on the JS side that handles all Unicode characters (`btoa()` would error on some files with `[Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.](https://stackoverflow.com/questions/23223718/failed-to-execute-btoa-on-window-the-string-to-be-encoded-contains-characte)`).
- Make the `content` field optional in the JS -> Java bridge to support files with no preview out of the box (We use this for when previewing binary files but also for types that do not have a preview). **Note: We need to change the Java side rendering to use a label instead of the editor component when content is null.**
- We fix `getCharacterCountUntilLine` to ignore `\r\n` the same way that our content preparation is doing so that index match again.
- We query `highlight` in the Blob query to get a server-side error when the file we download is a binary file. We can use this to:
- Avoid downloading the file when it's a binary
- Know when we do not want to render a preview
- Add all support match types to `getFirstResultId()` to properly select the right match to preview automatically (previously this would either be the first content match if one content match was in the search result list or _nothing_).
* Update TS version to 4.7.2
* Update gql types and revert handling error type problems
* Update ts-loader
* Use T|null instead of Partial<T>| undefined for the GQL response data
* Add diff for a TypeScript file to trigger CI job
* Rename job
* Delete unnecessary TypeScript file after validating CI job
* Remove unused "LSIF Typed" code
This code got moved to a separate repo github.com/sourcegraph/scip.
CodeMirror has been updated to v0.20, which introduces a new package structure (and other changes) as outlined here: https://discuss.codemirror.net/t/release-0-20-0/4302
This PR also introduces proper undo/redo to the search query input by adding the corresponding extension and keymaps.
* Create InsightCard component (abstraction for building insight card for the dashboard page)
* Migrate BuiltIn (runtime insight) card component
* Improve type safety over data fetching state
* Revamp backend insight api methods
* Move locked chart view to insight folder
* Update some of @visx packages