Hannah-Sten / TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
https://hannah-sten.github.io/TeXiFy-IDEA
MIT License
896 stars 89 forks source link

Cite autocompletion ignores capitals #1180

Closed slideclimb closed 4 years ago

slideclimb commented 4 years ago

When using

@book{Goossens1993,
    author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title = "The LaTeX Companion",
    year = "1993",
    publisher = "Addison-Wesley",
    address = "Reading, Massachusetts"
}

and using the autocomplete from your tex file, it ignores capitals in the key if what you typed did not contain any capital. For example:

\cite{com<Enter>}    -> \cite{goossens1993}
\cite{Com<Enter>}    -> \cite{Goossens1993}
PHPirates commented 4 years ago

@fberlakovich

fberlakovich commented 4 years ago

and using the autocomplete from your tex file, it ignores capitals in the key if what you typed did not contain any capital. For example:

That is really interesting because with my own bibtex file I cannot reproduce the bug, but with yours I can. I will look into it!

fberlakovich commented 4 years ago

Seemingly the option .withCaseSensitivity(false) of the LookupElementBuilder does not do what the documentation says it does. According to https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000463024-Case-insensitive-LookupElements-mess-with-the-lookup-string?flash_digest=2d43e86295ac9f065e6cc79ecda228b0437b8ab9 the only option might be to change the CompletionResultSet, but this can only be done in the CompletionProvider. It might take a while because I need to look into how the providers work.

Until then, do you think it might be better to remove the .withCaseSensitivity(false) part? The downside is that it would make the search case sensitive, but the upside is that the correct key would be inserted.

PHPirates commented 4 years ago

Thanks for the research! Depends on how much time you need, if you can fix it properly within say two weeks then it's fine, but otherwise using a quickfix for 0.6.8 is also fine with me.

fberlakovich commented 4 years ago

Ok, I will see what I can do within the two weeks. If I can't get it done on time, the quickfix should be a matter of minutes.