Skip to content

Conversation

@MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jul 9, 2025

Summary

Integrate the semantic token provider into the playground.

I did remap some colors but I didn't assign colors to every supported token yet

Test Plan

Screenshot 2025-07-09 at 14 19 44 Screenshot 2025-07-09 at 14 19 40

@MichaReiser MichaReiser added playground A playground-specific issue ty Multi-file analysis & type inference labels Jul 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2025

mypy_primer results

No ecosystem changes detected ✅
No memory usage changes detected ✅

@MichaReiser MichaReiser force-pushed the micha/semantic-tokens-playground branch from cf14a06 to 4940b31 Compare July 9, 2025 12:55
Copy link
Collaborator

@UnboundVariable UnboundVariable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. LGTM.

foreground: ROCK,
},
{
foreground: ROCK,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a lot of work to maintain the theme colors manually. IIRC, there are theme packs for monaco that work well on dark and light background.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I considered doing the same. It's a bit unfortunate that it's not possible to use the VS code themes directly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think monaco offers some reasonable default themes, but maybe you're looking for something that's more customizable.

Here's the code in the "pyright playground" code that specifies the default VS Code theme.

@MichaReiser MichaReiser marked this pull request as ready for review July 10, 2025 05:49
@MichaReiser MichaReiser merged commit 3926dd8 into main Jul 10, 2025
37 checks passed
@MichaReiser MichaReiser deleted the micha/semantic-tokens-playground branch July 10, 2025 05:50
UnboundVariable pushed a commit to UnboundVariable/ruff that referenced this pull request Jul 11, 2025
…re_help

* 'main' of https://github.com/astral-sh/ruff:
  Add simple integration tests for all output formats (astral-sh#19265)
  [`flake8-return`] Fix false-positive for variables used inside nested functions in `RET504`  (astral-sh#18433)
  [ty] Add a `--quiet` mode (astral-sh#19233)
  Treat form feed as valid whitespace before a line continuation (astral-sh#19220)
  [ty] Make `check_file` a salsa query (astral-sh#19255)
  [ty] Consolidate submodule resolving code between `types.rs` and `ide_support.rs` (astral-sh#19256)
  [ty] Remove countme from salsa-structs (astral-sh#19257)
  [ty] Improve and document equivalence for module-literal types (astral-sh#19243)
  [ty] Optimize protocol subtyping by removing expensive and unnecessary equivalence check from the top of `Type::has_relation_to()` (astral-sh#19230)
  [ty] Ecosystem analyzer: parallelize, fix race condition (astral-sh#19252)
  [ty] Add completion kind to playground (astral-sh#19251)
  [ty] Deploy ecosystem diff to Cloudflare pages (astral-sh#19234)
  [ty] Add semantic token provider to playground (astral-sh#19232)
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.

3 participants