-
Notifications
You must be signed in to change notification settings - Fork 30
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
VSCode extension: Useless inlay hints #16
Comments
I'm going to remove the inlay hints on named arguments and add a flag to disable inlay hints dynamically.
but I'm not sure how to process the positional arguments. It is not suitable to determine whether a name is general enough by lsp, which highly depends on personal sense. That means if you don't like positional arguments, you should disable it totally. |
I was mainly thinking about "body", since this is a very common argument name. But I understand why you wouldn't want to add a list of exceptions. Maybe there should be a way to disable inlay hint only in math mode, though. |
I like that! |
After thinking of it a bit, I can provides two special patterns of code to enable/disable individually:
The inlay hints will not show if any pattern hits. This is how to configure it. First, we have the simple switch to enable/disable/partially enable inlay hints. {
"tinymist.inlayHints": "on" | "off" | "smart" // default: smart
} I prefer to use
And then you can configure (like how you controls margins/paddings {
"tinymist.inlayHints": {
"onSinglePositionalArgument": "off",
"onContentBlockArgument": "on",
"rest": "on" // set default values to on or off
}
} |
To be clear, {
"tinymist.inlayHints": "smart"
} is equivalent to {
"tinymist.inlayHints": {
"onSinglePositionalArgument": "off",
"onContentBlockArgument": "on",
"rest": "on"
}
} ? If so, I like the customizability, and the fact that you get a sensible behavior by default with |
Yes. The string values of the [
// the following two are equivalent:
{ "tinymist.inlayHints": "on" }
{ "tinymist.inlayHints": { rest: "on" } }
// the following two are equivalent:
{ "tinymist.inlayHints": "off" }
{ "tinymist.inlayHints": { rest: "off" } }
// the following two are equivalent:
{ "tinymist.inlayHints": "smart" }
{
"tinymist.inlayHints": {
"onSinglePositionalArgument": "off",
// "onContentBlockArgument": "on",
"rest": "on"
}
}
] |
I have found another design question today, that the The alternative enumerate values to replace |
I think |
Describe the bug
Sometimes, inlay hints are displayed even when not necessary.
To Reproduce
Create a new Typst file with the following contents.
Notice how hints appears after
"hey"
andM
.Expected behavior
The hint after
"hey"
should not exist, because the this is a named parameter and the hint is therefore redundant.The hint after
M
is useless ("body" does not convey any additional information), and it takes up horizontal space for nothing. I think inlay hints should not appear for arguments namedbody
(and maybe some other highly generic names).Additionally, I think there should be a way to disable inlay hints, as some people don't like this feature.
Package/Software version
tinymist extension version:
v0.10.1
The text was updated successfully, but these errors were encountered: