Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tags editor for auto completion preferences #10990

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

LoayGhreeb
Copy link
Collaborator

Closes #10952
Use tags editor for auto-completion preferences with suggestions for all standard BibTeX and BibLaTeX fields.

image

  • Should users be able to add a field that is not a standard Bib(La)TeX field, i.e., a field not suggested?

  • Why is it important to always add crossref, related, and entryset fields?

    private static void addCrossRefRelatedFieldsForAutoComplete(JabRefPreferences prefs) {
    // LinkedHashSet because we want to retain the order and add new fields to the end
    Set<String> keys = new LinkedHashSet<>(prefs.getStringList(JabRefPreferences.AUTOCOMPLETER_COMPLETE_FIELDS));
    keys.add("crossref");
    keys.add("related");
    keys.add("entryset");
    prefs.putStringList(JabRefPreferences.AUTOCOMPLETER_COMPLETE_FIELDS, new ArrayList<>(keys));
    }

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)

  • Tests created for changes (if applicable)

  • Manually tested changed features in running JabRef (always required)

  • Screenshots added in PR description (for UI changes)

  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.

  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

}

public List<Field> getSuggestions(String request) {
return FieldFactory.getStandardFields().stream()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use getAllFieldsWithOutInternal

  1. it contains more than bibtex and biblatex fields (the additional fields for other entry types, e.g. Software or IEE)
  2. they are already sorted

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Siedlerchr
Copy link
Member

Why is it important to always add crossref, related, and entryset fields?

These are standard biblatex fields that are explicitly designed for linking entries together:

related field (separated values)
Citation keys of other entries which have a relationship to this entry. The relationship
is specified by the relatedtype field. Please refer to § 3.5 for further details.

I recommend reading through the biblatex manual (Section 2.1 and 2.2)
http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf

@LoayGhreeb LoayGhreeb requested a review from Siedlerchr March 7, 2024 04:20
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 7, 2024
Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool feature!

@calixtus calixtus added this pull request to the merge queue Mar 8, 2024
Merged via the queue into JabRef:main with commit 8afe793 Mar 8, 2024
21 checks passed
@LoayGhreeb LoayGhreeb deleted the fix-issue-10952 branch March 8, 2024 10:46
Siedlerchr added a commit to Frequinzy/jabref that referenced this pull request Mar 13, 2024
* upstream/main: (36 commits)
  chore: remove repetitive words (JabRef#11015)
  Fix test names (JabRef#11014)
  Remove obsolete "Comments" tab configuration (JabRef#11011)
  Fix "Other fields" tab respecting custom tabs (JabRef#11012)
  [WIP] Extract PDF References (JabRef#10437)
  Fixed jump to entry from crossref (JabRef#11009)
  fix suggestion provider for crossref field (JabRef#10962)
  Use SequencedSet for required and optional fields (JabRef#11007)
  Bump io.github.classgraph:classgraph from 4.8.165 to 4.8.168 (JabRef#11005)
  Bump org.glassfish.hk2:hk2-api from 3.0.6 to 3.1.0 (JabRef#11006)
  Bump org.apache.logging.log4j:log4j-to-slf4j from 2.23.0 to 2.23.1 (JabRef#11003)
  Bump org.javamodularity.moduleplugin from 1.8.14 to 1.8.15 (JabRef#11002)
  Bump jakarta.xml.bind:jakarta.xml.bind-api from 4.0.1 to 4.0.2 (JabRef#11004)
  Bump softprops/action-gh-release from 1 to 2 (JabRef#11000)
  Bump gittools/actions from 0.13.2 to 0.13.4 (JabRef#11001)
  Update custom-svg-icons.md (JabRef#10999)
  Update Texworks icon (JabRef#10998)
  Use tags editor for auto completion preferences (JabRef#10990)
  Enable auto merge of CHANGELOG.md (JabRef#10986)
  Enhance DOI parser to deal with special characters (JabRef#10989)
  ...

# Conflicts:
#	build.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tags for preferences -> auto completion
3 participants