Commit Graph

17 Commits

Author SHA1 Message Date
Petr Mironychev
5808a892c1 fix: Change expected name in test 2025-03-27 00:41:28 +01:00
Povilas Kanapickas
8a1fd5438e
chore: Add tests for LLMClientInterface (#131) 2025-03-10 21:54:17 +01:00
Povilas Kanapickas
3aae923d43
feat: Improve describe recent changes in system prompt (#113)
Co-authored-by: Petr Mironychev <9195189+Palm1r@users.noreply.github.com>
2025-03-08 08:58:28 +01:00
Povilas Kanapickas
f94c79a5ff
fix: Improve support for code blocks without language (#108)
This makes it possible to represent code blocks in models that emit
their suggestion immediately after the ``` characters.
2025-03-07 15:30:22 +01:00
Povilas Kanapickas
9a5047618d
chore: Silence Qt warnings during tests (#110) 2025-03-07 01:58:09 +01:00
Povilas Kanapickas
90beebf2ee
Revert "refactor: Move all processing logic to CodeHandler::processText()" (#109) 2025-03-07 01:57:13 +01:00
Povilas Kanapickas
521261e0a3
refactor: Move all processing logic to CodeHandler::processText() (#107)
This will become useful once more processing modes are available
2025-03-06 18:49:28 +01:00
Povilas Kanapickas
81ac3c71fb
chore: Add tests for CodeHandler (#105)
* chore: Extract test utils to separate file

This makes it possible to reuse the utils in other test files.

* chore: Add tests for CodeHandler
2025-03-06 13:45:12 +01:00
Povilas Kanapickas
61ca5c9a1b
fix: Properly omit copyright information (#103)
This commit ensures that copyright information is always excluded and
that context is always split into prefix and suffix at correct position.
2025-03-06 13:00:15 +01:00
Povilas Kanapickas
8a167bf248
chore: Expand DocumentContextReaderTest to cover more conditions (#102)
Tests should have "before" and "after" cases side by side, so that it's
possible to easily verify that full context is extracted correctly.

Also tests should consistently cover the same conditions in all the
different scenarios.
2025-03-06 12:08:57 +01:00
Povilas Kanapickas
ab97f39ea4
chore: Fix pretty printing for QString (#101)
Previously QString was printed symbol by symbol. E.g.:

reader.readWholeFileAfter(3, 1)
    Which is: { "i", "n", "e", " ", "2", "
", "L", "i", "n", "e", " ", "3" }
2025-03-06 12:08:16 +01:00
Povilas Kanapickas
1d062e1fe4
chore: Use zero-based line numbers in tests (#100)
This makes the line index arguments passed to functions match the actual
test data, thus tests are less confusing.
2025-03-06 11:53:27 +01:00
Povilas Kanapickas
5dceb5cd19
fix: Bring back old behavior of readStrings{After,Before}Cursor setting (#97) 2025-03-05 20:27:16 +01:00
Povilas Kanapickas
69a8aa80d9
refactor: Make DocumentContextReader::prepareContext() testable (#96) 2025-03-05 20:18:59 +01:00
Povilas Kanapickas
3dc0d910bf
fix: Fix off by one errors in getContext{Before,After}() (#94)
This also specifies what exactly getContext*() functions do. Before this
commit linesCount was sometimes interpreted as exclusive of current
line, which was confusing as linesCount + 1 lines were being returned.
2025-03-05 19:32:53 +01:00
Povilas Kanapickas
f9f2a86cea
fix: Correctly pick whole file context (#85)
Currently the current line is duplicated in both "before" and "after"
context. This is due to DocumentContextReader::readWholeFileAfter()
picking the current line part of which has been already included into
the "before" context.
2025-03-05 19:17:51 +01:00
Povilas Kanapickas
247256d4a4
chore: Add unit tests for DocumentContextReader (#90)
chore: Add unit tests for DocumentContextReader

The tests are based on GTest like some tests in Qt Creator itself, which
makes it easy to run as full Qt Creator does not need to be started.
2025-03-05 15:01:52 +01:00