Skip to content

Commit c944d9f

Browse files
C3pacarsakiller
andauthored
Contributing guide (#35)
* 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]>
1 parent 7c3fc04 commit c944d9f

File tree

4 files changed

+88
-21
lines changed

4 files changed

+88
-21
lines changed

src/components/layout/Footer.astro

+1-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ const { class: className } = Astro.props;
2020
</ExternalLink>
2121
</li>
2222
<li>
23-
<a href="/wiki/developing/">Development guide</a>
24-
</li>
25-
<li>
26-
<ExternalLink url="https://github.com/LuaLS/LuaLS.github.io/blob/main/docs/CONTRIBUTING.md">Wiki</ExternalLink>
27-
</li>
28-
<li>
29-
<a href="/wiki/translations/#contributing">Translate</a>
23+
<a href="/wiki/contributing/">Contributing guide</a>
3024
</li>
3125
<li>
3226
<ExternalLink

src/content/wiki/contributing.mdx

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Contributing
3+
description: A guide to contributing to the Lua Language Server.
4+
getting-started: true
5+
---
6+
7+
Thank you for your interest in contributing to the Lua Language Server! Your contributions help improve the experience for all users.
8+
9+
> I want to...
10+
11+
- [Contribute features/fixes](#contributing-code)
12+
- [Create LuaCATS annotations](#contributing-luacats-annotations)
13+
- [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).

src/content/wiki/developing.mdx

+47-14
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,50 @@ import Remark from "~/components/common/Remark.astro";
88
import Accordion from "~/components/common/Accordion.astro";
99
import FileTreeItem from "~/components/common/FileTreeItem.astro";
1010

11-
import windowsImg from "~/assets/images/windows.svg"
12-
import macImg from "~/assets/images/mac.svg"
13-
import linuxImg from "~/assets/images/linux.svg"
11+
import windowsImg from "~/assets/images/windows.svg";
12+
import macImg from "~/assets/images/mac.svg";
13+
import linuxImg from "~/assets/images/linux.svg";
1414

1515
Thank you for taking an interest in helping improve the language server!
1616

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+
1723
## Debugging
1824

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)
2030

21-
### Quick Print
31+
### Print
2232

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>):
2434

2535
![outputPanel](https://user-images.githubusercontent.com/61925890/181308229-52b7e9b7-2893-429b-bca2-8386670df6b0.png)
2636

27-
Below is an example of how a [plugin](/wiki/plugins) can be debugged.
37+
This allows for pretty quick and easy development entirely in VS Code by opening up the language server source:
38+
39+
<Tabs
40+
active="Windows"
41+
buttons={[
42+
{ name: "Windows", image: windowsImg, accent: "#23a9f2" },
43+
{ name: "MacOS", image: macImg, accent: "#ffffff" },
44+
{ name: "Linux", image: linuxImg, accent: "#ffff00" },
45+
]}
46+
>
47+
<div data-tab="Windows">
48+
`%USERPROFILE%\.vscode\extensions\sumneko.lua-VERSION\server`
49+
</div>
50+
<div data-tab="MacOS">`~/.vscode/extensions/sumneko.lua-VERSION/server`</div>
51+
<div data-tab="Linux">`~/.vscode/extensions/sumneko.lua-VERSION/server`</div>
52+
</Tabs>
53+
54+
A [plugin](/wiki/plugins) can also be debugged quickly this way:
2855

2956
```Lua
3057
local util = require 'utility'
@@ -35,9 +62,9 @@ function OnSetText(uri, text)
3562
end
3663
```
3764

38-
### Append to Log File
65+
### Log
3966

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.
4168

4269
```Lua
4370
local util = require 'utility'
@@ -48,14 +75,14 @@ function OnSetText(uri, text)
4875
end
4976
```
5077

51-
### Attach Debugger
78+
### Debugger
5279

5380
This is the most advanced method, but provides all kinds of useful info and is the most "proper" way to debug the language server.
5481

5582
You will need two Visual Studio Code instances open:
5683

5784
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:
5986
<Tabs
6087
active="Windows"
6188
buttons={[
@@ -64,9 +91,15 @@ You will need two Visual Studio Code instances open:
6491
{ name: "Linux", image: linuxImg, accent: "#ffff00" },
6592
]}
6693
>
67-
<div data-tab="Windows">`%USERPROFILE%\.vscode\extensions\sumneko.lua-VERSION\server`</div>
68-
<div data-tab="MacOS">`~/.vscode/extensions/sumneko.lua-VERSION/server`</div>
69-
<div data-tab="Linux">`~/.vscode/extensions/sumneko.lua-VERSION/server`</div>
94+
<div data-tab="Windows">
95+
`%USERPROFILE%\.vscode\extensions\sumneko.lua-VERSION\server`
96+
</div>
97+
<div data-tab="MacOS">
98+
`~/.vscode/extensions/sumneko.lua-VERSION/server`
99+
</div>
100+
<div data-tab="Linux">
101+
`~/.vscode/extensions/sumneko.lua-VERSION/server`
102+
</div>
70103
</Tabs>
71104
2. The **Debug Target**
72105
- 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.

src/scss/main.scss

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ hr {
107107
border: 0.05em solid white;
108108
}
109109

110+
blockquote {
111+
border-left: var(--link-color) 0.3em solid;
112+
padding-left: 0.5em;
113+
margin-left: 1em;
114+
}
115+
110116
button {
111117
&:hover {
112118
cursor: pointer;

0 commit comments

Comments
 (0)