-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Revisit and remove unused code #38414
Comments
Thanks for this. Done. |
Also it would be great if you could re-generate this list in like a week, so I can do another pass to check if I missed something. |
Sure. Tho it takes roughly 90mins... I'll update later today or tomorrow |
Re-running it right now... This time a reference to a test doesn't count so expect more symbols to be flagged as 🗑 |
FYI, I have updated the list with symbols that are only referenced from tests and it's now sorted by save-potential |
@jrieken thanks for doing this. I cleaned up my code. Can we for the next run exclude taskConfiguration.ts. It has a lot of false positives since I use structural typing with namespace but a namespace can't implement an interface. These methods are used, although not always referenced directly: isEmpty(value: T): boolean;
assignProperties(target: T, source: T): T;
fillProperties(target: T, source: T): T;
fillDefaults(value: T, context: ParseContext): T;
freeze(value: T): Readonly<T>; Alternatively I could rewrite everything to use classes and then implement the |
@dbaeumer Sure, exclusion aren't easy to add. |
Gotta exclude this:
|
@bpasero Is it possible that |
@bpasero Can you take another look at the builder... There is still lot of unused stuff in there, also those that the tool doesn't find because overloads are used, e.g. public margin(margin: string): Builder;
public margin(top: number, right?: number, bottom?: number, left?: number): Builder;
public margin(top: string, right?: string, bottom?: string, left?: string): Builder;
public margin(top: any, right?: any, bottom?: any, left?: any): Builder {
if (types.isString(top) && top.indexOf(' ') >= 0) {
return this.margin.apply(this, top.split(' ')); |
@jrieken yeah, though there can be implicit usages because in the |
😱 no type-safety? |
Dude, builder is from a time where there was no type safety... |
@jrieken assigning to you to decide if this should be closed since it shows up in my inbox tracker query |
We should revisit our source code and remove things we don't use. I have used the https://github.com/jrieken/ts-unused to find symbols we don't use. Take its result with a grain of salt, the results are based on calling reference search and that means some structural typing tricks aren't seen as usage/reference.
out2.txt,out3.txt,out4.txt,out5.txt,out6.txt,out7.txt
cc @Microsoft/vscode
The text was updated successfully, but these errors were encountered: