feat!: Error diagnostics
This commit is contained in:
parent
4de6a9f387
commit
8e498d75be
4 changed files with 26 additions and 2 deletions
|
@ -18,6 +18,11 @@ Changelog structure reference:
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
#### Error diagnostics (NEW)
|
||||
- Basic diagnostics info from LSP (mostly just trivial syntax errors)
|
||||
|
||||
## [0.3.1]
|
||||
|
||||
### Added
|
||||
|
|
|
@ -15,6 +15,7 @@ Feature tracker:
|
|||
- Code completion
|
||||
- Code folding
|
||||
- Syntax highlighting
|
||||
- Basic error diagnostics
|
||||
- Go to definition
|
||||
- Rename symbol
|
||||
- Hover documentation
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.falsepattern.zigbrains.lsp;
|
||||
|
||||
import org.eclipse.lsp4j.InitializeParams;
|
||||
import org.eclipse.lsp4j.PublishDiagnosticsCapabilities;
|
||||
import org.wso2.lsp4intellij.client.languageserver.serverdefinition.RawCommandServerDefinition;
|
||||
|
||||
public class ZLSServerDefinition extends RawCommandServerDefinition {
|
||||
public ZLSServerDefinition(String[] command) {
|
||||
super("zig", command);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customizeInitializeParams(InitializeParams params) {
|
||||
var textCaps = params.getCapabilities().getTextDocument();
|
||||
if (textCaps.getPublishDiagnostics() == null) {
|
||||
textCaps.setPublishDiagnostics(new PublishDiagnosticsCapabilities());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -88,8 +88,7 @@ public class ZLSStartupActivity implements StartupActivity {
|
|||
}
|
||||
}
|
||||
}
|
||||
IntellijLanguageClient.addServerDefinition(
|
||||
new RawCommandServerDefinition("zig", cmd.toArray(String[]::new)));
|
||||
IntellijLanguageClient.addServerDefinition(new ZLSServerDefinition(cmd.toArray(String[]::new)));
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue