feat(inlay-hints): add configurable parameter name hints
Adds configurable inlay hints for TCL procedures and merges signatures from built-ins and workspace files. The feature supports parameterNames and suppressWhenArgumentMatchesName and respects an optional range filter and current-file priority. - Introduces built-in and custom inlay hint builders - Honors inlayHints parameterNames and suppression options - Adds tests validating hints, ranges, and priority rules
This commit is contained in:
@@ -18,6 +18,12 @@ export interface ISettings {
|
||||
interpreter: string[]
|
||||
importStrategy: string
|
||||
showNotifications: string
|
||||
formatter: boolean
|
||||
inlayHint: boolean
|
||||
inlayHints: {
|
||||
parameterNames: "all" | "literals" | "none"
|
||||
suppressWhenArgumentMatchesName: boolean
|
||||
}
|
||||
}
|
||||
|
||||
export function getExtensionSettings(
|
||||
@@ -80,7 +86,13 @@ export async function getWorkspaceSettings(
|
||||
importStrategy: config.get<string>(`importStrategy`) ?? "useBundled",
|
||||
showNotifications: config.get<string>(`showNotifications`) ?? "off",
|
||||
formatter: config.get<boolean>(`formatter`) ?? true,
|
||||
inlayHint: config.get<boolean>(`inlayHint`) ?? true
|
||||
inlayHint: config.get<boolean>(`inlayHint`) ?? true,
|
||||
inlayHints: {
|
||||
parameterNames:
|
||||
config.get<"all" | "literals" | "none">(`inlayHints.parameterNames`) ?? "all",
|
||||
suppressWhenArgumentMatchesName:
|
||||
config.get<boolean>(`inlayHints.suppressWhenArgumentMatchesName`) ?? true
|
||||
}
|
||||
}
|
||||
return workspaceSetting
|
||||
}
|
||||
@@ -113,7 +125,13 @@ export async function getGlobalSettings(
|
||||
importStrategy: getGlobalValue<string>(config, "importStrategy", "useBundled"),
|
||||
showNotifications: getGlobalValue<string>(config, "showNotifications", "off"),
|
||||
formatter: config.get<boolean>(`formatter`) ?? true,
|
||||
inlayHint: config.get<boolean>(`inlayHint`) ?? true
|
||||
inlayHint: config.get<boolean>(`inlayHint`) ?? true,
|
||||
inlayHints: {
|
||||
parameterNames:
|
||||
config.get<"all" | "literals" | "none">(`inlayHints.parameterNames`) ?? "all",
|
||||
suppressWhenArgumentMatchesName:
|
||||
config.get<boolean>(`inlayHints.suppressWhenArgumentMatchesName`) ?? true
|
||||
}
|
||||
}
|
||||
return setting
|
||||
}
|
||||
@@ -129,7 +147,9 @@ export function checkIfConfigurationChanged(
|
||||
`${namespace}.importStrategy`,
|
||||
`${namespace}.showNotifications`,
|
||||
`${namespace}.formatter`,
|
||||
`${namespace}.inlayHint`
|
||||
`${namespace}.inlayHint`,
|
||||
`${namespace}.inlayHints.parameterNames`,
|
||||
`${namespace}.inlayHints.suppressWhenArgumentMatchesName`
|
||||
]
|
||||
const changed = settings.map((s) => e.affectsConfiguration(s))
|
||||
return changed.includes(true)
|
||||
|
||||
Reference in New Issue
Block a user