mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Add override keyword in codebase (#120755)
For #120675 This uses a script to add the override keyword to places that need it in the codebase Note that we can't enable the --noImplicitOverride setting yet since there are still around 200 errors that require further attention
This commit is contained in:
@@ -300,32 +300,32 @@ export class View extends ViewEventHandler {
|
||||
}
|
||||
|
||||
// --- begin event handlers
|
||||
public handleEvents(events: viewEvents.ViewEvent[]): void {
|
||||
public override handleEvents(events: viewEvents.ViewEvent[]): void {
|
||||
super.handleEvents(events);
|
||||
this._scheduleRender();
|
||||
}
|
||||
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
this._configPixelRatio = this._context.configuration.options.get(EditorOption.pixelRatio);
|
||||
this.domNode.setClassName(this._getEditorClassName());
|
||||
this._applyLayout();
|
||||
return false;
|
||||
}
|
||||
public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {
|
||||
public override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {
|
||||
this._selections = e.selections;
|
||||
return false;
|
||||
}
|
||||
public onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {
|
||||
public override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {
|
||||
this.domNode.setClassName(this._getEditorClassName());
|
||||
return false;
|
||||
}
|
||||
public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {
|
||||
public override onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean {
|
||||
this.domNode.setClassName(this._getEditorClassName());
|
||||
return false;
|
||||
}
|
||||
|
||||
// --- end event handlers
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
if (this._renderAnimationFrame !== null) {
|
||||
this._renderAnimationFrame.dispose();
|
||||
this._renderAnimationFrame = null;
|
||||
|
||||
@@ -36,7 +36,7 @@ export class ViewOverlays extends ViewPart implements IVisibleLinesHost<ViewOver
|
||||
this.domNode.setClassName('view-overlays');
|
||||
}
|
||||
|
||||
public shouldRender(): boolean {
|
||||
public override shouldRender(): boolean {
|
||||
if (super.shouldRender()) {
|
||||
return true;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export class ViewOverlays extends ViewPart implements IVisibleLinesHost<ViewOver
|
||||
return false;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
super.dispose();
|
||||
|
||||
for (let i = 0, len = this._dynamicOverlays.length; i < len; i++) {
|
||||
@@ -79,7 +79,7 @@ export class ViewOverlays extends ViewPart implements IVisibleLinesHost<ViewOver
|
||||
|
||||
// ----- event handlers
|
||||
|
||||
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
this._visibleLines.onConfigurationChanged(e);
|
||||
const startLineNumber = this._visibleLines.getStartLineNumber();
|
||||
const endLineNumber = this._visibleLines.getEndLineNumber();
|
||||
@@ -89,29 +89,29 @@ export class ViewOverlays extends ViewPart implements IVisibleLinesHost<ViewOver
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public onFlushed(e: viewEvents.ViewFlushedEvent): boolean {
|
||||
public override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {
|
||||
return this._visibleLines.onFlushed(e);
|
||||
}
|
||||
public onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {
|
||||
public override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {
|
||||
this._isFocused = e.isFocused;
|
||||
return true;
|
||||
}
|
||||
public onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {
|
||||
public override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {
|
||||
return this._visibleLines.onLinesChanged(e);
|
||||
}
|
||||
public onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {
|
||||
public override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {
|
||||
return this._visibleLines.onLinesDeleted(e);
|
||||
}
|
||||
public onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {
|
||||
public override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {
|
||||
return this._visibleLines.onLinesInserted(e);
|
||||
}
|
||||
public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {
|
||||
public override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {
|
||||
return this._visibleLines.onScrollChanged(e) || true;
|
||||
}
|
||||
public onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {
|
||||
public override onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {
|
||||
return this._visibleLines.onTokensChanged(e);
|
||||
}
|
||||
public onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {
|
||||
public override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {
|
||||
return this._visibleLines.onZonesChanged(e);
|
||||
}
|
||||
|
||||
@@ -224,19 +224,19 @@ export class ContentViewOverlays extends ViewOverlays {
|
||||
|
||||
// --- begin event handlers
|
||||
|
||||
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
const options = this._context.configuration.options;
|
||||
const layoutInfo = options.get(EditorOption.layoutInfo);
|
||||
this._contentWidth = layoutInfo.contentWidth;
|
||||
return super.onConfigurationChanged(e) || true;
|
||||
}
|
||||
public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {
|
||||
public override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {
|
||||
return super.onScrollChanged(e) || e.scrollWidthChanged;
|
||||
}
|
||||
|
||||
// --- end event handlers
|
||||
|
||||
_viewOverlaysRender(ctx: RestrictedRenderingContext): void {
|
||||
override _viewOverlaysRender(ctx: RestrictedRenderingContext): void {
|
||||
super._viewOverlaysRender(ctx);
|
||||
|
||||
this.domNode.setWidth(Math.max(ctx.scrollWidth, this._contentWidth));
|
||||
@@ -260,7 +260,7 @@ export class MarginViewOverlays extends ViewOverlays {
|
||||
Configuration.applyFontInfo(this.domNode, options.get(EditorOption.fontInfo));
|
||||
}
|
||||
|
||||
public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
public override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {
|
||||
const options = this._context.configuration.options;
|
||||
Configuration.applyFontInfo(this.domNode, options.get(EditorOption.fontInfo));
|
||||
const layoutInfo = options.get(EditorOption.layoutInfo);
|
||||
@@ -268,11 +268,11 @@ export class MarginViewOverlays extends ViewOverlays {
|
||||
return super.onConfigurationChanged(e) || true;
|
||||
}
|
||||
|
||||
public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {
|
||||
public override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {
|
||||
return super.onScrollChanged(e) || e.scrollHeightChanged;
|
||||
}
|
||||
|
||||
_viewOverlaysRender(ctx: RestrictedRenderingContext): void {
|
||||
override _viewOverlaysRender(ctx: RestrictedRenderingContext): void {
|
||||
super._viewOverlaysRender(ctx);
|
||||
const height = Math.min(ctx.scrollHeight, 1000000);
|
||||
this.domNode.setHeight(height);
|
||||
|
||||
@@ -18,7 +18,7 @@ export abstract class ViewPart extends ViewEventHandler {
|
||||
this._context.addEventHandler(this);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
this._context.removeEventHandler(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user