Skip to content

Conversation

@zanmato
Copy link

@zanmato zanmato commented Sep 17, 2025

Closes zed-industries/zed#7086

This adds support for inlay hints by responding to the workspace/configuration request.

{
  "lsp": {
    "vue": {
      "settings": {
        "vue.inlayHints.inlineHandlerLeading": true,
        "vue.inlayHints.missingProps": true,
        "vue.inlayHints.optionsWrapper": true,
        "vue.inlayHints.vBindShorthand": true
      }
    }
  }
}

@cla-bot cla-bot bot added the cla-signed label Sep 17, 2025
@zanmato
Copy link
Author

zanmato commented Sep 17, 2025

There is quite some work needed to support 3.x.x. This just adds it for the old 2.2.8 version

Copy link
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

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

Thanks for this!

I wanted to quickly test this, but was unfortunately unable to make it work. Could you add a quick video showcasing this and/or provide a reproduction case? Thanks!

extension.toml Outdated
# REFACTOR is explicitly disabled, as vue-lsp does not adhere to LSP protocol for code actions with these - it
# sends back a CodeAction with neither `command` nor `edits` fields set, which is against the spec.
code_action_kinds = ["", "quickfix", "refactor.rewrite"]
supports_inlay_hints = true
Copy link
Contributor

Choose a reason for hiding this comment

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

This key does not exist, so we can remove it

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I found it in some other zed extension while I was debugging this. I've removed it

@zanmato
Copy link
Author

zanmato commented Oct 4, 2025

Sure, here are the steps to test it,

  • Create a vue typescript project
$ npx create-vue@latest zed-vue-test
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

┌  Vue.js - The Progressive JavaScript Framework
│
◇  Select features to include in your project: (↑/↓ to navigate, space to select, a to toggle all, enter to confirm)
│  TypeScript
│
◇  Select experimental features to include in your project: (↑/↓ to navigate, space to select, a to toggle all, enter to confirm)
│  none
│
◇  Skip all example code and start with a blank Vue project?
│  No

Scaffolding project in /mnt/dev/src/zed-vue-test...
│
└  Done. Now run:

   cd zed-vue-test
   npm install
   npm run dev
  • Install deps npm i
  • Open it in zed
  • Open App.vue
  • Remove the msg prop from <HelloWorld> (this should give an inlay hint with the missingProps setting enabled)
image
  • Replace the vue extension with this developer extension
  • Add the inlay hint config
{
  "lsp": {
    "vue": {
      "settings": {
        "vue.inlayHints.inlineHandlerLeading": true,
        "vue.inlayHints.missingProps": true,
        "vue.inlayHints.optionsWrapper": true,
        "vue.inlayHints.vBindShorthand": true
      }
    }
  }
}

You will now get an inlay hint for the missing msg prop
image

@MrSubidubi
Copy link
Contributor

Sorry for the delayed response here!

Tried again with exactly your steps, but sadly still does not seem to be working for me at least :/

Given that it visibily works for you, I'd still be happy to merge it for the time being, thank you very much for the detailed follow-up.

However, one final question: Anything against having this enabled by default?

@zanmato
Copy link
Author

zanmato commented Oct 28, 2025

Strange that it isn't working for you. Not sure what the drawbacks of having it enabled by default are. All I know is that it is disabled by default in vscode

@MrSubidubi
Copy link
Contributor

Generally I'd like inlay hints to be available in Zed by default if they are enabled in the Zed settings. Mind changing it to on by default and perhaps adding a small section on this to the README? If we see that this causes issues down the road, we could always adjust it I guess

@aizigao
Copy link

aizigao commented Nov 28, 2025

it work well after 0.2.9, I think this should be merged, @smitbarmase can you merge it please

 "lsp": {
    "vue": {
      "settings": {
        "vue.inlayHints.inlineHandlerLeading": true,
        "vue.inlayHints.missingProps": true,
        "vue.inlayHints.optionsWrapper": true,
        "vue.inlayHints.vBindShorthand": true,
        "vue.suggest.propNameCasing": "alwaysCamelCase",
        "vue.suggest.componentNameCasing": "preferPascalCase",
        "vue.autoInsert.dotValue": true
      }
    },

And I think we also need to add some description in the README mentioning that the config items can be found in https://github.com/vuejs/language-tools/blob/master/extensions/vscode/package.json#L248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vue support inlay hints

3 participants