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

Inconsistent ordering of method definitions #48

Closed
luttje opened this issue Feb 17, 2024 · 2 comments · Fixed by #49 or LuaLS/LLS-Addons#125
Closed

Inconsistent ordering of method definitions #48

luttje opened this issue Feb 17, 2024 · 2 comments · Fixed by #49 or LuaLS/LLS-Addons#125
Labels
bug Something isn't working

Comments

@luttje
Copy link
Owner

luttje commented Feb 17, 2024

I believe a bug may have been introduced in #42. It causes methods to be ordered inconsistently. Probably because we're now scraping the wiki multiple pages at a time, causing for inconsistent load results between scrapes.

It's most noticeable when you compare recent commit changes: 4af9755 (which show a large amount of changes occurring) to those from before #42. These show only changes to the wiki data, without reordering methods: bd6de32

Additionally this bug causes the following side-effect, where some method definitions are placed before the local ContentIcon = {}:
https://github.com/luttje/glua-api-snippets/blob/4af9755c9657221ea8d6294aace24496aab884e7/library/contenticon.lua

@robotboy655 Would love your feedback, do you recognize an easy fix? I'm thinking a sort somewhere might solve this issue, e.g: in here:

public writePage(page: WikiPage) {

@luttje luttje added the bug Something isn't working label Feb 17, 2024
@luttje luttje changed the title Odd ordering of methods Inconsistent ordering of method definitions Feb 17, 2024
@robotboy655
Copy link
Contributor

It is something I also noticed, but didn't think it would be a problem, ultimately.

I imagine easiest way to solve this would be to also supply the expected order to write page (https://github.com/luttje/glua-api-snippets/blob/main/src/cli-scraper.ts#L121) in addition to the file name, store it, and then sort pages before writing them.

As for the "method definitions are placed before the local ContentIcon = {}:" issue, I guess this only affects panels since they do not write a fallback class definition? Should be easily fixable though.

@luttje
Copy link
Owner Author

luttje commented Feb 18, 2024

@robotboy655 Thanks for picking this up. Just confirming that comparing the most recent commit to one from two weeks ago helpfully shows changes made to the content (and doesn't reorder):
/bd6de32d69108e1e68fbaa516f42fa4145cdd811...lua-language-server-addon
So all is good again + even beter since all the new changes you made.

Thanks for implementing the fix the clean way you did and with the speed you did it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants