src/vs/editor/common/tokens/common.ts

22 LOC · 16 covered · 6 uncovered · 2 ranges · 61 concepts · 1 introducers · 20 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/editor/common/tokens/sparseMultilineTokens.ts · 617 LOCtokens/sparseMultilineTo…sparseMultilineTokens.ts ×10 · 49 introduced LOCsparseMultilineTokens.ts…tokensStore.test|title=TokensStore inserting a newline|occurrence=1 · 0 introduced LOCtokensStore.test|title=T…sparseMultilineTokens.ts ×11 · 65 introduced LOCsparseMultilineTokens.ts…tokensStore.test|title=TokensStore issue #86303 - color shifting between different tokens|occurrence=1 · 0 introduced LOCtokensStore.test|title=T…sparseMultilineTokens.ts ×2 · 7 introduced LOCsparseMultilineTokens.ts…tokensStore.test|title=TokensStore deleting a newline|occurrence=1 · 0 introduced LOCtokensStore.test|title=T…sparseMultilineTokens.ts ×2 · 6 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×2 · 6 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×9 · 74 introduced LOCsparseMultilineTokens.ts…languageConfigurationRegistry.ts ×8 · 53 introduced LOClanguageConfigurationReg…sparseTokensStore.ts ×1 · 3 introduced LOCsparseTokensStore.ts ×1sparseMultilineTokens.ts ×5 · 21 introduced LOCsparseMultilineTokens.ts…semanticTokensProviderStyling.ts ×6 · 16 introduced LOCsemanticTokensProviderSt…semanticTokensProviderStyling.ts ×2 · 5 introduced LOCsemanticTokensProviderSt…semanticTokensProviderStyling.ts ×1 · 19 introduced LOCsemanticTokensProviderSt…semanticTokensProviderStyling.ts ×18 · 247 introduced LOCsemanticTokensProviderSt…sparseTokensStore.ts ×1 · 4 introduced LOCsparseTokensStore.ts ×1tokensStore.test|title=TokensStore partial tokens 1|occurrence=1 · 0 introduced LOCtokensStore.test|title=T…sparseTokensStore.ts ×3 · 9 introduced LOCsparseTokensStore.ts ×3sparseTokensStore.ts ×2 · 3 introduced LOCsparseTokensStore.ts ×2sparseTokensStore.ts ×2 · 4 introduced LOCsparseTokensStore.ts ×2sparseMultilineTokens.ts ×3 · 48 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×1 · 3 introduced LOCsparseTokensStore.ts ×1sparseMultilineTokens.ts ×1 · 7 introduced LOCsparseMultilineTokens.ts…range.ts ×1 · 3 introduced LOCrange.ts ×1sparseTokensStore.ts ×3 · 5 introduced LOCsparseTokensStore.ts ×3sparseMultilineTokens.ts ×1 · 3 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×1 · 4 introduced LOCsparseTokensStore.ts ×1sparseTokensStore.ts ×1 · 2 introduced LOCsparseTokensStore.ts ×1sparseMultilineTokens.ts ×3 · 9 introduced LOCsparseMultilineTokens.ts…tokensStore.test|title=TokensStore issue #94133: Semantic colors stick around when using (only) range provider|occurrence=1 · 0 introduced LOCtokensStore.test|title=T…tokensStore.test|title=TokensStore addSparseTokens skips overlapping semantic tokens that produce backward endOffsets|occurrence=1 · 0 introduced LOCtokensStore.test|title=T…sparseMultilineTokens.ts ×1 · 1 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×1 · 1 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×4 · 18 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×1 · 2 introduced LOCsparseTokensStore.ts ×1sparseMultilineTokens.ts ×1 · 2 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×1 · 2 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×3 · 6 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×1 · 3 introduced LOCsparseTokensStore.ts ×1sparseMultilineTokens.ts ×4 · 7 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×1 · 2 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×1 · 2 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×1 · 2 introduced LOCsparseTokensStore.ts ×1sparseTokensStore.ts ×1 · 3 introduced LOCsparseTokensStore.ts ×1sparseTokensStore.ts ×10 · 83 introduced LOCsparseTokensStore.ts ×10sparseMultilineTokens.ts ×2 · 11 introduced LOCsparseMultilineTokens.ts…tokensStore.test|title=TokensStore BUG: setPartial with startLineNumber > 1 and token removal creates invalid state|occurrence=1 · 0 introduced LOCtokensStore.test|title=T…sparseTokensStore.ts ×1 · 6 introduced LOCsparseTokensStore.ts ×1sparseMultilineTokens.ts ×1 · 1 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×4 · 13 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×6 · 56 introduced LOCsparseTokensStore.ts ×6sparseMultilineTokens.ts ×6 · 15 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×1 · 2 introduced LOCsparseTokensStore.ts ×1sparseMultilineTokens.ts ×1 · 2 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×2 · 4 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×3 · 6 introduced LOCsparseMultilineTokens.ts…sparseTokensStore.ts ×2 · 5 introduced LOCsparseTokensStore.ts ×2sparseMultilineTokens.ts ×1 · 2 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×1 · 2 introduced LOCsparseMultilineTokens.ts…sparseMultilineTokens.ts ×33 · 153 introduced LOCsparseMultilineTokens.ts…tokensStore.test|title=TokensStore BUG: setPartial with split that creates empty first piece with invalid line numbers|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore BUG: setPartial with split that creates empty first piece with invalid line numbers|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore BUG: setPartial with startLineNumber > 1 and token removal creates invalid state|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore BUG: setPartial with startLineNumber > 1 and token removal creates invalid state|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore addSparseTokens skips overlapping semantic tokens that produce backward endOffsets|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore addSparseTokens skips overlapping semantic tokens that produce backward endOffsets|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore bug|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore bug|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore deleting a newline 2|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore deleting a newline 2|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore deleting a newline|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore deleting a newline|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore inserting a newline|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore inserting a newline|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore issue #147944: Language id "vs.editor.nullLanguage" is not configured nor known|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore issue #147944: Language id "vs.editor.nullLanguage" is not configured nor known|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore issue #179268: a complex edit|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore issue #179268: a complex edit|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore issue #86303 - color shifting between different tokens|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore issue #86303 - color shifting between different tokens|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore issue #91936: Semantic token color highlighting fails on line with selected text|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore issue #91936: Semantic token color highlighting fails on line with selected text|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore issue #94133: Semantic colors stick around when using (only) range provider|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore issue #94133: Semantic colors stick around when using (only) range provider|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore issue #95949: Identifiers are colored in bold when targetting keywords|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore issue #95949: Identifiers are colored in bold when targetting keywords|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore partial tokens 1|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore partial tokens 1|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore partial tokens 2|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore partial tokens 2|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore partial tokens 3|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore partial tokens 3|occurrence=1tokensStore.test|title=T…tokensStore.test|title=TokensStore piece with startLineNumber 0 and endLineNumber -1 after encompassing deletion|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/tokensStore.test|title=TokensStore piece with startLineNumber 0 and endLineNumber -1 after encompassing deletion|occurrence=1tokensStore.test|title=T…semanticTokensProviderStyling.test|title=ModelService issue #134973: invalid semantic tokens should be handled better|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/services/semanticTokensProviderStyling.test|title=ModelService issue #134973: invalid semantic tokens should be handled better|occurrence=1semanticTokensProviderSt…semanticTokensProviderStyling.test|title=ModelService issue #148651: VSCode UI process can hang if a semantic token with negative values is returned by language service|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/services/semanticTokensProviderStyling.test|title=ModelService issue #148651: VSCode UI process can hang if a semantic token with negative values is returned by language service|occurrence=1semanticTokensProviderSt…semanticTokensProviderStyling.test|title=ModelService issue #149130: vscode freezes because of Bracket Pair Colorization|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/services/semanticTokensProviderStyling.test|title=ModelService issue #149130: vscode freezes because of Bracket Pair Colorization|occurrence=1semanticTokensProviderSt…Focused file · src/vs/editor/common/tokens/common.ts · 22 LOCtokens/common.ts

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- sparseMultilineTokens.ts ×33
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > export class RateLimiter {
7 > private _lastRun: number;
8 > private readonly _minimumTimeBetweenRuns: number;
9 >
10 > constructor(public readonly timesPerSecond: number = 5) {
11 > this._lastRun = 0;
12 > this._minimumTimeBetweenRuns = 1000 / timesPerSecond;
13 > }
14 >
15 > public runIfNotLimited(callback: () => void): void {
16 const now = Date.now();
17 if (now - this._lastRun >= this._minimumTimeBetweenRuns) {
18 this._lastRun = now;
19 callback();
20 }
21 }