Skip to content

Commit 3188b32

Browse files
committed
cedarscript-ast-parser>=0.7.0
1 parent 057aa13 commit 3188b32

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323
keywords = ["cedarscript", "code-editing", "refactoring", "code-analysis", "sql-like", "ai-assisted-development"]
2424
dependencies = [
2525
"orgecc-pylib>=0.1.3",
26-
"cedarscript-ast-parser>=0.6.1",
26+
"cedarscript-ast-parser>=0.7.0",
2727
"grep-ast==0.4.1",
2828
# https://github.com/tree-sitter/py-tree-sitter/issues/303
2929
# https://github.com/grantjenks/py-tree-sitter-languages/issues/64

tests/corpus/chat.make-top-level-from-method.1/chat.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ Here's my plan to implement the requested changes:
1111
Here's the CEDARScript script:
1212

1313
```CEDARScript
14-
-- 1. Move the `_candidate()` method from the `A` class, placing it at the top level, just before the line where its class starts
14+
# 1. Move the `_candidate()` method from the `A` class, placing it at the top level, just before the line where its class starts
1515
UPDATE CLASS "A"
1616
FROM FILE "main.py"
1717
MOVE FUNCTION "_candidate"
1818
INSERT BEFORE CLASS "A"
1919
RELATIVE INDENTATION 0;
2020

21-
-- 2. Update the copied function to remove references to `self`
21+
# 2. Update the copied function to remove references to `self`
2222
UPDATE FUNCTION "_candidate"
2323
FROM FILE "main.py"
2424
REPLACE LINE "def _candidate(self, a, b, c):"
2525
WITH CONTENT '''
2626
@0:def _candidate(a, b, c):
2727
''';
2828

29-
-- 3. Update ALL call sites of the method `_candidate()` to call the new top-level function with the same name
29+
# 3. Update ALL call sites of the method `_candidate()` to call the new top-level function with the same name
3030
UPDATE FUNCTION "_check"
3131
FROM FILE "main.py"
3232
REPLACE LINE "self._candidate("

tests/corpus/move.decorated-method/chat.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<no-train>
22
```CEDARScript
3-
-- 1. Move the `get_fault_text` method from the `SpyderKernel` class to be a top-level function
3+
# 1. Move the `get_fault_text` method from the `SpyderKernel` class to be a top-level function
44
UPDATE METHOD "SpyderKernel.get_fault_text"
55
FROM FILE "1.py"
66
MOVE WHOLE
77
INSERT BEFORE CLASS "SpyderKernel"
88
RELATIVE INDENTATION 0;
99

10-
-- 2. Update the copied function to remove references to `self`
10+
# 2. Update the copied function to remove references to `self`
1111
UPDATE FUNCTION "get_fault_text"
1212
FROM FILE r"1.py"
1313
REPLACE WHOLE WITH CASE

tests/corpus/move.double-decorated-method/chat.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<no-train>
22
```CEDARScript
3-
-- 1. Move the `get_fault_text` method from the `SpyderKernel` class to be a top-level function
3+
# 1. Move the `get_fault_text` method from the `SpyderKernel` class to be a top-level function
44
UPDATE METHOD "SpyderKernel.get_fault_text"
55
FROM FILE "1.py"
66
MOVE WHOLE
77
INSERT BEFORE CLASS "SpyderKernel"
88
RELATIVE INDENTATION 0;
99

10-
-- 2. Update the copied function to remove references to `self`
10+
# 2. Update the copied function to remove references to `self`
1111
UPDATE FUNCTION "get_fault_text"
1212
FROM FILE r"1.py"
1313
REPLACE WHOLE WITH CASE

tests/corpus/refactor-benchmark.indentation-size-discovery/chat.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<no-train>
22
```CEDARScript
33

4-
-- Try CST-based indentation discovery
5-
-- Move the `__get_brackets` method from the `CodeEditor` class, placing it at the top level, just before the line where its class starts
4+
# Try CST-based indentation discovery
5+
# Move the `__get_brackets` method from the `CodeEditor` class, placing it at the top level, just before the line where its class starts
66
UPDATE CLASS "CodeEditor"
77
FROM FILE "codeeditor.py"
88
MOVE METHOD "__get_brackets"
99
INSERT BEFORE CLASS "CodeEditor"
1010
RELATIVE INDENTATION 0;
1111

12-
-- 1. Move the method to become a top-level function.
12+
# 1. Move the method to become a top-level function.
1313
UPDATE CLASS "AutosaveForPlugin"
1414
FROM FILE "autosave.py"
1515
MOVE METHOD "get_files_to_recover"
1616
INSERT BEFORE CLASS "AutosaveForPlugin"
1717
RELATIVE INDENTATION 0;
1818

19-
-- 1. Move the `adapt_method_mode` method from the `BaseHandler` class, placing it at the top level, just before the line where its class starts
19+
# 1. Move the `adapt_method_mode` method from the `BaseHandler` class, placing it at the top level, just before the line where its class starts
2020
UPDATE CLASS "BaseHandler"
2121
FROM FILE "base.py"
2222
MOVE METHOD "adapt_method_mode"

tests/corpus/update.identifier.case-filter/chat.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ REPLACE WHOLE WITH CASE
2020
r'\1'
2121
END;
2222

23-
-- Update the copied function to remove references to `self`
23+
# Update the copied function to remove references to `self`
2424
UPDATE FUNCTION "_make_source_table"
2525
FROM FILE "analyzer_cli.py"
2626
REPLACE WHOLE WITH CASE
@@ -29,7 +29,7 @@ REPLACE WHOLE WITH CASE
2929
r'''\1'''
3030
END;
3131

32-
-- Update ALL call sites of the method `_make_source_table` to call the new top-level function with the same name
32+
# Update ALL call sites of the method `_make_source_table` to call the new top-level function with the same name
3333
UPDATE METHOD "DebugAnalyzer.list_source"
3434
FROM FILE "analyzer_cli.py"
3535
REPLACE BODY WITH CASE

tests/corpus/update.identifier.ed-script-filter!nowindows/chat.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ g/^def convert/s/self, //
88

99
''';
1010

11-
-- 1. Update the function signature of `calc1()` to add parameter `tax: float` as the first one and use the new parameter instead of `7`
11+
# 1. Update the function signature of `calc1()` to add parameter `tax: float` as the first one and use the new parameter instead of `7`
1212
UPDATE FUNCTION "calc1"
1313
FROM FILE "1.py"
1414
REPLACE WHOLE WITH ED r'''
@@ -18,8 +18,8 @@ g/return/s/7.*/tax/
1818

1919
''';
2020

21-
-- 2. Update the function signature of `calc2()` to add parameter `base_tax: float = 1.3` as the last one
22-
-- 3. Update ALL call sites of `calc1()` to pass `base_tax` as the first argument
21+
# 2. Update the function signature of `calc2()` to add parameter `base_tax: float = 1.3` as the last one
22+
# 3. Update ALL call sites of `calc1()` to pass `base_tax` as the first argument
2323
UPDATE FUNCTION "calc2"
2424
FROM FILE "1.py"
2525
REPLACE WHOLE WITH ED r'''

tests/corpus/update.identifier.move.whole.1/chat.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<no-train>
22
```CEDARScript
3-
-- A02 becomes local to b
3+
# A02 becomes local to b
44
UPDATE FUNCTION "b" FROM FILE "main.py"
55
MOVE WHOLE
66
INSERT BEFORE CLASS "A02"

tests/corpus/update.identifier.move.whole.2/chat.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<no-train>
22
```CEDARScript
3-
-- 2nd pst becomes inner of A3
3+
# 2nd pst becomes inner of A3
44
UPDATE FUNCTION "pst" OFFSET 1 FROM FILE "main.py"
55
MOVE WHOLE INSERT AFTER CLASS "A3"
66
RELATIVE INDENTATION 1;

0 commit comments

Comments
 (0)