Skip to content

Conversation

@angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Nov 14, 2022

This PR provides Inlay Hint preferences for JS/TS

image

All inlay hint are disabled by default.

If you enable for instance parameter name, you should see

image

Please note that you need to update the content of the editor need to bechange to refresh inlay hint

@angelozerr angelozerr marked this pull request as ready for review November 14, 2022 08:21
# *******************************************************************************/

# TypeScript Inlay Hints preference page
TypeScriptInlayHintPreferencePage_includeInlayEnumMemberValueHints=Enable/disable inlay hints for member values in enum declarations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace Enable/Disable with "Show".
Also please try to factorize the label "Show inlay hints for..."
so the checkbox items become only "member vaues in enum declaration", "implicity return ty[e on function signatures", and so on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to improve quickly the UI, do you like?

image

@angelozerr angelozerr force-pushed the typescript-preferences branch from e7f86f0 to 1bfc90b Compare November 14, 2022 13:30
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints_all=For literal and non-literal arguments.
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHintsWhenArgumentMatchesName=Show parameter name hints on arguments whose text is identical to the parameter name.
TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHints=Show inlay hints for variable type.
TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHintsWhenTypeMatchesName=Show variable type hints on variables whose name is identical to the type name. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHintsWhenTypeMatchesName=Show variable type hints on variables whose name is identical to the type name.
TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHintsWhenTypeMatchesName=also variables whose name is identical to the type name.

Ideally with an indent to show it refers to former checkbox.

TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints_literals=Only for literal arguments.
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints_all=For literal and non-literal arguments.
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHintsWhenArgumentMatchesName=Show parameter name hints on arguments whose text is identical to the parameter name.
TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHints=Show inlay hints for variable type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHints=Show inlay hints for variable type.
TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHints=Variable type

TypeScriptInlayHintPreferencePage_includeInlayFunctionLikeReturnTypeHints=implicit return types on function signatures.
TypeScriptInlayHintPreferencePage_includeInlayFunctionParameterTypeHints=function parameter type.
TypeScriptInlayHintPreferencePage_includeInlayPropertyDeclarationTypeHints=property declaration type.
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints=Show inlay hints for parameter names:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints=Show inlay hints for parameter names:
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints=Parameter names:

TypeScriptInlayHintPreferencePage_includeInlayFunctionParameterTypeHints=function parameter type.
TypeScriptInlayHintPreferencePage_includeInlayPropertyDeclarationTypeHints=property declaration type.
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints=Show inlay hints for parameter names:
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints_none=Disable parameter name hints.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints_none=Disable parameter name hints.
TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints_none=Never

Messages.TypeScriptInlayHintPreferencePage_includeInlayParameterNameHintsWhenArgumentMatchesName,
parent));

createSeparator(parent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid separator. If you want to separate blocks, just add a vertical space, not a line.

"literals" },
{ Messages.TypeScriptInlayHintPreferencePage_includeInlayParameterNameHints_all, "all" } },
parent));
addField(new BooleanFieldEditor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be indented in the UI so it's clearer it refers to former option?

createSeparator(parent);

addField(new BooleanFieldEditor(TYPESCRIPT_PREFERENCES_INLAY_HINTS_INCLUDE_INLAY_VARIABLE_TYPE_HINTS,
Messages.TypeScriptInlayHintPreferencePage_includeInlayVariableTypeHints, parent));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be indented in the UI so it's clearer it refers to former option?

Comment on lines 88 to 91
Label separator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
separator.setLayoutData(data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty label would be better (just a vertical space)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the label separator

@angelozerr
Copy link
Contributor Author

I will fix your comment but for UI I will see if I can fix that quickly but it should be nice if other people could improve the UI because I would prefer spending my time to provide another ui préférences like format and my main goal is to improve platform to fix insert spaces préférences for xml js etc, the feature that more and more users expect and they have with wtp and jsdt

@angelozerr angelozerr force-pushed the typescript-preferences branch from 1bfc90b to cd46281 Compare November 15, 2022 05:25
@angelozerr
Copy link
Contributor Author

@mickaelistria I have managed indentation for checkbox andremove label separator. here the result:

image

@mickaelistria
Copy link
Contributor

Thanks, this page looks much better!

@mickaelistria mickaelistria merged commit 6f723aa into eclipse-wildwebdeveloper:master Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants