dapetcu21 / atom-autocomplete-lua

Extensible autocomplete+ provider for Lua
35 stars 6 forks source link

.luacompleterc doesn't work on Windows #4

Closed nbredikhin closed 7 years ago

nbredikhin commented 7 years ago

My issue seems to be very similar to #3, but the difference is that I'm running Atom on Windows 10 x64. Everything works perfectly except .luacompleterc.

Here's my .luacompleterc contents: (I actually tried many different examples of this file, etc, but nothing works)

{
  "global": {
    "type": "table",
    "fields": {
      "myfunc":  { 
        "type": "function",
        "description": "Just testing",
        "args": [{ "name": "arg1" }, { "name": "arg2", "displayName": "[arg2]" }]
      }
    }
  }
}

So I tried to debug your package and here is some information I got.

  1. Here you can see my test project structure and also you can see that debugger stops at breakpoint and show the correct file path. image

  2. Here's what's being passed to utils.mergeOptionsCached method. We can see that it has opened and read my .luacompleterc with no problems: image

  3. Then I renamed my function in .luacompleterc to avoid caching and checked what does mergeOptionsCached return: image image

I'm not really familiar with Atom packages, but I guess that LuaCompleteRcProvidergetOptions` returns what it's supposed to return. So do you have any ideas? Thank you in advance.

P.S: Sorry for my bad english and thank you for this really useful package.

dapetcu21 commented 7 years ago

Hi. Sorry for answering so late. I'll take a look on windows when I get home and see if I can reproduce.

dapetcu21 commented 7 years ago

I was able to reproduce something and fix it. I just find it weird that it manifested only on Windows. Try 0.7.1 and tell me how that works for you.

nbredikhin commented 7 years ago

Looks like it works now. Thank you for this fix!

Can I ask here, how can I force it to reload .luacompleterc btw? It doesn't reload when saving/reopening/editing files, but only when I restart Atom.

And another little question if possible: is/will it be possible to use named types references inside the named types definitions? Like that: image

Currently it looks like that for me: image

I'm not sure, maybe it should probably be moved to another issue

dapetcu21 commented 7 years ago

For your first question, .luacompleterc should get automatically reloaded. If it doesn't reload for you, then that's a bug and I'll take a look.

And as far as nested namedTypes go, good catch! I didn't think about that. I'll fix it in a minute.

dapetcu21 commented 7 years ago

I opened a separate issue about the .luacompleterc problem. For the namedTypes issue, I just pushed a commit, but I'll release it along with the fix for #5.