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
Copy file name to clipboardExpand all lines: README.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,12 @@ Install the extension from the VSCode Marketplace or OpenVSX Registry:
13
13
14
14
The language server should be immediately usable for general Luau code after installation.
15
15
String require support is provided for module paths, using `require("module")`.
16
-
Note that the file is searched **relative to the workspace root** (equivalent to the [command-line REPL](https://github.com/Roblox/luau#usage)`luau`).
16
+
There are two options for resolving requires, which can be configured using `luau-lsp.require.mode`:
17
+
`relativeToWorkspaceRoot` (the default - equivalent to the [command-line REPL](https://github.com/Roblox/luau#usage)`luau`)
18
+
or `relativeToFile`.
17
19
18
-
Type definitions can be provided by configuring `luau-lsp.types.definitionFiles`.
20
+
Type definitions can be provided by configuring `luau-lsp.types.definitionFiles`, with corresponding
21
+
documentation added using `luau-lsp.types.documentationFiles`.
19
22
20
23
If there are specific features you require in the language server for your use case, feel free to open an issue.
21
24
@@ -24,7 +27,7 @@ If there are specific features you require in the language server for your use c
24
27
Rojo instance tree and requiring support is provided by default, and the language server should be able to directly emulate Studio.
25
28
The extension will automatically populate the latest API types and documentation (which can be disabled by configuring `luau-lsp.types.roblox`).
26
29
27
-
To resolve your instance tree and provide module resolution, the language server uses Rojo sourcemaps.
30
+
To resolve your instance tree and provide module resolution, the language server uses Rojo-style sourcemaps.
28
31
The language server will automatically create a `sourcemap.json` in your workspace root on startup and whenever files are added/created/renamed.
29
32
30
33
It does this by running the `rojo sourcemap` command, hence Rojo 7.1.0+ must be available to execute in your workspace root.
@@ -34,10 +37,15 @@ Note, if you are using the VSCode extension on macOS, you need to configure the
34
37
35
38
By default we generate a sourcemap for a `default.project.json` project file. The name can be changed in extension settings, as well as whether non-script instances are included in the sourcemap (included by default). Autogeneration of sourcemaps can also be toggled completely on/off in settings - the server will instead just listen to manual changes to `sourcemap.json` files.
36
39
40
+
If you do not use Rojo, you can still use the Luau Language Server, you just need to manually generate a `sourcemap.json`
41
+
file for your particular project layout.
42
+
37
43
> Note: in the diagnostics type checker, the types for DataModel (DM) instances will resolve to `any`. This is a current limitation to reduce false positives.
38
-
> However, autocomplete and hover intellisense will correctly resolve the DM type. [Read more](https://github.com/JohnnyMorganz/luau-lsp/issues/83#issuecomment-1192865024)
44
+
> However, autocomplete and hover intellisense will correctly resolve the DM type.
45
+
> To enable this mode for diagnostics, set `luau-lsp.diagnostics.strictDatamodelTypes` (off by default).
#### A companion Studio plugin is available to provide DataModel information for Instances which are not part of your Rojo build / filetree: [Plugin Marketplace](https://www.roblox.com/library/10913122509/Luau-Language-Server-Companion)
48
+
**A companion Studio plugin is available to provide DataModel information for Instances which are not part of your Rojo build / filetree: [Plugin Marketplace](https://www.roblox.com/library/10913122509/Luau-Language-Server-Companion)**
41
49
42
50
## Standalone
43
51
@@ -69,9 +77,10 @@ If you use Luau in a different environment and are interested in using the langu
69
77
-[x] Document Symbol
70
78
-[x] Color Provider
71
79
-[x] Rename
72
-
-[ ] Call Hierarchy
73
80
-[x] Semantic Tokens
74
81
-[x] Inlay Hints
82
+
-[x] Documentation Comments ([Moonwave Style](https://github.com/evaera/moonwave) - supporting both `--- comment` and `--[=[ comment ]=]`, but must be next to statement)
83
+
-[ ] Call Hierarchy
75
84
-[ ] Workspace Symbols
76
85
77
86
The following are extra features defined in the LSP specification, but most likely do not apply to Luau or are not necessary.
0 commit comments