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]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
#### Error diagnostics (NEW)
|
||||||
|
- Basic diagnostics info from LSP (mostly just trivial syntax errors)
|
||||||
|
|
||||||
## [0.3.1]
|
## [0.3.1]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -15,6 +15,7 @@ Feature tracker:
|
||||||
- Code completion
|
- Code completion
|
||||||
- Code folding
|
- Code folding
|
||||||
- Syntax highlighting
|
- Syntax highlighting
|
||||||
|
- Basic error diagnostics
|
||||||
- Go to definition
|
- Go to definition
|
||||||
- Rename symbol
|
- Rename symbol
|
||||||
- Hover documentation
|
- 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(
|
IntellijLanguageClient.addServerDefinition(new ZLSServerDefinition(cmd.toArray(String[]::new)));
|
||||||
new RawCommandServerDefinition("zig", cmd.toArray(String[]::new)));
|
|
||||||
} finally {
|
} finally {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue