Skip to content

Conversation

MichaReiser
Copy link
Member

Summary

A few smaller editor improvements that felt worth pulling out of my other feature PRs:

  • Load the Editor lazily: This allows splitting the entire monaco javascript into a separate async bundle, drastically reducing the size of the index.js
  • Fix the name of to_range and text_range to the more idiomatic js names toRange and textRange
  • Use one indexed values for Position::line and Position::column, which is the same as monaco (reduces the need for +1 and -1 operations spread all over the place)
  • Preserve the editor state when navigating between tabs. This ensures that selections are preserved even when switching between tabs.
  • Stop the default handling of the Enter key press event when renaming a file because it resulted in adding a newline in the editor

@MichaReiser MichaReiser force-pushed the micha/playground-preserve-editor-state branch from af42660 to acf227c Compare April 1, 2025 08:00
@MichaReiser MichaReiser added playground A playground-specific issue ty Multi-file analysis & type inference labels Apr 1, 2025
Copy link
Contributor

github-actions bot commented Apr 1, 2025

mypy_primer results

No ecosystem changes detected ✅

@MichaReiser MichaReiser marked this pull request as ready for review April 1, 2025 08:04
@MichaReiser MichaReiser merged commit 0073fd4 into main Apr 1, 2025
22 checks passed
@MichaReiser MichaReiser deleted the micha/playground-preserve-editor-state branch April 1, 2025 08:04
dcreager added a commit that referenced this pull request Apr 1, 2025
* main:
  [red-knot] Add property tests for callable types (#17006)
  [red-knot] Disjointness for callable types (#17094)
  [red-knot] Flatten `Type::Callable` into four `Type` variants (#17126)
  mdtest.py: do a full mdtest run immediately when the script is executed (#17128)
  [red-knot] Fix callable subtyping for standard parameters (#17125)
  [red-knot] Fix more `redundant-cast` false positives (#17119)
  Sync vendored typeshed stubs (#17106)
  [red-knot] support Any as a class in typeshed (#17107)
  Visit `Identifier` node as part of the `SourceOrderVisitor` (#17110)
  [red-knot] Don't infer Todo for quite so many tuple type expressions (#17116)
  CI: Run pre-commit on depot machine (#17120)
  Error instead of `panic!` when running Ruff from a deleted directory (#16903) (#17054)
  Control flow graph: setup (#17064)
  [red-knot] Playground improvements (#17109)
  [red-knot] IDE crate (#17045)
  Update dependency vite to v6.2.4 (#17104)
  [red-knot] Add redundant-cast error (#17100)
  [red-knot] Narrowing on `in tuple[...]` and `in str` (#17059)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
playground A playground-specific issue ty Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant