You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Declare property quick fix should add private properties (or be configurable) #36249
Yeah, it sounds like the original quick fix is asking us to change the existing quick fix to add a private modifier to the property in TypeScript files, and maybe a /** @private */ doc comment in a JavaScript files?
Of course if it's a separate action you'll soon have "why isn't there an action for protected if you allow private and public?".
I think, better to make a new action for that case. We can start by adding new QF action for private declaration, and see if it makes sense to add QF action for protected properties. What do you think?
Activity
a-tarasyuk commentedon Jan 28, 2020
Should TS suggest a new QF for properties that start from
_(Declare private property '_bar')? OrDeclare property '_bar'QF should handle that?cc Daniel Rosenwasser (@DanielRosenwasser)
DanielRosenwasser commentedon Jan 28, 2020
Yeah, it sounds like the original quick fix is asking us to change the existing quick fix to add a
privatemodifier to the property in TypeScript files, and maybe a/** @private */doc comment in a JavaScript files?What's preferable here?
a-tarasyuk commentedon Jan 29, 2020
Daniel Rosenwasser (@DanielRosenwasser)
TypeScript
After QF
Is it a right example for TypeScript?
The following example is a valid JavaScript code
Where do we need to add
/** @private */JSDoc?DanielRosenwasser commentedon Jan 29, 2020
Yeah, I guess the JS case doesn't need that... hmm.
But yes, I think the TS example you had is what what the quick fix should do. It's not clear whether it should be a separate action or not though.
DanielRosenwasser commentedon Jan 29, 2020
I'm inclined to experiment with keeping it as part of the same action and seeing if users are unhappy about it.
DanielRosenwasser commentedon Jan 29, 2020
But then I think there will be a question of "why don't you always make my properties private regardless of the
_?"JacksonKearl commentedon Jan 29, 2020
Daniel Rosenwasser (@DanielRosenwasser) I personally don't tend to prefix privates with underscores, so I'd like it to be a separate action.
Of course if it's a separate action you'll soon have "why isn't there an action for protected if you allow private and public?".
a-tarasyuk commentedon Jan 31, 2020
I think, better to make a new action for that case. We can start by adding new QF action for
privatedeclaration, and see if it makes sense to add QF action forprotectedproperties. What do you think?cc Daniel Rosenwasser (@DanielRosenwasser) Jackson Kearl (@JacksonKearl)
JacksonKearl commentedon Jan 31, 2020
Adding just a separate QF for private seems fine for now.