Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
278 stars 11 forks source link

feat: support querying label with paper name in bib items #365

Open kririae opened 4 days ago

kririae commented 4 days ago

Record the progress here. Suppose we do have three labels, with VSCode as the LSP client

  1. <jiang2015apic>
  2. <jiang2016mpm>
  3. <bridson2008book>

Type, for example, #cite(<book, [3] will correctly pop out because it is prefixed with b. However when we're searching for apic, #cite(<apic will give a empty completion list, because the corresponding label is not prefixed with a.

Although we can mitigate this through setting editor.suggest.matchOnWordStartOnly in VSCode to false, it is not the expected default behavior. Current solution is to make use of the filterText option, by concatenating the "{label}|{bib_title}" sections, the behavior changes to:

  1. typing #cite(<apic will correct give the match to [1]
  2. searching for any word inside the paper title will also give the corresponding completion item.

Note that completion sorting and filtering is still provided by the client.