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

Api Search in text editor #4983

Closed
wants to merge 42 commits into from
Closed

Api Search in text editor #4983

wants to merge 42 commits into from

Conversation

mrbuds
Copy link
Contributor

@mrbuds mrbuds commented Apr 2, 2024

Description

Use Blizzard_APIDocumentation to make a side panel to help find documented wow functions (not all of them are in there sadly) or complete as you type.

Type of change

  • New feature (non-breaking change which adds functionality)

There is no known bug i want to fix, but i'm not in a hurry to merge, maybe there's some cool stuff to add i'v not think about yet

@mrbuds mrbuds added the 🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature. label Apr 2, 2024
@emptyrivers
Copy link
Contributor

click snippets & search API at the same time, you get a very wide window, may or may not be desirable to ensure exactly one side panel is open at a time
image

@emptyrivers
Copy link
Contributor

consider doing some debouncing to only perform search after the user has stopped typing? and/or spread across frames

@emptyrivers
Copy link
Contributor

some events are documented. Maybe add them? IDK how to make that make sense in the UI but you're smart :)
image

@mrbuds
Copy link
Contributor Author

mrbuds commented Apr 4, 2024

some events are documented. Maybe add them?

WowClassic_2024-04-04_05-39-51.mp4

@Stanzilla
Copy link
Contributor

to pile on, can we add teh WA APIs that we offer to use from auras?

@mrbuds
Copy link
Contributor Author

mrbuds commented Apr 4, 2024

to pile on, can we add teh WA APIs that we offer to use from auras?

That would ideally be a script to generate documentation data like what's in Blizzard_APIDocumentationGenerated to feed APIDocumentation:AddDocumentationTable

Mhmm maybe .. that would help if you know someone at blizzard willing to share their own script (if they have one)

@Stanzilla
Copy link
Contributor

to pile on, can we add teh WA APIs that we offer to use from auras?

That would ideally be a script to generate documentation data like what's in Blizzard_APIDocumentationGenerated to feed APIDocumentation:AddDocumentationTable

Mhmm maybe .. that would help if you know someone at blizzard willing to share their own script (if they have one)

So kinda like https://github.com/DeadlyBossMods/LuaLS-Config/tree/main but not as intense

@mrbuds
Copy link
Contributor Author

mrbuds commented Apr 4, 2024

@Stanzilla
Copy link
Contributor

So kinda like DeadlyBossMods/LuaLS-Config@main but not as intense

I don't see how that help generate files like Gethe/wow-ui-source@ddfbf32/Interface/AddOns/Blizzard_APIDocumentationGenerated/AdventureJournalDocumentation.lua

ah nvm, my brain was confused by the discussion on discord vs this

@InfusOnWoW InfusOnWoW added 🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature. and removed 🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature. labels May 3, 2024
@mrbuds
Copy link
Contributor Author

mrbuds commented Jun 6, 2024

More toughs on this project

In this state it's trying to do too much at once, and i'm not pleased with everything

intelisense widget & LibAPIAutoComplete-1.0

I have strong doubts that the intelisense widget from LibAPIAutoComplete-1.0 is good enough

It happens too often that it's shown in bad context
It's big enough that often you do unwanted clicks, that mistakenly replace a word with a function, and editbox doesn't have an undo / ctrl-z function. This can make the widget more an annoyance than an improvement.
It's data is incomplete, which feels less problematic with the side search panel, but when navigating your code it's too obvious

Also LibAPIAutoComplete-1.0 as a lib isn't working, as it use a frame template defined in an xml file, it's necessary for WowScrollBoxList with DataProvider, but that doesn't fit in a lib as it generate a name conflicts when xml file load in a 2nd addon using same lib (i know river's github action for edit namespace in xml files could solve this, but it doesn't feel right)

I think it's best to drop that idea, for now at least

WeakaurasAPI (weakauras function added to apidoc)

It could be good to move that to a separate loadondemand addon?

Next, i'm not 100% pleased with the types generated, luals --doc resolve all aliases into their basic type

for example with ---@alias UnitToken "player" | " target" | "focus" and a ---@param UnitToken unit, in generated json file it won't show UnitToken but "player" | " target" | "focus" :(

It's for the best to hold this until 11.0 WeakAuras namespace cleanup, and take time to find a solution for this type problem

Search API side panel

I'd need to decouple it from LibAPIAutoComplete-1.0
Maybe make it hide other panels when shown instead of display multiple panels
I also want change background like with #5102

That would reduce the scope of this PR to just the side panel

@InfusOnWoW
Copy link
Contributor

@mrbuds I hacked on the library for a bit and got keyboard handling to mostly work. The change is quite hacky, as I had to experiment a lot to get it to mostly work and I didn't even try to understand how to cleanly pass various widgets, data to various methods that need the data.

I changed:

  • While the popup is open: Up/Down/Enter/Escape are handled by the popup and do the right thing
  • Tweaked in which circumstances the popup shows up, so that it only shows up if the left side looks like a word and the right side is a space.

To me that feels pretty useable imho, and to me it looks like this is worth pursuing, even with the noted drawbacks you mentioned.

@mrbuds
Copy link
Contributor Author

mrbuds commented Jul 9, 2024

PR split
panel #5170
autocomplete widget #5201
WeakAurasAPI.lua & wiki #5216

@mrbuds mrbuds closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants