Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Hover service on keywords (language server)
Hover service on keywords (language server) [message #1859972] Fri, 07 July 2023 08:44 Go to next message
Eclipse UserFriend
Hi,

I'm developing a VS Code extension for my DSL developed with Xtext.
I am currently working on Hover Services for my language server.

Do you know if it is possible to add content when hovering over the keywords to add a short description?
For example in xtext-languageserver-example, when we hover over the keyword "Hello", we would have a description that is displayed.

I tried to make a CustomHoverServices which extends from HoverServices, overriding the getContents method and filtering the elements by Keyword but it didn't work.

Do you have an idea ?

Thank you.

[Updated on: Fri, 07 July 2023 08:48] by Moderator

Re: Hover service on keywords (language server) [message #1859973 is a reply to message #1859972] Fri, 07 July 2023 08:53 Go to previous messageGo to next message
Eclipse UserFriend
how does your impl look like? see also https://blogs.itemis.com/en/xtext-usability-hovers-on-keywords
Re: Hover service on keywords (language server) [message #1859975 is a reply to message #1859973] Fri, 07 July 2023 09:50 Go to previous messageGo to next message
Eclipse UserFriend
I currently have a UI plugin that already has the ability to hover over keywords in an Eclipse runtime.
I'm looking to reproduce this behavior in Visual Studio Code through my language server, by adding the functionality in my IDE plugin.

I tried to exploit your example here to do this but was unsuccessful.

Do you need more information about my implementation?

[Updated on: Fri, 07 July 2023 09:51] by Moderator

Re: Hover service on keywords (language server) [message #1859982 is a reply to message #1859975] Fri, 07 July 2023 12:56 Go to previous message
Eclipse UserFriend
i want to know what you did to get it running in lsp.

e.g.

grammar + lsp unit test + hover impl

[Updated on: Fri, 07 July 2023 12:57] by Moderator

Previous Topic:How to remove the '\' before each single quote in a string added by the formatter ?
Next Topic:How to disable the language servers automatic building/code generation?
Goto Forum:
  


Current Time: Fri Apr 18 16:46:19 EDT 2025

Powered by FUDForum. Page generated in 0.03319 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top