Repository navigation
Provide a quick-fix for non-exported types #37440
Description
Activity
Daniel Rosenwasser (@DanielRosenwasser) / Ryan Cavanaugh (@RyanCavanaugh) I can get time and work on this. Quick question, which files generally have the code for Domain "Quick Fixes"?
DanielRosenwasser commented on Mar 19, 2020
It's all in src/services/codefixes/. Make sure you update src/services/tsconfig.json to include the new file for the quick fix. One similar code action would be in fixImplicitThis.ts which adds a this. to foo in
class C {
foo = 10;
bar() {
foo; // oops! needs to be prefixed with `this.`
}
}DanielRosenwasser commented on Mar 19, 2020
Sorry, I meant fixForgottenThisPropertyAccess.ts!
Thanks a lot :)
JJPIV yes, I am working on it
JJPIV please take this on if you still want to.
JJPIV Did you take this? If not I'd like to take a shot :)
I'm working on this issue, currently stuck at getting SourceFile object for a.ts, can anybody help me?
// @filename a.ts
declare function foo(): any
declare function bar(): any;
export { bar };
// @filename b.ts
import { foo, bar } from "./a";
Chunlin (@Qiyu8) I think that information is in the context that's passed to getCodeActions(context: CodeFixContext) in the arg object for registerCodeFix
AGMETEOR Thanks for your advise, would you mind reviewing the code?
Chunlin (@Qiyu8) I think Daniel Rosenwasser (@DanielRosenwasser) is the one that reviews. I am also still quite a new contributor :)
I assume nobody is working on this at the moment? If so, I would like to take a shot Daniel Rosenwasser (@DanielRosenwasser)
DanielRosenwasser commented on Oct 13, 2022
Thank you Oleksandr Tarasiuk (@a-tarasyuk)!
In #36187, Oleksandr Tarasiuk (@a-tarasyuk) wrote up a handy error message for non-exported types. We should provide a quick fix to add the
exportmodifier for declarations like this that aren't innode_modulesand the like.