-
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
Gets rid of registerDecorationType in inlay hints controller #136517
Conversation
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.
Left some, for future please don't do "unrelated" change renaming variables because that makes review unnecessary complex.
Tho, not sure what the overall motivation is? Is before/afterInjectedText going aways?
@@ -209,13 +208,14 @@ export class InlayHintsController implements IEditorContribution { | |||
return result; | |||
} | |||
|
|||
private readonly ruleFactory = new DynamicCssRules(this._editor); |
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.
nit - _
prefix for privates, also move atop ctor
.replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`); | ||
} | ||
|
||
function themeColorToCssVar(themeColor: ThemeColor): string { |
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.
There is asCssVariableName
* Reference counting and delayed garbage collection ensure that no rules leak. | ||
*/ | ||
export class DynamicCssRules { | ||
private counter = 0; |
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.
nit - more _
for privates
Yes. Ideally, everything related to "decoration types" is going away, as its implementation is very complicated. |
051dbe7
to
39c7f7b
Compare
See #132537.
The utility introduced by this PR can be made a general utility later.