Replies: 1 comment 1 reply
-
Ah, I have discovered there is already an existing ticket opened for exactly this same use-case :) Seems like I'll be able to use backticks for this in a future release? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The current OpenResty
ngx
annotations are a good example of this problem:https://github.com/sumneko/lua-language-server/blob/5d5a79fd52c2898bb3e238e750347d8ed9f4da6a/meta/3rd/OpenResty/library/ngx.lua#L4089-L4091
So there's a global
ngx
object with a functionngx.log()
that takes a log level as its first parameter. The log levels are all integers that are defined as "constant" values on thengx
table (i.e.ngx.DEBUG
,ngx.INFO
, and so on), such that the convention is to call the function like so:I'd like to annotation this function so that the log level constants are returned as tab completion items:
You can see how I've attempted to annotate things here:
https://github.com/sumneko/lua-language-server/blob/5d5a79fd52c2898bb3e238e750347d8ed9f4da6a/meta/3rd/OpenResty/library/ngx.lua#L146-L167
However, the completion items come back as strings:
Here's the RPC response from the server:
I've tried all sorts of permutations for this, and I can't seem to make it work. Either I get back strings or I get no completion results at all.
object name/reference: "unknown alias
ngx.DEBUG
"alias: no results
class: no results
quoted alias: results are strings instead of names/references
Beta Was this translation helpful? Give feedback.
All reactions