Expose the score function in Monaco editor - #322959
Merged
Alexandru Dima (alexdima) merged 3 commits intoAug 28, 2026
Merged
Conversation
The `score` function is useful for filtering models in Monaco editor. This is also useful in functionality outside of the core.
Copilot started reviewing on behalf of
Remco Haszing (remcohaszing)
June 25, 2026 15:02
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR exposes the existing language-selector scoring helper as a public monaco.languages.score API, enabling external consumers to reuse Monaco’s built-in selector matching logic (e.g., for model filtering and worker synchronization scenarios).
Changes:
- Export
scoreon themonaco.languagesAPI surface (runtime + typings). - Make
candidateIsSynchronizeddefault totrueto support calls that omit the 4th argument. - Update the Monaco
.d.tsgeneration recipe to include the new API.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/monaco.d.ts | Adds the monaco.languages.score type declaration to the public Monaco typings. |
| src/vs/editor/standalone/browser/standaloneLanguages.ts | Wires score into the standalone Monaco languages API object. |
| src/vs/editor/common/languageSelector.ts | Adjusts score parameter defaults/optionality to support the new public calling pattern. |
| build/monaco/monaco.d.ts.recipe | Ensures score is included when generating monaco.d.ts. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Martin Aeschlimann (aeschli)
approved these changes
Aug 28, 2026
Martin Aeschlimann (aeschli)
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
scorefunction is useful for filtering models in Monaco editor. This is also useful in functionality outside of the core.Example use cases are
monaco-marker-data-provider, and a worker synchronization library I’m working on.