Skip to content

Add Hover support for VSCode.#6

Draft
Wither362 wants to merge 10 commits intoPixel-Tony:mainfrom
Wither362:main
Draft

Add Hover support for VSCode.#6
Wither362 wants to merge 10 commits intoPixel-Tony:mainfrom
Wither362:main

Conversation

@Wither362
Copy link

@Wither362 Wither362 commented Oct 13, 2025

"Hover" is an useful feature that vscode uses. When the mouse hovers on top of a word, it shows up the meaning (tooltips) and useful information for the coder, instead of having to go manually to the tt-wiki.net website and search for the description of a function.

I'm making this a Draft PR because I want to finish all the functions and variable information possible before commiting to the main branch.

Is this a good idea? Do you -Pixel Tony- approve this?

How to use this feature

I added a new file, called hoverData.json, where definitions are stored. It should have a structure similar to this example of the built-in function STORE_PERM:

{
  "STORE_PERM": {
    "title": "STORE_PERM(value, address)",
    "description": "Store value in permanent storage (industries, airports, towns only).",
    "example": "STORE_PERM(1, 4)"
}

this, will look like this in VSCode when the user hovers the mouse over it:
image

What is the purpose of this PR?

The main reason why I'm doing this is because I wanted to learn how to code NewGRFs, but I can't seem to memorize all the built-in features OpenTTD's code gives me. So, with this Hover Feature, modders can actually see what built-in features there are for them to use them faster and smarter.

@Wither362
Copy link
Author

help is appreciated 🙏

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.

1 participant