Skip to content

Commit e29ee62

Browse files
authored
testing: fix icon on the margin doesn't work (microsoft#182094)
Fixes microsoft#182056
1 parent 67de6c1 commit e29ee62

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/vs/workbench/contrib/testing/browser/testingDecorations.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import { stripIcons } from 'vs/base/common/iconLabels';
1414
import { Iterable } from 'vs/base/common/iterator';
1515
import { Disposable, DisposableStore, IReference, MutableDisposable } from 'vs/base/common/lifecycle';
1616
import { ResourceMap } from 'vs/base/common/map';
17+
import { isMacintosh } from 'vs/base/common/platform';
18+
import { ThemeIcon } from 'vs/base/common/themables';
1719
import { Constants } from 'vs/base/common/uint';
1820
import { URI } from 'vs/base/common/uri';
1921
import { generateUuid } from 'vs/base/common/uuid';
2022
import { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
2123
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
2224
import { EditorOption } from 'vs/editor/common/config/editorOptions';
2325
import { overviewRulerError, overviewRulerInfo } from 'vs/editor/common/core/editorColorRegistry';
24-
import { IRange, Range } from 'vs/editor/common/core/range';
26+
import { IRange } from 'vs/editor/common/core/range';
2527
import { IEditorContribution } from 'vs/editor/common/editorCommon';
2628
import { IModelDeltaDecoration, ITextModel, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';
2729
import { IModelService } from 'vs/editor/common/services/model';
@@ -34,24 +36,22 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
3436
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
3537
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
3638
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
37-
import { ThemeIcon } from 'vs/base/common/themables';
3839
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
40+
import { EditorLineNumberContextMenu, GutterActionsRegistry } from 'vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu';
3941
import { getTestItemContextOverlay } from 'vs/workbench/contrib/testing/browser/explorerProjections/testItemContextOverlay';
4042
import { testingRunAllIcon, testingRunIcon, testingStatesToIcons } from 'vs/workbench/contrib/testing/browser/icons';
41-
import { DefaultGutterClickAction, getTestingConfiguration, TestingConfigKeys } from 'vs/workbench/contrib/testing/common/configuration';
42-
import { labelForTestInState, Testing } from 'vs/workbench/contrib/testing/common/constants';
43+
import { DefaultGutterClickAction, TestingConfigKeys, getTestingConfiguration } from 'vs/workbench/contrib/testing/common/configuration';
44+
import { Testing, labelForTestInState } from 'vs/workbench/contrib/testing/common/constants';
4345
import { TestId } from 'vs/workbench/contrib/testing/common/testId';
44-
import { ITestDecoration as IPublicTestDecoration, ITestingDecorationsService, TestDecorations } from 'vs/workbench/contrib/testing/common/testingDecorations';
45-
import { ITestingPeekOpener } from 'vs/workbench/contrib/testing/common/testingPeekOpener';
46-
import { isFailedState, maxPriority } from 'vs/workbench/contrib/testing/common/testingStates';
47-
import { buildTestUri, parseTestUri, TestUriType } from 'vs/workbench/contrib/testing/common/testingUri';
4846
import { ITestProfileService } from 'vs/workbench/contrib/testing/common/testProfileService';
4947
import { LiveTestResult } from 'vs/workbench/contrib/testing/common/testResult';
5048
import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService';
51-
import { getContextForTestItem, ITestService, testsInFile } from 'vs/workbench/contrib/testing/common/testService';
52-
import { IncrementalTestCollectionItem, InternalTestItem, IRichLocation, ITestMessage, ITestRunProfile, TestDiffOpType, TestMessageType, TestResultItem, TestResultState, TestRunProfileBitset } from 'vs/workbench/contrib/testing/common/testTypes';
53-
import { EditorLineNumberContextMenu, GutterActionsRegistry } from 'vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu';
54-
import { isMacintosh } from 'vs/base/common/platform';
49+
import { ITestService, getContextForTestItem, testsInFile } from 'vs/workbench/contrib/testing/common/testService';
50+
import { IRichLocation, ITestMessage, ITestRunProfile, IncrementalTestCollectionItem, InternalTestItem, TestDiffOpType, TestMessageType, TestResultItem, TestResultState, TestRunProfileBitset } from 'vs/workbench/contrib/testing/common/testTypes';
51+
import { ITestDecoration as IPublicTestDecoration, ITestingDecorationsService, TestDecorations } from 'vs/workbench/contrib/testing/common/testingDecorations';
52+
import { ITestingPeekOpener } from 'vs/workbench/contrib/testing/common/testingPeekOpener';
53+
import { isFailedState, maxPriority } from 'vs/workbench/contrib/testing/common/testingStates';
54+
import { TestUriType, buildTestUri, parseTestUri } from 'vs/workbench/contrib/testing/common/testingUri';
5555

5656
const MAX_INLINE_MESSAGE_LENGTH = 128;
5757

@@ -423,7 +423,7 @@ export class TestingDecorations extends Disposable implements IEditorContributio
423423
this._register(this.editor.onDidChangeModel(e => this.attachModel(e.newModelUrl || undefined)));
424424
this._register(this.editor.onMouseDown(e => {
425425
if (e.target.position && this.currentUri) {
426-
const modelDecorations = editor.getModel()?.getDecorationsInRange(Range.fromPositions(e.target.position)) ?? [];
426+
const modelDecorations = editor.getModel()?.getLineDecorations(e.target.position.lineNumber) ?? [];
427427
if (!modelDecorations.length) {
428428
return;
429429
}

0 commit comments

Comments
 (0)