mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Add master config for inlayHints to make disabling easy
This commit is contained in:
parent
6f2f9049da
commit
3bf5ef02c0
3 changed files with 13 additions and 7 deletions
|
@ -10,13 +10,13 @@ export function activateInlayHints(ctx: Ctx) {
|
|||
const maybeUpdater = {
|
||||
updater: null as null | HintsUpdater,
|
||||
async onConfigChange() {
|
||||
if (
|
||||
!ctx.config.inlayHints.typeHints &&
|
||||
!ctx.config.inlayHints.parameterHints &&
|
||||
!ctx.config.inlayHints.chainingHints
|
||||
) {
|
||||
return this.dispose();
|
||||
}
|
||||
const anyEnabled = ctx.config.inlayHints.typeHints
|
||||
|| ctx.config.inlayHints.parameterHints
|
||||
|| ctx.config.inlayHints.chainingHints;
|
||||
const enabled = ctx.config.inlayHints.enable && anyEnabled;
|
||||
|
||||
if (!enabled) return this.dispose();
|
||||
|
||||
await sleep(100);
|
||||
if (this.updater) {
|
||||
this.updater.syncCacheAndRenderHints();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue