-
Notifications
You must be signed in to change notification settings - Fork 160
feat: Added ORGMODE parser #1369
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
Conversation
I heavilly use ORGMODE[0] for my notes, and I also love harper. This PR add the parser for ORGMODE, I also add support to haper-ls and harper-cli. I know that maybe it's not complete at 100%, but I'm going to work over needed changes. 0: https://orgmode.org/ Signed-off-by: Eloy Coto <[email protected]>
@elijah-potter could you tell me if this is something interesting for you and if it is ok to merge after review? |
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.
This is great work. I'm glad to see Org mode finally coming to Harper!
I would love to include this in the next release, but want a bit more assurance to its stability. Could we get a few more tests?
harper-core/src/parsers/org_mode.rs
Outdated
use super::{Parser, PlainEnglish}; | ||
use crate::{Span, Token, TokenKind}; | ||
|
||
/// A parser that wraps the [`PlainEnglish`] parser that allows one to parse |
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.
An initial look appears solid to me. I appreciate the test coverage you have so far, but would love to see even more end-to-end tests. Would it be possible to toss some in harper-core/tests/test_sources/
? You might need to modify the macro in harper-core/tests/run_tests.rs
.
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.
make sense, I would create a file, I will use this one as default:
https://github.com/nvim-orgmode/orgmode/blob/32ef9e95f43a6e951fb931b438372546a4f0c524/docs/index.org
And I'll update the macro (Looks ok ish)
Org file from here: https://github.com/nvim-orgmode/orgmode/blob/32ef9e95f43a6e951fb931b438372546a4f0c524/docs/index.org Signed-off-by: Eloy Coto <[email protected]>
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.
It seems like your code all operates around lines, but you are always just passing around the entire source. You might want to rework your functions to accept lines, and then loop through the lines (split by newline) in your parse function.
Co-authored-by: Grant Lemons <[email protected]>
e9336d1
to
3506323
Compare
Signed-off-by: Eloy Coto <[email protected]>
I have opened it up on my editor. From my limited understanding of orgmode, it looks good. If there are further issues, can we ping you as a resident expert on orgmode? |
If I'm still alive by them, yes! I'm happy to check issues if happens :-) |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [Automattic/harper/harper-ls](https://github.com/Automattic/harper) | minor | `v0.38.0` -> `v0.42.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>Automattic/harper (Automattic/harper/harper-ls)</summary> ### [`v0.42.0`](https://github.com/Automattic/harper/releases/tag/v0.42.0) [Compare Source](Automattic/harper@v0.41.0...v0.42.0) #### What's Changed - feat: kinda of→kind of / kinda by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1363 - build(deps): bump smallvec from 1.15.0 to 1.15.1 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1379 - build(deps): bump reqwest from 0.12.18 to 0.12.19 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1380 - dictionary: add some (mostly) phone-related terms by [@​86xsk](https://github.com/86xsk) in Automattic/harper#1377 - build(deps): bump hashbrown from 0.15.3 to 0.15.4 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1378 - fix(core): handle words with multiple dialects by [@​86xsk](https://github.com/86xsk) in Automattic/harper#1372 - feat(obsidian): misc. QoL improvements by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1382 - feat: Added ORGMODE parser by [@​eloycoto](https://github.com/eloycoto) in Automattic/harper#1369 - feat: `harper-cli` command to rename affix annotation flags by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1348 - chore: refactor most common affix annotation flags by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1349 - feat: few time-units ago→a few time-units ago by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1343 - feat(core): add rule for `some the` -> `some of the` by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1333 - feat(core): add rule to expand btw by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1329 #### New Contributors - [@​eloycoto](https://github.com/eloycoto) made their first contribution in Automattic/harper#1369 **Full Changelog**: Automattic/harper@v0.41.0...v0.42.0 ### [`v0.41.0`](https://github.com/Automattic/harper/releases/tag/v0.41.0) [Compare Source](Automattic/harper@v0.40.0...v0.41.0) #### What's Changed - Implement server_info by [@​jvoisin](https://github.com/jvoisin) in Automattic/harper#1341 - fix: correct and improve verb morphology by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1257 - docs(sublime-text): added sublime text integration by [@​ssahayam-zd](https://github.com/ssahayam-zd) in Automattic/harper#1346 - feat: piece of mind→peace of mind by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1360 - Dictionary curation 2025 05 30 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1352 - feat: fix noun that should be related verb by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1362 - fix: missing `the` from `SufficeItToSay` message by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1350 - feat: open a device→turn on a device by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1356 - fix: don't close compound if open is in dictionary by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1347 - feat: throw rubbish→throw rubbish away / throw away rubbish by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1274 - fix: different messages for wrong word vs missing hyphen by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1354 - feat(obsidian): tweak style of code block by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1367 - fix: add special case for "how come" by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1279 - test: `exact_phrase` and `exact_word` differ in case sensitivity by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1361 - feat: in need for→in need of by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1359 - build(deps): bump clap from 4.5.38 to 4.5.39 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1358 - build(deps): bump reqwest from 0.12.15 to 0.12.18 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1357 - fix: false positives after object case pronouns by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1353 - feat: `harper-cli compounds` command by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1351 - dictionary: Add UUID by [@​jpds](https://github.com/jpds) in Automattic/harper#1371 - feat:a couple of more→a couple more by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1374 - feat(chrome-ext): Improve onboarding experience by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1375 #### New Contributors - [@​ssahayam-zd](https://github.com/ssahayam-zd) made their first contribution in Automattic/harper#1346 **Full Changelog**: Automattic/harper@v0.40.0...v0.41.0 ### [`v0.40.0`](https://github.com/Automattic/harper/releases/tag/v0.40.0) [Compare Source](Automattic/harper@v0.39.0...v0.40.0) #### What's Changed - dictionary: Add some chat terms/RSS/OSS by [@​jpds](https://github.com/jpds) in Automattic/harper#1323 - feat: spelled-number pattern & since duration linter by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1325 - feat(ls): allow skipping the version check by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1334 - fix(ls): do not emit diagnostics on save by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1332 - Implement a way to get harper-ls version by [@​jvoisin](https://github.com/jvoisin) in Automattic/harper#1338 - build: add `release-debug` profile by [@​86xsk](https://github.com/86xsk) in Automattic/harper#1342 - feat(ls): configurable max length by [@​86xsk](https://github.com/86xsk) in Automattic/harper#1335 - feat: unsurmountable→insurmountable, brutalness→brutality by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1339 #### New Contributors - [@​jvoisin](https://github.com/jvoisin) made their first contribution in Automattic/harper#1338 **Full Changelog**: Automattic/harper@v0.39.0...v0.40.0 ### [`v0.39.0`](https://github.com/Automattic/harper/releases/tag/v0.39.0) [Compare Source](Automattic/harper@v0.38.0...v0.39.0) #### What's Changed - fix: use community maintained fork of tower-lsp by [@​jfly](https://github.com/jfly) in Automattic/harper#1316 - refactor: make the three compound noun linters consistent by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1294 - feat: as of lately→as of late by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1319 - feat: Every day vs Everyday linter by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1265 - build(deps): bump tokio from 1.45.0 to 1.45.1 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1328 - feat:point of views→points of view by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1324 - build(deps): bump uuid from 1.16.0 to 1.17.0 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#1327 - fix(vscode-plugin): make test reliable with `waitForDiagnosticChange` by [@​kiding](https://github.com/kiding) in Automattic/harper#1322 - Dictionary curation 2025 05 22 by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1321 - feat:amount for→account for/amount to by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#1320 - fix(chrome-ext): scrolling on Notion + other tweaks by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#1317 **Full Changelog**: Automattic/harper@v0.38.0...v0.39.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDAuNDguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIlJlbm92YXRlIEJvdCJdfQ==-->
* feat: Added ORGMODE parser I heavilly use ORGMODE[0] for my notes, and I also love harper. This PR add the parser for ORGMODE, I also add support to haper-ls and harper-cli. I know that maybe it's not complete at 100%, but I'm going to work over needed changes. 0: https://orgmode.org/ Signed-off-by: Eloy Coto <[email protected]> * feat: orgmode integration tests Org file from here: https://github.com/nvim-orgmode/orgmode/blob/32ef9e95f43a6e951fb931b438372546a4f0c524/docs/index.org Signed-off-by: Eloy Coto <[email protected]> * Update harper-core/src/parsers/org_mode.rs Co-authored-by: Grant Lemons <[email protected]> * chore: fix PR comments Signed-off-by: Eloy Coto <[email protected]> --------- Signed-off-by: Eloy Coto <[email protected]> Co-authored-by: Grant Lemons <[email protected]>
I heavilly use ORGMODE[0] for my notes, and I also love harper. This PR add the parser for ORGMODE, I also add support to haper-ls and harper-cli.
I know that maybe it's not complete at 100%, but I'm going to work over needed changes.
0: https://orgmode.org/
How Has This Been Tested?
Checklist