Merge branch 'master' of https://github.com/SuperAuguste/zls
This commit is contained in:
commit
1f5c8c0b77
@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
@ -20,7 +20,7 @@ Zig Language Server, or `zls`, is a language server for Zig. The Zig wiki states
|
||||
Installing `zls` is pretty simple;
|
||||
|
||||
```bash
|
||||
git clone https://github.com/SuperAuguste/zls
|
||||
git clone https://github.com/zigtools/zls
|
||||
cd zls
|
||||
zig build
|
||||
```
|
||||
@ -44,6 +44,7 @@ The following options are currently available.
|
||||
| --- | --- | --- | --- |
|
||||
| `enable_snippets` | `bool` | `true` | Enables snippet completion, set to false for compatibility with language clients that do not support snippets (such as ale). |
|
||||
| `zig_lib_path` | `?[]const u8` | `null` | zig library path, used to analyze std library imports. |
|
||||
| `warn_style` | `bool` | `false` | Enables warnings for style *guideline* mismatches |
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -5,3 +5,7 @@ enable_snippets: bool = true,
|
||||
|
||||
/// zig library path
|
||||
zig_lib_path: ?[]const u8 = null,
|
||||
|
||||
/// Whether to pay attention to style issues. This is opt-in since the style
|
||||
/// guide explicitly states that the style info provided is a guideline only.
|
||||
warn_style: bool = false,
|
||||
|
@ -137,6 +137,7 @@ fn publishDiagnostics(handle: DocumentStore.Handle, config: Config) !void {
|
||||
if (is_extern)
|
||||
break :blk;
|
||||
|
||||
if (config.warn_style) {
|
||||
if (func.name_token) |name_token| {
|
||||
const loc = tree.tokenLocation(0, name_token);
|
||||
|
||||
@ -167,6 +168,7 @@ fn publishDiagnostics(handle: DocumentStore.Handle, config: Config) !void {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user