Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refactor to enforce override usage #3959

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/client/src/Subscribables/StoreValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class StoreValueImpl<T> extends AbstractSubscribable<T> implements StoreValue<T>
return;
}

subscribe(s: SubscriberLike<T>) {
override subscribe(s: SubscriberLike<T>) {
const dispose = super.subscribe(s);
const sFn = toSubscriberFn(s);
sFn(this._value);
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/Subscribables/SubscribableView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class ViewImpl<T> extends SubscribableImpl<T> implements SubscribableView<T> {
return this._value === symbolNoValue ? undefined : this._value;
}

protected notify(value: T): void {
protected override notify(value: T): void {
this._value = value;
super.notify(value);
}

subscribe(s: SubscriberLike<T>) {
override subscribe(s: SubscriberLike<T>) {
const dispose = super.subscribe(s);
if (this._value !== symbolNoValue) {
const sFn = toSubscriberFn(s);
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/Subscribables/internal/EmitterImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type { SubscribableSubscriber } from '../Subscribables';
import { AbstractSubscribable } from './AbstractSubscribable';

export class EmitterImpl<T> extends AbstractSubscribable<T> implements SubscribableSubscriber<T> {
public notify(value: T) {
public override notify(value: T) {
super.notify(value);
}

public done() {
public override done() {
super.done();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export class SubscribableImpl<T> extends AbstractSubscribable<T> {
this._source = subscribe;
}

protected _stop() {
protected override _stop() {
super._stop();
disposeOf(this._dispose);
this._dispose = undefined;
}

protected _start() {
protected override _start() {
super._start();
if (this._isRunning && !this._dispose) {
this._dispose = subscribeTo(this._source, { notify: (v) => this.notify(v), done: () => this.done() });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class SubscribableDelayedUnsubscribeImpl<T> extends SubscribableImpl<T> {
this._handleTimeout = undefined;
}

protected _tryToStop(): void {
protected override _tryToStop(): void {
this.clearTimeout();
this._handleTimeout = setTimeout(() => {
if (this._hasSubscribers()) return;
this._stop();
}, this._timeout);
}

protected done() {
protected override done() {
this.clearTimeout();
super.done();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/actionMenu.mts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ActionButtonItem implements vscode.QuickInputButton {

class CommandButtonItem extends ActionButtonItem {
constructor(
public iconPath: vscode.ThemeIcon,
public override iconPath: vscode.ThemeIcon,
public command: vscode.Command,
) {
super(new vscode.ThemeIcon('gear'), command.tooltip ?? command.title, commandFn(command));
Expand Down Expand Up @@ -218,7 +218,7 @@ class MenuItem implements ActionMenuItem {
class CommandMenuItem extends MenuItem {
constructor(
readonly command: vscode.Command,
public description?: string,
public override description?: string,
) {
super(command.title, description, commandFn(command));
}
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/repl/emitterToWriteStream.mts
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ class ReadableEmitter extends stream.Readable {
});
}

_read() {
override _read() {
this.paused = false;
this.pushBuffer();
}

_destroy() {
override _destroy() {
this.disposable.dispose();
}

Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/settings/DictionaryHelper.mts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export class DictionaryTargetError extends Error {
constructor(
msg: string,
readonly dictTarget: DictionaryTarget,
readonly cause: Error | unknown,
override readonly cause: Error | unknown,
) {
super(msg);
}
Expand All @@ -429,7 +429,7 @@ export class UnableToAddWordError extends DictionaryTargetError {
msg: string,
dictTarget: DictionaryTarget,
readonly words: string | string[],
readonly cause: Error | unknown,
override readonly cause: Error | unknown,
) {
super(msg, dictTarget, cause);
}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"esModuleInterop": true,
"newLine": "LF",
"noImplicitAny": true,
"noImplicitOverride": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
Loading