Adjust unit_tests
This commit is contained in:
parent
f596f7729d
commit
ec518753c0
@ -1,4 +1,5 @@
|
||||
description: Generate unit tests.
|
||||
input: required
|
||||
help: README.md
|
||||
steps:
|
||||
- run: $devchat_python $command_path/main.py "$input"
|
@ -1,5 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict, List, Optional, Set
|
||||
@ -13,9 +12,13 @@ from tools.symbol_util import (
|
||||
split_tokens,
|
||||
)
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
|
||||
|
||||
from libs.ide_services import IDEService, Location, Position, Range, SymbolNode
|
||||
from lib.ide_service import (
|
||||
IDEService,
|
||||
Location,
|
||||
Position,
|
||||
Range,
|
||||
SymbolNode,
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -142,7 +145,7 @@ def _extract_recommended_symbols_context(
|
||||
last_token = s
|
||||
|
||||
# locate the symbol in the file
|
||||
positions = locate_symbol_by_name(last_token, abs_path)
|
||||
positions: List[Position] = locate_symbol_by_name(last_token, abs_path)
|
||||
|
||||
for pos in positions:
|
||||
type_locations = client.find_type_def_locations(abs_path, pos.line, pos.character)
|
||||
|
@ -1,14 +1,8 @@
|
||||
import os
|
||||
import sys
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
import click
|
||||
|
||||
sys.path.append(os.path.dirname(__file__))
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "libs"))
|
||||
|
||||
from cache import LocalCache
|
||||
from chatmark import Checkbox, Form, Step, TextEditor # noqa: E402
|
||||
from find_context import (
|
||||
Context,
|
||||
Position,
|
||||
@ -18,7 +12,6 @@ from find_context import (
|
||||
)
|
||||
from find_reference_tests import find_reference_tests
|
||||
from i18n import TUILanguage, get_translation
|
||||
from ide_services import IDEService # noqa: E402
|
||||
from model import (
|
||||
FuncToTest,
|
||||
TokenBudgetExceededException,
|
||||
@ -28,6 +21,9 @@ from propose_test import propose_test
|
||||
from tools.file_util import retrieve_file_content
|
||||
from write_tests import write_and_print_tests
|
||||
|
||||
from lib.chatmark import Checkbox, Form, Step, TextEditor
|
||||
from lib.ide_service import IDEService
|
||||
|
||||
CHAT_WORKFLOW_DIR_PATH = [".chat", "workflows"]
|
||||
|
||||
|
||||
|
@ -1,14 +1,10 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
from tools.file_util import retrieve_file_content
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
|
||||
from libs.ide_services import Position, SymbolNode
|
||||
from lib.ide_service import Position, SymbolNode
|
||||
|
||||
|
||||
def split_tokens(text: str) -> Dict[str, List[int]]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user