Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the standard #1

Open
pablomayobre opened this issue Apr 30, 2017 · 0 comments
Open

Define the standard #1

pablomayobre opened this issue Apr 30, 2017 · 0 comments

Comments

@pablomayobre
Copy link
Owner

pablomayobre commented Apr 30, 2017

@dapetcu21 @mpeterv

I have created this repository to define the standard here and keep discussion away from both Luacheck and Autocomplete-Lua repositories.

We can use the Code space to push examples and such and the Project space to detail specific implementation details.

What I would like to achieve with this is to create a single file format that could replace .luacheckrc and .luacompleterc. This doesn't mean that this file would become the main file of both Luacheck and Autocomplete-Lua, it can have less options that those provided by the .luacheckrc and .luacompleterc files. This file tries to offer the most minimal API for most project in a format that would fit both Luacheck and Autocomplete-Lua.

So let me begin detailing what I consider would be a good starting point:

{
  "lua": "luajit-2.0", //Base lua version (used by both)
  "standard": ["busted", "love"], //This is taken from Luacheck (Autocomplete can ignore it)
  "path": "./?.lua,./?/init.lua", //This is taken from Autocomplete (Luacheck can ignore it)
  "cwd": "current/working/directory",

  //This is the important part!
  "globals": {
    "my_global": { //TYPE DEFINITION
      //Luacheck
      "read-only": false,
      "other-fields": true,
      //Autocomplete
      "type": "table",
      //Both
      "fields": {
        "my_field": {
          "read-only": true,
          "type": "function",
          "args": [ ["name", "displayName"], "other", "..." ], //No way to define argTypes, could be expanded later
          "return": "Something" //Anything that isn't a standard type is a namedType
          "docs": "Documentation in markdown",
          "link": "link"
        }
      }
    }
  },
  //Named types, ignored by Luacheck
  "types": {
    "Something": {
      //TYPE DEFINITION
    }
  }
}

As you can see there is no much differece to what the current files look like!, We are just merging them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant