Damien Elmes
82f9143171
add a (currently failing) test for duplicate parent names
2021-01-16 19:04:25 +10:00
Damien Elmes
96bd39f13e
search error tweaks
...
- use markdown instead of HTML, to make editing and translating easier
- use a shared prefix
- a few very minor wording tweaks
- we don't need to translate undocumented command errors
- share a string for positive number of days
- share a string for invalid property and state arguments, and avoid
listing them out
Related discussion: https://github.com/ankitects/anki/pull/922
2021-01-16 15:59:19 +10:00
RumovZ
bdb7948406
Add resched error tests
2021-01-15 10:57:55 +01:00
RumovZ
b9f7643100
Merge branch 'master' into search-errors
...
Add error support for new resched node, update rated error.
2021-01-15 10:50:02 +01:00
RumovZ
9d641bcb76
Include context in search error test
2021-01-15 09:09:54 +01:00
abdo
112aa44c90
Merge branch 'master' of https://github.com/ankitects/anki into tagtree
2021-01-15 01:12:01 +03:00
RumovZ
e0168c8216
Encode HTML entities in search errors
2021-01-14 23:02:39 +01:00
RumovZ
6f8a9ba2ff
Add search context for certain error kinds
2021-01-14 22:40:07 +01:00
RumovZ
74c2ce8df1
Rename ParseErrorKind to SearchErrorKind
2021-01-14 22:00:52 +01:00
RumovZ
6cbb4b48b2
Add errorkind test
2021-01-14 19:10:12 +01:00
RumovZ
8c6fbd828d
Add FailKinds for unopened/unclosed groups
2021-01-14 19:09:31 +01:00
RumovZ
ae22b78534
Make AnkiError::SearchError work with ParseError
...
Use mock ftl strings for now.
2021-01-14 11:14:55 +01:00
RumovZ
5e971759cf
Fix text node parsers, add FailKind alias
2021-01-14 11:10:33 +01:00
abdo
b3b6351f74
Fix unicode tag sorting
2021-01-14 07:04:55 +03:00
abdo
dd3f0d44fe
Remove Default impl of Tag
2021-01-14 07:04:55 +03:00
abdo
4911945b9b
Refactor code for clearing unused tags and saving collapse state
2021-01-14 07:04:14 +03:00
RumovZ
cbb9bb96a7
Add pb message for dupe filter
2021-01-14 10:42:37 +10:00
RumovZ
6c66da5578
Expect backslashes to be escaped in dupe: text
2021-01-14 10:42:37 +10:00
RumovZ
530cfebe19
Fix writing dupe nodes
...
Rename comments and dupe functions on the backend accordingly to avoid
further confusion.
2021-01-14 10:42:37 +10:00
Damien Elmes
9f3959ccad
Merge pull request #918 from hgiesel/ratedflags
...
Introduce `resched:n` instead of `rated:n:0`
2021-01-14 10:19:10 +10:00
RumovZ
97ed75a322
Optimise term parsers
2021-01-13 14:15:57 +01:00
RumovZ
5fc24ddfde
Move parse errors, add helper func for parse fail
2021-01-13 13:23:25 +01:00
Henrik Giesel
42b10e5a12
Change "between 1 and 4" to "> 0"
2021-01-13 11:44:54 +01:00
Henrik Giesel
28c53a410a
Rename EaseKind values
2021-01-13 11:41:48 +01:00
Damien Elmes
6cc58451b1
add local sync server frontend
2021-01-13 11:42:00 +10:00
abdo
c423e8d7bb
Merge branch 'master' of https://github.com/ankitects/anki into tagtree
2021-01-12 23:31:58 +03:00
abdo
e3c873fb32
Keep tags in human form and update the tags table structure
...
See https://github.com/ankitects/anki/pull/900#issuecomment-758284016
- Leave tag names alone and add the collapsed and config columns to the tags table.
- Update The DB check code to preserve the collapse state of used tags.
- Add a simple test for clearing tags and their children
2021-01-12 23:12:35 +03:00
RumovZ
c9b9c73f5e
Fix top-level search errorkinds
2021-01-12 17:32:26 +01:00
Damien Elmes
48892e588b
tidy up UTC offset handling/timing calculations
...
- use the TimestampSecs newtype instead of raw i64s
- use FixedOffset instead of a minutes_west offset
- check localOffset each time the timing is calculated, and set it
if it's stale - even for v1.
- check for and fix missing rollover when calculating timing
- stop explicitly passing localOffset in the sync/start call
2021-01-12 21:32:56 +10:00
RumovZ
c95a592891
Switch parser to custom erros and results
2021-01-12 10:43:12 +01:00
Damien Elmes
1f7faa8bc2
add .clang-format so VS Code preserves formatting style on .proto save
2021-01-12 18:47:08 +10:00
Damien Elmes
f1fd6df0a6
move sync JSON into separate file; add enum wrapper
2021-01-12 18:47:08 +10:00
Damien Elmes
e89d02433d
allow normal sync tests to run offline
2021-01-12 18:47:08 +10:00
Damien Elmes
1cef09b2fa
use '<=' when merging UnchunkableChanges
...
Prevents current tests from failing when testing locally, due the current
second not changing between syncs.
2021-01-12 18:47:08 +10:00
Henrik Giesel
1e74e79a1f
Coerce resched:days as well
2021-01-11 17:25:42 +01:00
Henrik Giesel
00acdd3bf7
Satisfy rslib unit tests
2021-01-11 17:18:40 +01:00
Henrik Giesel
fc52046808
Remove EaseKind impl in favor of transforming to sql in function
2021-01-11 17:10:17 +01:00
Henrik Giesel
fe15df1c4f
Introduce "resched:n" instead of 0 and a flag for "rated"
2021-01-11 16:40:30 +01:00
Henrik Giesel
08e6f5982e
Modify default behavior of rated searches to exclude manual
2021-01-11 16:40:30 +01:00
Damien Elmes
43e05aff6c
update Rust deps; add async_trait
2021-01-11 19:19:45 +10:00
Damien Elmes
4b98ce0145
Merge pull request #917 from hgiesel/querynozero3
...
Coerce added/edited:0 to 1, Constrain rated:n to 1-365
2021-01-11 16:24:12 +10:00
Henrik Giesel
5b1bf8a10e
Fix formatting
2021-01-10 16:38:20 +01:00
Henrik Giesel
40ab80f70e
Add a few rslib unit tests
2021-01-10 16:29:10 +01:00
Henrik Giesel
027677ac6d
Remove coercion in write_rated
2021-01-10 16:23:53 +01:00
Henrik Giesel
d7513fd33d
Coerce added/edited:0 to 1, constrain rated:n to 1 <= 365
2021-01-10 16:16:17 +01:00
Damien Elmes
eda1fb49fd
favour readability over brevity in filter conversion
2021-01-10 09:19:33 +10:00
Damien Elmes
cbd4439f30
Merge pull request #913 from RumovZ/fix-write-template
...
Fix ordinal case in write_template
2021-01-10 08:58:00 +10:00
Damien Elmes
6fecea257b
Merge pull request #911 from RumovZ/backend-filters
...
Backend filters
2021-01-10 08:56:57 +10:00
Damien Elmes
9d95e11505
fix protobuf formatting adding carriage returns on Windows
2021-01-10 08:48:20 +10:00
RumovZ
8798d84cfd
Format backend.proto
2021-01-09 20:09:47 +01:00
RumovZ
0bf7ad0951
Merge branch 'master' into backend-filters
...
Adapt new formatting.
2021-01-09 19:03:43 +01:00
RumovZ
4911757177
Fix ordinal case in write_template
...
Internal card ordinals start at 0, so add 1 again when writing a
template search string from a parsed ordinal.
2021-01-09 17:30:12 +01:00
abdo
12c09d7f80
Remove unused backend methods & formatting
2021-01-09 17:48:34 +03:00
abdo
26d595b428
Fix tag collapse state not getting updated
2021-01-09 17:46:52 +03:00
abdo
68dfbed55f
sql formatting
2021-01-09 17:38:16 +03:00
abdo
a17d309ed3
Move tag collapse method to the backend
2021-01-09 17:10:16 +03:00
abdo
931fa31178
Move sql code for upgrading to schema 17 to a separate file
2021-01-09 17:10:16 +03:00
abdo
6c9a94851c
fill_missing_tags's input should be sorted
...
I assumed that fill_missing_tags will work correctly with un unsorted
tag list previously so I replaced the all_tags_sorted call, but take the following the list for example:
["foo::bar", "foo"]
This will cause "foo" to be counted like a missing tag, since it's
encountered the first time when looking at "foo::bar"", and its config
and other associated data will be lost.
2021-01-09 17:10:16 +03:00
abdo
a18227acc4
Do not check for missing tag parents at registration time
2021-01-09 17:10:16 +03:00
abdo
a30a2638ce
Hierarchical tags
2021-01-09 17:10:13 +03:00
RumovZ
455b693623
Provide filter searches through backend
2021-01-09 10:50:08 +01:00
Damien Elmes
e9dee35885
add clang-format for backend.proto formatting
2021-01-09 17:08:50 +10:00
Damien Elmes
4fe0401d43
format backend.proto with standard Google style
2021-01-09 15:50:24 +10:00
Damien Elmes
ca8b18c5f2
fix some comments in wrong position after format
2021-01-09 14:26:51 +10:00
Damien Elmes
b43515ceff
add .sql file formatter
...
Uses the logic from the sqltools VSCode add-on, with a workaround
for the use of 'type' in some table columns.
By detecting the presence of 'BUILD_WORKSPACE_DIRECTORY' we can tell
if the rule is running in test mode or was run directly, avoiding the
need for separate check and fix rules. It might be nice to extend this
to other formatting rules in the future as well.
2021-01-09 14:22:49 +10:00
Damien Elmes
a055663046
reformat .sql files
2021-01-09 14:08:55 +10:00
Henrik Giesel
e9e8adec9b
Don't import now unused INITIAL_EASE_FACTOR_THOUSANDS
2021-01-08 19:32:36 +01:00
Henrik Giesel
27dfb57ce7
Reset ease to 0 for after rescheduling cards as new
2021-01-08 18:15:24 +01:00
Damien Elmes
61583aae03
fix reposition not honoring provided order, and add unit test
2021-01-08 20:38:49 +10:00
Damien Elmes
4b9e5f425b
Merge pull request #904 from hgiesel/propdue
...
Streamlining `is:due`, `prop:due`, and the FutureDue graph
2021-01-08 16:34:53 +10:00
Damien Elmes
ba665b0e02
handle SortOrderProto conversion separately, and use enum getter
...
In most cases we can just fall back on the default enum value instead
of caring if it's missing/invalid.
2021-01-08 15:56:20 +10:00
Damien Elmes
f20a8f71b7
convert sort_kind_from_pb into from impl
2021-01-08 09:42:54 +10:00
Damien Elmes
336cb3595b
convert from protobuf enum, rather than the underlying i32
2021-01-08 09:24:03 +10:00
Henrik Giesel
66da8549cd
Add comment about integer division
2021-01-07 20:10:25 +01:00
Henrik Giesel
6f9adbe8fd
Restate rslib unit test
2021-01-07 19:56:36 +01:00
Henrik Giesel
8fcf88e606
Search for Learn and PreviewRepeat cards when using prop:due
2021-01-07 19:01:10 +01:00
Henrik Giesel
0d02b1f2f0
Include PreviewRepeat cards in is:due
2021-01-07 17:24:10 +01:00
RumovZ
991a3c1596
Add native enum for concatenate_search's separator
2021-01-07 12:50:57 +01:00
RumovZ
b8f7bb8807
Add Position in PropertyKind match of writer.rs
2021-01-06 23:29:09 +01:00
RumovZ
ac4d254793
Merge branch 'master' of https://github.com/ankitects/anki into norm-search
2021-01-06 20:57:24 +01:00
RumovZ
0b1eec9cd8
Add tests for writer.rs
...
Also minor adjustments to concatenate_searches.
2021-01-06 19:39:34 +01:00
RumovZ
f061ccfb02
Implement search replacing via Ctrl+Shift combo
...
Also switch to using the new backend functions for concatenating and
negating searches.
2021-01-06 18:32:29 +01:00
RumovZ
1c257047b6
Implement replace_search_term
2021-01-06 14:03:43 +01:00
RumovZ
5a9e905b22
Implement concatenate_searches
...
Fix minor stuff in writer.rs.
2021-01-06 14:00:47 +01:00
RumovZ
576ffc2b0a
Implement negate_search
2021-01-06 13:57:35 +01:00
Damien Elmes
e62201c621
Merge pull request #895 from hgiesel/newlearn
...
Change meaning of "is:learn" to filter on type, not queue
2021-01-06 19:13:59 +10:00
Henrik Giesel
453dad18fe
Change meaning of "is:learn" to filter on type, not queue
2021-01-05 17:36:55 +01:00
Damien Elmes
ceca13516b
no need to log card resets when exporting
2021-01-05 11:11:37 +10:00
abdo
85a1c732db
Rename prop:order to prop:pos
2021-01-02 13:35:10 +03:00
abdo
ab8736b37f
Support prop:order to search for new cards by order
2021-01-01 04:36:51 +03:00
Damien Elmes
4b70dc287e
Merge pull request #879 from Arthur-Milchior/Tex_keep_alt
...
Add Alt text to latex image
2020-12-31 12:02:40 +10:00
Damien Elmes
5a87175127
fix clippy error in unit test
2020-12-31 09:48:05 +10:00
Arthur Milchior
f19592b27f
Add Alt text to latex image
...
I'm trying to go over accessibilities issues in AnkiDroid. Since we'll use rust backend, I thought I might as well go
over it in rust directly. The only side effect in anki is that, if you copy a text with the image, you'll get the LaTeX
copied instead of nothing. Alas, it seems qt does not show alt text.
2020-12-30 18:00:06 +01:00
Damien Elmes
26c13f6dba
add aarch64 Linux to cargo; update deps
2020-12-30 13:33:16 +10:00
RumovZ
6ad500db55
Make function names more explicit and add docs
2020-12-29 11:18:49 +01:00
RumovZ
6a2f1fc6aa
Make normalized search syntax more explicit
...
Also fix a bug with NoCombining and WordBoundary searches.
2020-12-29 11:06:53 +01:00
Arthur Milchior
98276f1e71
NF: test # / and ^ can remains at end of string
2020-12-28 07:58:15 +01:00
Damien Elmes
e2be0c2cbd
simplify NoteField init in test; add other bad chars
2020-12-28 13:19:37 +10:00
Damien Elmes
e14198fad7
fix comment and add basic unit test
2020-12-28 13:14:49 +10:00
Damien Elmes
ed32a66a6b
Merge pull request #870 from Arthur-Milchior/trim_start_field_name
...
Trim the start of field name if it is #, /, ^ or a whitespace
2020-12-28 13:06:57 +10:00