Sublime Forum

LSP-typescript inline hints

#1

Wondering if anyone has been able to get the inline hints to work successfully for TypeScript/JavaScript files in Sublime Text 4. I installed both the LSP and LSP-typescript packages, installed TypeScript via NPM globally, enabled inline hints in the settings. So far, nothing works.

LSP.sublime-settings

{
  "show_inlay_hints": true,
}

LSP-typescript.sublime-settings

{
    "javascript.inlayHints.includeInlayEnumMemberValueHints": false,
    "javascript.inlayHints.includeInlayFunctionLikeReturnTypeHints": true,
    "javascript.inlayHints.includeInlayFunctionParameterTypeHints": true,
    "javascript.inlayHints.includeInlayParameterNameHints": "all", // none | literals | all
    "javascript.inlayHints.includeInlayParameterNameHintsWhenArgumentMatchesName": false,
    "javascript.inlayHints.includeInlayPropertyDeclarationTypeHints": true,
    "javascript.inlayHints.includeInlayVariableTypeHints": true,
    "javascript.inlayHints.includeInlayVariableTypeHintsWhenTypeMatchesName": false,
    "typescript.inlayHints.includeInlayEnumMemberValueHints": false,
    "typescript.inlayHints.includeInlayFunctionLikeReturnTypeHints": true,
    "typescript.inlayHints.includeInlayFunctionParameterTypeHints": true,
    "typescript.inlayHints.includeInlayParameterNameHints": "all", // none | literals | all
    "typescript.inlayHints.includeInlayParameterNameHintsWhenArgumentMatchesName": false,
    "typescript.inlayHints.includeInlayPropertyDeclarationTypeHints": true,
    "typescript.inlayHints.includeInlayVariableTypeHints": true,
    "typescript.inlayHints.includeInlayVariableTypeHintsWhenTypeMatchesName": false,
}

I installed the latest TypeScript via NPM, version 5.0.4. I am thinking about opening a bug in the GitHub repo for LSP-typescript but wanted to make sure I’m not doing something wrong.

0 Likes

#2

Does LSP-typescript work? Not talking about inlay hints.

0 Likes

#3

In terms of general functionality, yes, it does work. The only thing I do not see are the inlay hints, not sure why.

0 Likes

#4

Okay, turns out, I messed up the LSP-typescript.sublime-settings file. Everything is supposed to be nested under the settings object.

LSP-typescript.sublime-settings

{
  "settings": {
    ...
  }
}
0 Likes