Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Hover service on keywords (language server)
Hover service on keywords (language server) [message #1859972] Fri, 07 July 2023 12:44 Go to next message
Cyril Vrousos is currently offline Cyril VrousosFriend
Messages: 5
Registered: June 2023
Junior Member
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 12:48]

Report message to a moderator

Re: Hover service on keywords (language server) [message #1859973 is a reply to message #1859972] Fri, 07 July 2023 12:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
how does your impl look like? see also https://blogs.itemis.com/en/xtext-usability-hovers-on-keywords

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Hover service on keywords (language server) [message #1859975 is a reply to message #1859973] Fri, 07 July 2023 13:50 Go to previous messageGo to next message
Cyril Vrousos is currently offline Cyril VrousosFriend
Messages: 5
Registered: June 2023
Junior Member
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 13:51]

Report message to a moderator

Re: Hover service on keywords (language server) [message #1859982 is a reply to message #1859975] Fri, 07 July 2023 16:56 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
i want to know what you did to get it running in lsp.

e.g.

grammar + lsp unit test + hover impl


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 07 July 2023 16:57]

Report message to a 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: Sat Jul 27 15:09:38 GMT 2024

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

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

Back to the top