swaits / typst-collection

A collection of typst stuff, including packages and templates.
MIT License
1 stars 0 forks source link

Glossy Autocomplete #3

Open szymonmasternak opened 1 day ago

szymonmasternak commented 1 day ago

Is it possible to get autocomplete on glossy when typing a glossary term?

Right now when using glossarium package, I can see an autocomplete preview for all possible glossary terms. image

On glossy the only thing I see is this: image

I think it would be a nice feature to implement.

Thanks Szymon.

swaits commented 1 day ago

Interesting. I'll take a look and see if I can understand why this works in glossarium.

swaits commented 1 day ago

After thinking about it a bit I realized that it is working just the same as glossarium. However, the reason you're not seeing the same things on auto-complete is because glossy takes a different approach to labeling and referencing.

Each time you use a term, it gets a label like __gloss:css.0, __gloss:css.1, and so on. These labels are referenced later in the index, so the page numbers listed for a term can link back to the right usage.

I have an idea about something that might not really fix your autocomplete issue, but might improve the usability dramatically. I'll experiment with it in the coming days.

swaits commented 1 day ago

Although, thinking on it further, each time you use a term, like @css, that should also get added via your LSP, and since @ sorts before _ should get listed first in your autocompletion. So, I'm stumped. I'll keep thinking about it.