Skip to content

Commit ae15d09

Browse files
committed
Mark injected service properties as readonly
1 parent 8602124 commit ae15d09

52 files changed

Lines changed: 147 additions & 147 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/vs/editor/browser/services/bulkEdit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class BulkEdit {
271271
constructor(
272272
editor: ICodeEditor,
273273
progress: IProgressRunner,
274-
@ITextModelService private _textModelService: ITextModelService,
274+
@ITextModelService private readonly _textModelService: ITextModelService,
275275
@optional(IFileService) private _fileService: IFileService
276276
) {
277277
this._editor = editor;

src/vs/editor/contrib/codelens/codelensController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
3636

3737
constructor(
3838
private _editor: editorBrowser.ICodeEditor,
39-
@ICommandService private _commandService: ICommandService,
40-
@IMessageService private _messageService: IMessageService
39+
@ICommandService private readonly _commandService: ICommandService,
40+
@IMessageService private readonly _messageService: IMessageService
4141
) {
4242
this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens;
4343

src/vs/editor/contrib/colorPicker/colorDetector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export class ColorDetector implements IEditorContribution {
3939
private _isEnabled: boolean;
4040

4141
constructor(private _editor: ICodeEditor,
42-
@ICodeEditorService private _codeEditorService: ICodeEditorService,
43-
@IConfigurationService private _configurationService: IConfigurationService
42+
@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,
43+
@IConfigurationService private readonly _configurationService: IConfigurationService
4444
) {
4545
this._globalToDispose.push(_editor.onDidChangeModel((e) => {
4646
this._isEnabled = this.isEnabled();

src/vs/editor/contrib/contextmenu/contextmenu.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export class ContextMenuController implements IEditorContribution {
4040

4141
constructor(
4242
editor: ICodeEditor,
43-
@IContextMenuService private _contextMenuService: IContextMenuService,
44-
@IContextViewService private _contextViewService: IContextViewService,
45-
@IContextKeyService private _contextKeyService: IContextKeyService,
46-
@IKeybindingService private _keybindingService: IKeybindingService,
47-
@IMenuService private _menuService: IMenuService
43+
@IContextMenuService private readonly _contextMenuService: IContextMenuService,
44+
@IContextViewService private readonly _contextViewService: IContextViewService,
45+
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
46+
@IKeybindingService private readonly _keybindingService: IKeybindingService,
47+
@IMenuService private readonly _menuService: IMenuService
4848
) {
4949
this._editor = editor;
5050

src/vs/editor/contrib/find/findController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ export class FindController extends CommonFindController implements IFindControl
362362

363363
constructor(
364364
editor: ICodeEditor,
365-
@IContextViewService private _contextViewService: IContextViewService,
366-
@IContextKeyService private _contextKeyService: IContextKeyService,
367-
@IKeybindingService private _keybindingService: IKeybindingService,
368-
@IThemeService private _themeService: IThemeService,
365+
@IContextViewService private readonly _contextViewService: IContextViewService,
366+
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
367+
@IKeybindingService private readonly _keybindingService: IKeybindingService,
368+
@IThemeService private readonly _themeService: IThemeService,
369369
@IStorageService storageService: IStorageService,
370370
@optional(IClipboardService) clipboardService: IClipboardService
371371
) {

src/vs/editor/contrib/find/simpleFindWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export abstract class SimpleFindWidget extends Widget {
3333
protected _updateHistoryDelayer: Delayer<void>;
3434

3535
constructor(
36-
@IContextViewService private _contextViewService: IContextViewService,
36+
@IContextViewService private readonly _contextViewService: IContextViewService,
3737
private animate: boolean = true
3838
) {
3939
super();

src/vs/editor/contrib/gotoError/gotoError.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,9 @@ class MarkerController implements editorCommon.IEditorContribution {
430430

431431
constructor(
432432
editor: ICodeEditor,
433-
@IMarkerService private _markerService: IMarkerService,
434-
@IContextKeyService private _contextKeyService: IContextKeyService,
435-
@IThemeService private _themeService: IThemeService
433+
@IMarkerService private readonly _markerService: IMarkerService,
434+
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
435+
@IThemeService private readonly _themeService: IThemeService
436436
) {
437437
this._editor = editor;
438438
this._markersNavigationVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService);

src/vs/editor/contrib/hover/hover.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export class ModesHoverController implements editorCommon.IEditorContribution {
5656
}
5757

5858
constructor(editor: ICodeEditor,
59-
@IOpenerService private _openerService: IOpenerService,
60-
@IModeService private _modeService: IModeService
59+
@IOpenerService private readonly _openerService: IOpenerService,
60+
@IModeService private readonly _modeService: IModeService
6161
) {
6262
this._editor = editor;
6363

src/vs/editor/contrib/referenceSearch/referencesController.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ export class ReferencesController implements editorCommon.IEditorContribution {
5555
public constructor(
5656
editor: ICodeEditor,
5757
@IContextKeyService contextKeyService: IContextKeyService,
58-
@IEditorService private _editorService: IEditorService,
59-
@ITextModelService private _textModelResolverService: ITextModelService,
60-
@IMessageService private _messageService: IMessageService,
61-
@IInstantiationService private _instantiationService: IInstantiationService,
62-
@IWorkspaceContextService private _contextService: IWorkspaceContextService,
63-
@IStorageService private _storageService: IStorageService,
64-
@IThemeService private _themeService: IThemeService,
65-
@IConfigurationService private _configurationService: IConfigurationService,
58+
@IEditorService private readonly _editorService: IEditorService,
59+
@ITextModelService private readonly _textModelResolverService: ITextModelService,
60+
@IMessageService private readonly _messageService: IMessageService,
61+
@IInstantiationService private readonly _instantiationService: IInstantiationService,
62+
@IWorkspaceContextService private readonly _contextService: IWorkspaceContextService,
63+
@IStorageService private readonly _storageService: IStorageService,
64+
@IThemeService private readonly _themeService: IThemeService,
65+
@IConfigurationService private readonly _configurationService: IConfigurationService,
6666
@optional(IEnvironmentService) private _environmentService: IEnvironmentService
6767
) {
6868
this._editor = editor;

src/vs/editor/contrib/referenceSearch/referencesWidget.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class DecorationsManager implements IDisposable {
164164
class DataSource implements tree.IDataSource {
165165

166166
constructor(
167-
@ITextModelService private _textModelResolverService: ITextModelService
167+
@ITextModelService private readonly _textModelResolverService: ITextModelService
168168
) {
169169
//
170170
}
@@ -305,7 +305,7 @@ class FileReferencesTemplate {
305305

306306
constructor(
307307
container: HTMLElement,
308-
@IWorkspaceContextService private _contextService: IWorkspaceContextService,
308+
@IWorkspaceContextService private readonly _contextService: IWorkspaceContextService,
309309
@optional(IEnvironmentService) private _environmentService: IEnvironmentService,
310310
@IThemeService themeService: IThemeService,
311311
) {
@@ -372,8 +372,8 @@ class Renderer implements tree.IRenderer {
372372
};
373373

374374
constructor(
375-
@IWorkspaceContextService private _contextService: IWorkspaceContextService,
376-
@IThemeService private _themeService: IThemeService,
375+
@IWorkspaceContextService private readonly _contextService: IWorkspaceContextService,
376+
@IThemeService private readonly _themeService: IThemeService,
377377
@optional(IEnvironmentService) private _environmentService: IEnvironmentService,
378378
) {
379379
//

0 commit comments

Comments
 (0)