Codegen: remove unneeded `has_description` property

This commit is contained in:
Paolo Tranquilli 2023-11-24 06:00:05 +01:00
Родитель 9264b2a6d6
Коммит 2d34fec0a2
4 изменённых файлов: 0 добавлений и 20 удалений

Просмотреть файл

@ -81,10 +81,6 @@ class Property:
def is_child(self):
return self.prev_child is not None
@property
def has_description(self) -> bool:
return bool(self.description)
@property
def is_indexed(self) -> bool:
return self.is_repeated and not self.is_unordered

Просмотреть файл

@ -83,11 +83,9 @@ module Generated {
/**
* {{>ql_property_doc}} *
{{#has_description}}
{{#description}}
* {{.}}
{{/description}}
{{/has_description}}
*/
final {{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) {
exists({{type}} immediate | immediate = this.get{{#is_unordered}}An{{/is_unordered}}Immediate{{singular}}({{#is_indexed}}index{{/is_indexed}}) and
@ -98,11 +96,9 @@ module Generated {
{{^type_is_hideable}}
/**
* {{>ql_property_doc}} *
{{#has_description}}
{{#description}}
* {{.}}
{{/description}}
{{/has_description}}
*/
{{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) {
{{^synth}}

Просмотреть файл

@ -18,11 +18,9 @@ module Raw {
{{^synth}}
/**
* {{>ql_property_doc}} *
{{#has_description}}
{{#description}}
* {{.}}
{{/description}}
{{/has_description}}
*/
{{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) {
{{tablename}}({{#tableparams}}{{^first}}, {{/first}}{{param}}{{/tableparams}})

Просмотреть файл

@ -159,16 +159,6 @@ def test_has_doc(doc, internal, expected):
assert stub.has_qldoc is expected
def test_property_with_description():
prop = ql.Property("X", "int", description=["foo", "bar"])
assert prop.has_description is True
def test_class_without_description():
prop = ql.Property("X", "int")
assert prop.has_description is False
def test_synth_accessor_has_first_constructor_param_marked():
params = ["a", "b", "c"]
x = ql.SynthUnderlyingAccessor("foo", "bar", params)