diff options
author | Simon Bernard | 2018-04-03 14:06:42 +0000 |
---|---|---|
committer | Simon Bernard | 2018-04-03 14:06:42 +0000 |
commit | 3946f93aef832732e29a6822c176ef10f3197226 (patch) | |
tree | 287e3182a6998f05f63df63707eb471eae8c0b84 | |
parent | c42c45925f1bb5b670cf6a5e5fe863a8ce91bd0d (diff) | |
download | org.eclipse.ldt-3946f93aef832732e29a6822c176ef10f3197226.tar.gz org.eclipse.ldt-3946f93aef832732e29a6822c176ef10f3197226.tar.xz org.eclipse.ldt-3946f93aef832732e29a6822c176ef10f3197226.zip |
-rw-r--r-- | libraries/modelsbuilder/models/internalmodelbuilder.mlua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libraries/modelsbuilder/models/internalmodelbuilder.mlua b/libraries/modelsbuilder/models/internalmodelbuilder.mlua index 20f7fef..18a13eb 100644 --- a/libraries/modelsbuilder/models/internalmodelbuilder.mlua +++ b/libraries/modelsbuilder/models/internalmodelbuilder.mlua @@ -549,6 +549,22 @@ getitem = function (binder, itemname, comment2apiobj, file) end end end + else + -- this is the case where we have + -- function expr.f(self) or function expr:f() + -- we suppose the type of self is the type of "expr" + if itemname == "self" and i==1 and binder.parent.tag == "Set" then + match binder.parent with + |`Set { {`Index { right , string}}, {...}} -> + -- if node is an expression supported + local supportedexpr = expreto_expression[right] + if supportedexpr then + -- create expression type ref + local selftype = apimodel._exprtyperef(supportedexpr,1) + return createitem(itemname,id,selftype) + end + end + end end return createitem(itemname,id) end |