You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* A draft of contributing guide
* add: building on the contributing page
* refactor: simplify contribute section in footer
* add: build article to getting started category
* fix: wording
* add: info to developing wiki page
---------
Co-authored-by: carsakiller <[email protected]>
-[Help translate to another language](/wiki/translations)
14
+
-[Improve this wiki](https://github.com/LuaLS/LuaLS.github.io/blob/main/docs/CONTRIBUTING.md)
15
+
16
+
> Is there something else I can do?
17
+
18
+
-[Star the repository](https://github.com/LuaLS/lua-language-server) if you find the project helpful
19
+
- Spread the word!
20
+
- You can [sponsor](https://github.com/LuaLS/lua-language-server/issues/484) the project
21
+
22
+
## Contributing code
23
+
24
+
If you're familiar with Lua, you can grab the [source code](https://github.com/LuaLS/lua-language-server) and dive in. There are additional wiki articles that go more in-depth on [building from source](/wiki/build) and [developing](/wiki/developing). An overview of the project's file structure can be found [on the developing page](/wiki/developing#file-structure).
25
+
26
+
We don't have a strict git workflow that needs to be followed. When you have some changes ready to merge, [open a pull request](https://github.com/LuaLS/lua-language-server/pulls). If you need some help, feel free to open a draft pull request – although please be patient and keep in mind that the team is very small.
27
+
28
+
When making changes to the language server, please make sure to add an entry to the project's [changelog](https://github.com/LuaLS/lua-language-server/blob/master/changelog.md) file, so it is documented and advertised to users.
29
+
30
+
## Contributing LuaCATS Annotations
31
+
32
+
The Lua Language Server implements a system for defining and documenting code called LuaCATS (Lua Comment And Type System). You can contribute to our ecosystem by writing [LuaCATS annotations](/wiki/annotations) for widely used Lua libraries. These can help give users out-of-the-box autocompletion and type checking for the library. This is done by creating [definition files](/wiki/definition-files) that can then be included in an [addon](/wiki/addons) and distributed using the [addon manager](/wiki/addons#addon-manager).
33
+
34
+
You can browse annotations maintained by the community in the [LuaCATS organization](https://github.com/LuaCATS).
Thank you for taking an interest in helping improve the language server!
16
16
17
+
## Overview
18
+
19
+
The Lua Language Server is written, rather fittingly, in Lua. As a result of Lua being designed for embedding in other programs, its standard library is pretty basic. This means that in order for it to be run as a standalone program, with better io, threading, etc., it requires a runtime written in another language. The language server uses [bee.lua](https://github.com/actboy168/bee.lua) (C++) as its runtime.
20
+
21
+
An advantage of Lua being an interpreted language is that the source files can be quickly edited and tested with no compile step needed, although hot-reloading is not supported (the server must be restarted).
22
+
17
23
## Debugging
18
24
19
-
Debugging can be performed in a few ways. You can [do a quick `print()`](#quick-print), [write to the log file](#append-to-log-file), or [attach a debugger](#attach-debugger) to get all the info you need.
25
+
Debugging can be performed in a few ways:
26
+
27
+
-[Print](#print)
28
+
-[Log](#append-to-log-file)
29
+
-[Debugger](#attach-debugger)
20
30
21
-
### Quick Print
31
+
### Print
22
32
23
-
You can quickly `print()` to the `OUTPUT` panel (<kbd>Ctrl + Shift + U</kbd>) in Visual Studio Code.
33
+
A quick call to the familiar `print()`will, as expected, write the given parameters out to `stdout`. When running the language server using Visual Studio Code, the output can be seen in the `OUTPUT` panel (<kbd>Ctrl + Shift + U</kbd>):
A [plugin](/wiki/plugins) can also be debugged quickly this way:
28
55
29
56
```Lua
30
57
localutil=require'utility'
@@ -35,9 +62,9 @@ function OnSetText(uri, text)
35
62
end
36
63
```
37
64
38
-
### Append to Log File
65
+
### Log
39
66
40
-
You can add an entry to the [log file](/wiki/FAQ#where-can-i-find-the-log-file). Below is an example of how a [plugin](/wiki/plugins) can be debugged.
67
+
You can add an entry to the [log file](/wiki/FAQ#where-can-i-find-the-log-file) using the levels `trace`, `debug`, `info`, `warn`, `error`, and `fatal`. Below is an example of how a [plugin](/wiki/plugins) can be debugged.
41
68
42
69
```Lua
43
70
localutil=require'utility'
@@ -48,14 +75,14 @@ function OnSetText(uri, text)
48
75
end
49
76
```
50
77
51
-
### Attach Debugger
78
+
### Debugger
52
79
53
80
This is the most advanced method, but provides all kinds of useful info and is the most "proper" way to debug the language server.
54
81
55
82
You will need two Visual Studio Code instances open:
56
83
57
84
1. The **Debug Host**
58
-
- This instance has the language server open which can be found in one of these locations:
85
+
- This instance has the language server open, which can be found in one of these locations:
59
86
<Tabs
60
87
active="Windows"
61
88
buttons={[
@@ -64,9 +91,15 @@ You will need two Visual Studio Code instances open:
- This instance is where you will test the language server. It should have a folder opened where you can write Lua to test the various features of the language server and use it as normal.
0 commit comments