فهرست منبع

Add VS Code Setup guide;

bjorn 4 ماه پیش
والد
کامیت
59d4a39ac9
2فایلهای تغییر یافته به همراه33 افزوده شده و 0 حذف شده
  1. 32 0
      guides/VS_Code_Setup.md
  2. 1 0
      guides/init.lua

+ 32 - 0
guides/VS_Code_Setup.md

@@ -0,0 +1,32 @@
+VS Code Setup
+===
+
+[VS Code](https://code.visualstudio.com) is a popular text editor with a powerful Lua extension that
+provides typechecking and autocomplete, [Lua Language Server](https://luals.github.io) (or LuaLS).
+LuaLS has an official addon for LÖVR, which allows VS Code to autocomplete the LÖVR API with
+detailed type information generated from the docs.
+
+Setup
+---
+
+To start, install the LuaLS extension.  You can do this by pressing `Ctrl + Shift + P` and typing
+"install extensions".  In the extension menu, search for "Lua" and install the extension from
+sumneko.
+
+Next, open the LuaLS addon manager.  Press `Ctrl + Shift + P` again and search for "addon manager".
+Search for "lovr" in the addon manager and install it.
+
+That's it!  LÖVR autocomplete should now be working.
+
+Manual Installation
+---
+
+It is possible to generate LuaLS definitions from the API data in the
+[lovr-docs](https://github.com/bjornbytes/lovr-docs) repo.  This can be useful to generate
+bleeding-edge LuaLS definitions, since the official addon is only updated when LÖVR releases a new
+version.
+
+To do this, run `lovr api cats` from the root of the lovr-docs repository, which will output the
+definitions to `api/cats` (there should be a `config.json` and a `library` folder in there).
+Finally, the full path to the `cats` folder can be added to the `Lua.workspace.library` setting to
+use these custom definitions in a workspace.

+ 1 - 0
guides/init.lua

@@ -8,6 +8,7 @@ return {
   'Plugins',
   'Plugins',
   'Distribution',
   'Distribution',
   'Contributing',
   'Contributing',
+  'VS_Code_Setup',
   'Compiling',
   'Compiling',
   'FAQ',
   'FAQ',
   'v0.17.0',
   'v0.17.0',