Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a1b91cb
Add LSP log capture layer with opt-in JSON-RPC tracing
NipunaRanasinghe Sep 5, 2026
f7bfb91
Skip startup $/setTrace when tracing is off, keep logs after a server…
NipunaRanasinghe Sep 5, 2026
1cc7c1a
Add LSP Inspector tool window
NipunaRanasinghe Sep 6, 2026
cdb2655
Unify status bar widget with the LSP Inspector
NipunaRanasinghe Sep 7, 2026
17848aa
Show short server names, fix empty Connected Files tab
NipunaRanasinghe Sep 7, 2026
67c2ed0
Let server definitions carry an explicit display name
NipunaRanasinghe Sep 8, 2026
c5ad6ee
Replace the inspector server tree with a selector, show status in the…
NipunaRanasinghe Oct 9, 2026
183cd57
Bound inspector log memory and route log events by wrapper
NipunaRanasinghe Oct 9, 2026
4008134
Show method and latency on traced responses, refresh only the visible…
NipunaRanasinghe Oct 9, 2026
392566d
Localize inspector strings, run action updates on the EDT, use theme …
NipunaRanasinghe Oct 9, 2026
5c5b124
Test inspector panel bookkeeping, localize the tool window title, doc…
NipunaRanasinghe Oct 9, 2026
77ffeeb
Document the LSP Inspector in the README
NipunaRanasinghe Oct 9, 2026
61826eb
Document the LSP Inspector in the features guide
NipunaRanasinghe Oct 9, 2026
76a1f26
Add missing record param tags flagged by checkstyle
NipunaRanasinghe Oct 9, 2026
6035976
Fix SonarCloud findings
NipunaRanasinghe Oct 10, 2026
2ad43f4
Reorder timeout columns, add icons and open-on-click to connected files
NipunaRanasinghe Oct 10, 2026
75d4250
Add Server Info tab and Export Log action to the LSP Inspector
NipunaRanasinghe Oct 10, 2026
c35c1de
Update LSP Inspector toolbar actions on a background thread
NipunaRanasinghe Oct 10, 2026
96bd2fc
Add Requests tab with pending requests and per-method response times …
NipunaRanasinghe Oct 10, 2026
6898059
Rework the LSP status widget: repaint on status events, problem short…
NipunaRanasinghe Oct 10, 2026
7230845
Document Server Info, Requests and Export Log in the LSP Inspector
NipunaRanasinghe Oct 10, 2026
5007350
Add LSP Inspector and status popup screenshots to the docs
NipunaRanasinghe Oct 10, 2026
c56aaf6
Keep a registered wrapper's log when another wrapper for the same ser…
NipunaRanasinghe Oct 28, 2026
284168b
Limit the LSP Inspector's pending log queue and reprint from the stor…
NipunaRanasinghe Oct 30, 2026
9211204
Fix SonarCloud findings in the LSP Inspector
NipunaRanasinghe Oct 30, 2026
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
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Designed for plugin developers, it streamlines LSP integration and supports lang
- [Quick Start](#quick-start)
- [Developer Guide](#developer-guide)
- [Features](#features)
- [LSP Inspector](#lsp-inspector)
- [License](#license)
- [Contributors](#contributors)
- [Inspiration](#inspiration)
Expand Down Expand Up @@ -150,6 +151,51 @@ See the [Features guide](docs/features.md) for descriptions, triggers, and demos

> **Note:** Features are mainly tested on IntelliJ IDEA.

### LSP Inspector

The LSP Inspector is a tool window that shows, for each language server in the project:

- **Log**: status changes (starting, started, initialized, stopping, stopped) and crashes,
`window/logMessage` and `window/showMessage` notifications from the server, and, when tracing is
on, every JSON-RPC message in both directions. A traced response shows the method of the request
it answers and the time between request and response, for example
`textDocument/hover (12) 38 ms`. Error responses are shown at error level.
- **Server Info**: the server's status, the name and version from its `initialize` response, trace
level, document sync mode, recent crash count and launch command, and which of the 17 requests
LSP4IntelliJ sends the server advertised in its `ServerCapabilities`.
- **Requests**: requests still waiting for a response, and per-method response times (count,
errors, median, 95th percentile and maximum), recorded whether or not tracing is on.
- **Timeouts**: success and failure counts per request type.
- **Connected Files**: the files currently open on the server. Double-clicking one opens it.

The toolbar selects the server and filters the log by level and by source. **Export Log** saves the
selected server's Server Info details followed by its log, with the current filters applied. The
**Trace** dropdown
sets JSON-RPC tracing per server: `OFF` (the default) records nothing, `MESSAGES` records method, id
and direction, and `VERBOSE` also records each message's full payload. Changing it also sends
`$/setTrace` to the server.

Log capture runs whether or not the tool window is registered. Each server keeps up to 10,000
entries or 4,000,000 characters of text, whichever limit is hit first, dropping the oldest entries.
A stopped server's log stays readable until a new instance of the same server starts logging.
Response-time counts, error counts and maximums cover every response since the server was first
started in the project, including across restarts; the median and 95th percentile cover each
method's last 1,000 responses. The list of waiting requests is cleared each time the server starts.

The tool window is optional. To show it, register it in `plugin.xml` under the id `LSP Inspector`:

```xml
<extensions defaultExtensionNs="com.intellij">
<toolWindow id="LSP Inspector" anchor="bottom"
factoryClass="org.wso2.lsp4intellij.inspector.LspInspectorToolWindowFactory"/>
</extensions>
```

Clicking the status bar icon offers **Restart** and the **Trace** levels for each server. With the
tool window registered, it also offers **Open LSP Inspector**, and, while requests are waiting or
after the server crashed, a shortcut to the Requests tab or to the log filtered to errors. Without
it, those actions are not shown.

---

## License
Expand Down
10 changes: 7 additions & 3 deletions docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ Update your `plugin.xml` to include the startup activity:

## 4. Confirm the language server connection

After successfully connecting to the language server, a green icon will appear in the bottom-right corner of your IDE. Clicking on the icon will display connection details and timeouts.
After the language server connects, the language server icon in the bottom-right corner of the IDE turns green. Yellow means a server is starting or stopping, and red means it is stopped. With more than one server, the icon shows the least healthy status.

![Green status icon appearing in the IDE's bottom-right corner after the language server connects](../resources/images/lang-server-connect.gif)

> **Tip:** A green icon in the IDE's bottom-right corner indicates a successful connection to the language server. Clicking on the icon will display connection details and timeouts.
Hover the icon to see each server's status and recent crash count. Click it to restart the server, set its JSON-RPC trace level, or open the LSP Inspector. While requests are waiting for a response, or after the server has crashed, the popup also links to the matching part of the Inspector.

![Clicking the status icon to open the connection details and timeouts panel](../resources/images/connected-and-timeouts.gif)
![The popup opened from the language server status icon](../resources/images/lsp4intellij-status-popup.png)

To see the server's log, JSON-RPC traffic, advertised capabilities and response times, use the LSP Inspector. The `plugin.xml` example registers it; see [LSP Inspector](features.md#lsp-inspector) for what it shows.

---

Expand Down Expand Up @@ -164,6 +166,8 @@ The LSP4IntelliJ language client applies the following default timeouts to LSP r
| Shutdown | 5000 |
| WillSave | 2000 |

The LSP Inspector's **Timeouts** tab shows, per request type, how many requests got a response within their timeout and how many timed out.

The client exposes the following methods for inspecting and overriding these values at runtime:

- **`getTimeouts()`** — returns the current timeout values (in milliseconds).
Expand Down
22 changes: 22 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ LSP4IntelliJ surfaces these LSP capabilities in JetBrains IDEs.
- [Hover Support](#hover-support)
- [Workspace Symbols](#workspace-symbols)
- [Renaming Support](#renaming-support)
- [LSP Inspector](#lsp-inspector)
- [Work in progress](#work-in-progress)

<!-- tocstop -->
Expand Down Expand Up @@ -83,6 +84,27 @@ Place the cursor on the element to rename and press `Shift+F6` to trigger in-pla

![In-place rename of a symbol triggered with Shift+F6](../resources/images/lsp4intellij-renaming.gif)

## LSP Inspector

Open **View → Tool Windows → LSP Inspector**, or click the language server icon in the status bar and choose **Open LSP Inspector**. If the project runs more than one language server, pick one from the dropdown at the left of the toolbar.

![The LSP Inspector's Log tab showing the server's status changes and traced JSON-RPC messages](../resources/images/lsp4intellij-inspector-log.png)

- **Log** shows the server's status changes, crashes, and the log and show-message notifications it sends. Use the level and source dropdowns to filter it; **Error** shows only crashes, error messages, and failed requests.
- To see JSON-RPC traffic, set **Trace** to `MESSAGES` (method, id and direction of each message) or `VERBOSE` (the full payload as well). Each response shows the method of the request it answers and how long the server took, for example `textDocument/hover (12) 38 ms`. Tracing is `OFF` by default and is set per server.
- **Server Info** shows the server's status, the name and version it reports, its trace level, document sync mode and recent crash count, and its definition (the launch command), with **Copy** and **Restart** buttons. Next to it, **Capabilities** lists the 17 requests LSP4IntelliJ sends, grouped into Editing, Navigation and Formatting, and marks each one the server did not advertise in its `initialize` response. Hover a capability to see its LSP method; select **Unsupported only** to list just the ones the server lacks. If rename or formatting does nothing, check here first.

![The Server Info tab showing the server's details and which capabilities it advertises](../resources/images/lsp4intellij-inspector-server-info.png)
- **Requests** shows the requests waiting for a response, with how long each has waited, and the response times per method: count, errors, median, 95th percentile and maximum. Click a column header to sort by it. Times of 300 ms or more are shown in amber and 1 s or more in red. Response times are recorded whether or not tracing is on.

![The Requests tab showing response times per method](../resources/images/lsp4intellij-inspector-requests.png)
- **Timeouts** shows, per request type, how many requests got a response within their timeout and how many timed out.
- **Connected Files** lists the files currently open on the server, with their folders. Double-click a file, or select it and press Enter, to open it in the editor.

**Clear** empties the selected server's log, **Export Log** saves it to a file, and **Scroll to End** jumps to the newest entry. The exported file starts with the Server Info details and capabilities, followed by the log with the current level and source filters applied, so it can be attached to a bug report.

> **Note:** The tool window appears only if the plugin using LSP4IntelliJ registers it. See [LSP Inspector](../README.md#lsp-inspector) in the README.

---

## Work in progress
Expand Down
Loading
Loading