Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation assistance needed. #27

Closed
Sattva-108 opened this issue Jun 26, 2023 · 9 comments
Closed

Installation assistance needed. #27

Sattva-108 opened this issue Jun 26, 2023 · 9 comments

Comments

@Sattva-108
Copy link

IDEA version: IntelliJ IDEA 2023.1.3
EmmyLua version: IntelliJ-EmmyLua-1.4.7-IDEA231

Hello, i'm struggling to install it.
I'm very much new to the IDEA and terminal commands.
I clicked "Terminal" inside the IntelliJ IDEA and executed how you said, i think. The path is right.

idea64_doEsHMyJoG

Can you please guide me ?
This is path, where i put your repo: "E:\3.3.5\interface\AddOns\unitscan\IntelliJ-IDEA-Lua-IDE-WoW-API-master\GenerateFromAPIDocumentation.lua"

Thank you!

@brittyazel
Copy link
Collaborator

brittyazel commented Jun 26, 2023

You don't install those scripts. The scripts in the root of the repository are meant for generating the documentation itself and are meant for the admins of this repo to use to keep the repository updated.

To make use of the EmmuLua API sources in this repository you simply clone this repo to your filesystem and add it as an API in your addon project structure. You must also have the Emmylua plugin installed in IntelliJ. You can find a guide on how to set this wiki, albeit slightly out of date: https://github.com/Ellypse/IntelliJ-IDEA-Lua-IDE-WoW-API/wiki

None of the scripts in this repo are anything you should be executing. This repo is just meant to be sourced by EmmyLua. This repo provides EmmyLua with the class and function definitions it needs for code completion.

@Sattva-108
Copy link
Author

idea64_ee1uot7uvf

I think i did install it right, may be i need to do something else?
It does show documentation for something, i could only find CreateFrame documentation displayed in tooltip.
QQL3tAq6tq

Rest of stuff is missing.
It shows me tooltip like this :
idea64_VHExY71BmB

Or like this:
idea64_spjiBwfEbE

idea64_2bXacoScfh

idea64_pAGX4Bl1Zn

@Sattva-108
Copy link
Author

Sattva-108 commented Jun 27, 2023

I do not have Lua SDK by default even though i have EmmyLua.
So i tried to add EmmyLua manually via "Add SDK"

idea64_aiI4yckXwJ

And then add the API from this git to the EmmyLua SDK, but that didn't work either.

@brittyazel
Copy link
Collaborator

Yeah I don't think you did it quite right. To get the "Lua SDK" to show up you need to create a dummy project by going to file > new > project > Lua. Once you make your "dummy" project, IntelliJ should be able to see the Lua SDK across all of your projects.

Then, under your "project structure", you can modify the "Lua" SDK to point to the classpath(s).
Screenshot 2023-06-26 184516

I'm not sure what you have going on in your screenshots with the .idea showing as an SDK

@Sattva-108
Copy link
Author

Sattva-108 commented Jun 27, 2023

Thank you for quick response, i was able to auto-create Lua SDK and add the IntelliJ-IDEA-Lua-IDE-WoW-API and wow source code to it.
idea64_SD7qWT4h3Y

There is no Lua in the dropdown.
What i did is i clicked Lua (see screenshot below) in the menu list on left bottom side to create new project, then the dummy SDK Lua was created automatically.

idea64_7KM3mXKYGC

I have though now tried to create new project named Lua, and it didnt seem to help as well.

@Sattva-108
Copy link
Author

It's funny, but some i'm able to see, some i don't. Im pretty sure that SetScript must be defined in that documentation, but i cannot see its tooltip.

qnKhLVD

@Sattva-108
Copy link
Author

Sattva-108 commented Jun 27, 2023

May be it's just not defined, as well for easy functions like SetPoint, SetAllPoints, Hide, Show. And thats why i think that documentation doesn't work?

idea64_ogEmImxBSP

Im able to see the tooltips inside documentation files but not in my addon files.
LDiGbIh

@brittyazel
Copy link
Collaborator

brittyazel commented Jun 27, 2023

The reason that IsShiftKeyDown() shows mouseover documentation and something like :Show() or :SetPoint() do not is because the first is a standalone function while the other two are class/object functions. I.e. :Show() is a member of the VisibleRegion class and :SetPoint() is a member of the Region class. Unless you declare your object as a class type that inherits such functionality, it's not going to show (see here and here).

For example, if you follow the flow of inheritance of :Show() or :SetPoint() you will find that the objects implementing them all inherit back to class UIObject. Or if you don't want to go that far back, many inherit from class Frame. I.e. if you declare your frames as type Frame, many of these functions should magically start showing mouseover completion:

---@type Frame
local tooltip = CreateFrame("frame", nil, GameTooltip)

Further, in the gif you included, another reason you wouldn't be seeing documentation is that you are declaring an entirely new C_ActionBar.IsHelpfulAction() function. You are effectively overwriting the API function with your own, meaning that the documentation from the API no longer applies. What you've done is create a new function of the same name, in which case 'you' would be responsible for supplying the documentation.

@Sattva-108
Copy link
Author

Alright thank you, it's really hard for me to understand some things.
If i understand you correct, i need to make it like shown on screenshot?

idea64_ys66k8LojS

But i guess that ScrollBar type is not right definition or doesn't exist, so i cannot see tooltips for that class/object functions?

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

No branches or pull requests

2 participants