Dedpulicate labels for code completion
Closes #6296.
For the purpose of code completion we don't want to list duplicate labels.
Duplicates can still happen if a label exists in the document and in the bibliography. I consider this acceptable and might actually give users an important hint that they have duplicate labels.
Thanks for the PR! Could you add a test for this in autocomplete.rs?
Might wanna fix the typo in the title so this can be found through search later
I saw that there was a general lack of tests for references in complete.rs so I decided to add some. During that I found a small regression due to my previous PR (#6332) where autocompletion would not show labels right after an @. I fixed the regression in here since it was just a few more lines and I understood the problem well.
Could you extract the regression fix into a separate PR? For the tests, it could also be good to try and extract a common function as there is some duplicate in the setup code there.
Alright, I'm putting the regression fixes into a separate PR. Any consolidation of the test code will also happen in the follow up PR.
Thank you!