Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: enhance markdown example
  • Loading branch information
tembleking committed Oct 3, 2025
commit 047396bbebdc8dd081dcf6a34e57920a45cff9e3
65 changes: 46 additions & 19 deletions src/app/lsp_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,52 @@ where
contents: tower_lsp::lsp_types::HoverContents::Markup(
tower_lsp::lsp_types::MarkupContent {
kind: tower_lsp::lsp_types::MarkupKind::Markdown,
value: "# Sysdig Language Server
---
**_Sysdig Secure_** provides comprehensive security for your containers.

### Features
* Vulnerability Scanning
* Runtime Security
* Compliance

| Feature | Status |
| ----------------- | ------ |
| Vulnerability Scan| ✅ |
| Policy Advisor | 🚧 |

```rust
fn main() {
println!(\"Hello, world!\");
}
```
value: "## Sysdig Scan Result
### Summary
* **Type**: dockerImage
* **PullString**: ubuntu:23.04
* **ImageID**: `sha256:f4cdeba72b994748f5eb1f525a70a9cc553b66037ec37e23645fbf3f0f5c160d`
* **Digest**: `sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f31a3bc0f03f06edd`
* **BaseOS**: ubuntu 23.04

| TOTAL VULNS FOUND | CRITICAL | HIGH | MEDIUM | LOW | NEGLIGIBLE |
|:------------------:|:--------:|:----:|:--------------:|:--------------:|:----------:|
| 11 | 0 | 0 | 9 (9 Fixable) | 2 (2 Fixable) | 0 |

### Fixable Packages
| PACKAGE | TYPE | VERSION | SUGGESTED FIX | CRITICAL | HIGH | MEDIUM | LOW | NEGLIGIBLE | EXPLOIT |
|:-------------------|:----:|:-----------------------|:-----------------------|:--------:|:----:|:------:|:---:|:----------:|:-------:|
| libgnutls30 | os | 3.7.8-5ubuntu1.1 | 3.7.8-5ubuntu1.2 | - | - | 2 | - | - | - |
| libc-bin | os | 2.37-0ubuntu2.1 | 2.37-0ubuntu2.2 | - | - | 1 | 1 | - | - |
| libc6 | os | 2.37-0ubuntu2.1 | 2.37-0ubuntu2.2 | - | - | 1 | 1 | - | - |
| libpam-modules | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |
| libpam-modules-bin | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |
| libpam-runtime | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |
| libpam0g | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |
| tar | os | 1.34+dfsg-1.2ubuntu0.1 | 1.34+dfsg-1.2ubuntu0.2 | - | - | 1 | - | - | - |

### Policy Evaluation

| POLICY | STATUS | FAILURES | RISKS ACCEPTED |
|:--------------------------------------|:------:|:--------:|:--------------:|
| carholder policy - pk | ❌ | 1 | 0 |
| Critical Vulnerability Found | ✅ | 0 | 0 |
| Forbid Secrets in Images | ✅ | 0 | 0 |
| NIST SP 800-Star | ❌ | 14 | 0 |
| PolicyCardHolder | ❌ | 1 | 0 |
| Sensitive Information or Secret Found | ✅ | 0 | 0 |
| Sysdig Best Practices | ✅ | 0 | 0 |

### Vulnerability Detail

| VULN CVE | SEVERITY | PACKAGES | FIXABLE | EXPLOITABLE | ACCEPTED RISK | AGE |
|---------------|----------|----------|---------|-------------|---------------|-------------|
| CVE-2024-22365| Medium | 4 | ✅ | ❌ | ❌ | 2 years ago |
| CVE-2023-5156 | Medium | 2 | ✅ | ❌ | ❌ | 2 years ago |
| CVE-2023-39804| Medium | 1 | ✅ | ❌ | ❌ | 2 years ago |
| CVE-2024-0553 | Medium | 1 | ✅ | ❌ | ❌ | 2 years ago |
| CVE-2024-0567 | Medium | 1 | ✅ | ❌ | ❌ | 2 years ago |
| CVE-2023-4806 | Low | 2 | ✅ | ❌ | ❌ | 2 years ago |
"
.to_string(),
},
Expand Down
2 changes: 1 addition & 1 deletion tests/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ async fn test_hover(#[future] server_with_open_file: TestSetup, open_file_url: U
let expected_json = serde_json::json!({
"contents": {
"kind": "markdown",
"value": "# Sysdig Language Server\n---\n**_Sysdig Secure_** provides comprehensive security for your containers.\n\n### Features\n* Vulnerability Scanning\n* Runtime Security\n* Compliance\n\n| Feature | Status |\n| ----------------- | ------ |\n| Vulnerability Scan| ✅ |\n| Policy Advisor | 🚧 |\n\n```rust\nfn main() {\n println!(\"Hello, world!\");\n}\n```\n"
"value": "## Sysdig Scan Result\n### Summary\n* **Type**: dockerImage\n* **PullString**: ubuntu:23.04\n* **ImageID**: `sha256:f4cdeba72b994748f5eb1f525a70a9cc553b66037ec37e23645fbf3f0f5c160d`\n* **Digest**: `sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f31a3bc0f03f06edd`\n* **BaseOS**: ubuntu 23.04\n\n| TOTAL VULNS FOUND | CRITICAL | HIGH | MEDIUM | LOW | NEGLIGIBLE |\n|:------------------:|:--------:|:----:|:--------------:|:--------------:|:----------:|\n| 11 | 0 | 0 | 9 (9 Fixable) | 2 (2 Fixable) | 0 |\n\n### Fixable Packages\n| PACKAGE | TYPE | VERSION | SUGGESTED FIX | CRITICAL | HIGH | MEDIUM | LOW | NEGLIGIBLE | EXPLOIT |\n|:-------------------|:----:|:-----------------------|:-----------------------|:--------:|:----:|:------:|:---:|:----------:|:-------:|\n| libgnutls30 | os | 3.7.8-5ubuntu1.1 | 3.7.8-5ubuntu1.2 | - | - | 2 | - | - | - |\n| libc-bin | os | 2.37-0ubuntu2.1 | 2.37-0ubuntu2.2 | - | - | 1 | 1 | - | - |\n| libc6 | os | 2.37-0ubuntu2.1 | 2.37-0ubuntu2.2 | - | - | 1 | 1 | - | - |\n| libpam-modules | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |\n| libpam-modules-bin | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |\n| libpam-runtime | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |\n| libpam0g | os | 1.5.2-5ubuntu1 | 1.5.2-5ubuntu1.1 | - | - | 1 | - | - | - |\n| tar | os | 1.34+dfsg-1.2ubuntu0.1 | 1.34+dfsg-1.2ubuntu0.2 | - | - | 1 | - | - | - |\n\n### Policy Evaluation\n\n| POLICY | STATUS | FAILURES | RISKS ACCEPTED |\n|:--------------------------------------|:------:|:--------:|:--------------:|\n| carholder policy - pk | ❌ | 1 | 0 |\n| Critical Vulnerability Found | ✅ | 0 | 0 |\n| Forbid Secrets in Images | ✅ | 0 | 0 |\n| NIST SP 800-Star | ❌ | 14 | 0 |\n| PolicyCardHolder | ❌ | 1 | 0 |\n| Sensitive Information or Secret Found | ✅ | 0 | 0 |\n| Sysdig Best Practices | ✅ | 0 | 0 |\n\n### Vulnerability Detail\n\n| VULN CVE | SEVERITY | PACKAGES | FIXABLE | EXPLOITABLE | ACCEPTED RISK | AGE |\n|---------------|----------|----------|---------|-------------|---------------|-------------|\n| CVE-2024-22365| Medium | 4 | ✅ | ❌ | ❌ | 2 years ago |\n| CVE-2023-5156 | Medium | 2 | ✅ | ❌ | ❌ | 2 years ago |\n| CVE-2023-39804| Medium | 1 | ✅ | ❌ | ❌ | 2 years ago |\n| CVE-2024-0553 | Medium | 1 | ✅ | ❌ | ❌ | 2 years ago |\n| CVE-2024-0567 | Medium | 1 | ✅ | ❌ | ❌ | 2 years ago |\n| CVE-2023-4806 | Low | 2 | ✅ | ❌ | ❌ | 2 years ago |\n"
}
});
assert_eq!(serde_json::to_value(hover).unwrap(), expected_json);
Expand Down