feat: enhance autocomplete functionality for code tokens and filenames

This commit is contained in:
Paul Gauthier 2024-08-27 15:21:41 -07:00
parent d407a878c4
commit 31f7856f41
2 changed files with 7 additions and 6 deletions

View file

@ -3,6 +3,7 @@ import unittest
from pathlib import Path
from unittest.mock import MagicMock, patch
from aider.dump import dump # noqa: F401
from aider.io import AutoCompleter, ConfirmGroup, InputOutput
from aider.utils import ChdirTemporaryDirectory
@ -33,7 +34,8 @@ class TestInputOutput(unittest.TestCase):
Path(fname).write_text("def hello(): pass\n")
autocompleter = AutoCompleter(root, rel_fnames, addable_rel_fnames, commands, "utf-8")
self.assertEqual(autocompleter.words, set(rel_fnames + ["hello"]))
dump(autocompleter.words)
self.assertEqual(autocompleter.words, set(rel_fnames + [("hello", "`hello`")]))
encoding = "utf-16"
some_content_which_will_error_if_read_with_encoding_utf8 = "ÅÍÎÏ".encode(encoding)