-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Feat: Add the ability to open linked pdf files in bib files #14275
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
base: main
Are you sure you want to change the base?
Conversation
| // We need state to have a more clean code. Thus, we instantiate the class and then return the result | ||
| FileFieldParser fileFieldParser = new FileFieldParser(value); | ||
| return fileFieldParser.parse(); | ||
| return new ArrayList<>(fileFieldParser.parse().stream().map(LinkedFilePosition::linkedFile).toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To create a modifiable list, the usual way is with .collect(Colltectors.toList()) (or similar).
Also add to JavaDoc that the list is modifiable.
However - why do you need the result be modifiable? I think, the caller should convert it to a modifiable list (I might be wrong here, did not check all the code, but only thought of parsing and that the parsed representation should be read-only, because the underlying thing does not change)
| @Override | ||
| public List<DocumentLink> provideDocumentLinks(String fileUri, String content) { | ||
| return List.of(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes because this is only relevant (for now) when we want to execute commands or do stuff in the ui, but pdf opening is (currently) only for opening them in vscode and therefore we dont need this
6bb6c17 to
8d07104
Compare
|
sorry for force pushing, but I accidentally re ordered a commit in gitbutler and than reversed it to the original state, but because of gitbutlerapp/gitbutler#10266 I needed to force push in order to get it working... |
InAnYan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that with absolute paths it works.
Though, from the UI side, I don't like, that it underscores only a single word, not a full URL, but for now ça suffit
But this is from VSCodes side, i set the range for the link to the whole file. The hyperlink view only works for documentLinks, maybe it could be reworked to use DocumentLinks |
| """, | ||
| importFormatPreferences); | ||
| List<LinkedFile> files = parserResult.getDatabaseContext().getEntries().getFirst().getFiles(); | ||
| assertNotNull(files.getLast().getLink()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer an assertEquals here, if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt you also check for two occurrences?
Closes palukku#32
Adds the ability to ctrl + click on a linked pdf if the path is absolute and opens it in vscode (if pdf preview extension is installed)
Steps to test
Start JabLs from this branch and than vscode with the extension enabled.
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)