company-lua icon indicating copy to clipboard operation
company-lua copied to clipboard

How to support other Lua libs?

Open zilongshanren opened this issue 8 years ago • 2 comments

I have lots of Lua APIs, how could I generate file like https://github.com/ptrv/company-lua/blob/master/lua/api/love2d.lua?

Is there any scripts to do this?

If there is a easy way to support other Lua libs, it would be pretty awesome! 😄

Thanks.

zilongshanren avatar Apr 12 '16 01:04 zilongshanren

Hi @zilongshanren

Unfortunately there is no script for generating api files. I copied the api from ZeroBrane Studio

There is also a wiki entry for the api file format here: https://studio.zerobrane.com/doc-api-auto-complete

I guess you would have to write the api generation script yourself.

ptrv avatar Apr 15 '16 15:04 ptrv

@ptrv I only saw the api docs now thanks to this issue :). I saw in the doc that

When valuetype is specified for a method or a function, it is used for auto-complete type guessing. 
... e.g. if somefunc has valuetype of math, then after test = somefunc(), typing test. 
will be treated as math. in auto-complete logic.

When inherits is specified for a class, it is used by auto-complete logic to suggest values, 
functions, and methods from the base class(es) in addition to the methods from the current 
class. You may specify several classes (inherits = 'a b') and complex class names 
(inherits = 'b2.Shape'). The entire inheritance chain will be looked at during the analysis.

Does company-lua fully support this feature?

se4u avatar Jul 07 '17 06:07 se4u