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
Defer RichEditBrackets creation #38659
Defer RichEditBrackets creation #38659
Conversation
d1e7f97
to
a34efaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM, thank you! Just a small preference of mine to initialize all fields in the ctor please.
public readonly electricChars: { [key: string]: boolean; }; | ||
|
||
private readonly _languageIdentifier: LanguageIdentifier; | ||
private _electricChars: { [key: string]: boolean; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit-pick: To avoid a hidden class mutation at runtime, I prefer to have all members initialized in the ctor. Can you please add this._electricChars = null;
@@ -46,18 +46,20 @@ export interface IIndentConverter { | |||
export class RichEditSupport { | |||
|
|||
private readonly _conf: LanguageConfiguration; | |||
private readonly _languageIdentifier: LanguageIdentifier; | |||
private _brackets: RichEditBrackets; | |||
private _electricCharacter: BracketElectricCharacterSupport; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
Can you please add this._brackets = null; this._electricCharacter = null;
**Bug** `RichEditBrackets` are currently created eagerly pretty early in startup. This can be a fairly call as well. **fix** Lazily create `RichEditBrackets` instead
c4df90a
to
812128c
Compare
Nice! |
Bug
RichEditBrackets
are currently created eagerly pretty early in startupfix
Lazily create
RichEditBrackets
instead