feat(cite): enable reference autocomplete #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adapted from https://github.com/BYRIO/overleaf/
Description
Enable autocompletion of bibliography entries when typing
\cite
.The open source version of Overleaf disables the reference autocompletion feature and removes a service called "references". (They didn't even change
package-lock.json
.) As demonstrated in the following figure, we only need to enable the arrow from web service to references service and implement the references service.Specifically, we need to add the following lines to config:
overleaf/services/web/config/settings.defaults.js
Lines 262 to 264 in ed78fa5
And then implement a new references service, which is basically copied from https://github.com/BYRIO/overleaf/. On change is that I replaced
request
module with Node.js built-infetch
, becauserequest
is not included in@overleaf/references
module according topackage-lock.json
and I want to keeppackage-lock.json
unchanged.Related issues / Pull Requests
None
Additional notes
I have removed all irrelevant modifications in this PR. They are mostly dev-related ones. Therefore, if the code fails to run because of this, I can open another PR to update these modifications.
Files from https://github.com/BYRIO/overleaf/, especially
BibParser.js
, are not reviewed. We can review these files together.