mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed CR-PY-1, added test
This commit is contained in:
@@ -83,8 +83,8 @@ public class SphinxDocString extends StructuredDocString {
|
||||
if (tagEnd < 0) return index;
|
||||
String tagName = line.substring(1, tagEnd);
|
||||
String tagValue = line.substring(tagEnd).trim();
|
||||
tagValue = tagValue.replaceAll(":py:class:", "");
|
||||
tagValue = tagValue.replaceAll(":class:", "");
|
||||
tagValue = StringUtil.replace(tagValue, ":py:class:", "");
|
||||
tagValue = StringUtil.replace(tagValue, ":class:", "");
|
||||
tagValue = tagValue.replaceAll("`(\\w+)`", "$1");
|
||||
int pos = tagValue.indexOf(':');
|
||||
if (pos < 0) return index;
|
||||
|
||||
@@ -185,6 +185,12 @@ public class PyTypeTest extends PyLightFixtureTestCase {
|
||||
assertEquals("int", type.getName());
|
||||
}
|
||||
|
||||
public void testRestClassType() { //PY-3849
|
||||
PyClassType type = (PyClassType) doTest("class Foo: pass\ndef foo(limit):\n" +
|
||||
" ''':param :class:`Foo` limit: maximum number of stack frames to show'''\n" +
|
||||
" expr = limit");
|
||||
assertEquals("Foo", type.getName());
|
||||
}
|
||||
|
||||
private PyType doTest(final String text) {
|
||||
myFixture.configureByText(PythonFileType.INSTANCE, text);
|
||||
|
||||
Reference in New Issue
Block a user