Skip to content

Suppress duplicate features when a V language server (LSP4IJ) is active#81

Open
quaesitor-scientiam wants to merge 2 commits intovlang:mainfrom
quaesitor-scientiam:feature/lsp4ij-suppression
Open

Suppress duplicate features when a V language server (LSP4IJ) is active#81
quaesitor-scientiam wants to merge 2 commits intovlang:mainfrom
quaesitor-scientiam:feature/lsp4ij-suppression

Conversation

@quaesitor-scientiam
Copy link
Copy Markdown
Contributor

Summary

  • Adds optional LSP4IJ dependency that detects when a V language server is configured and suppresses native plugin features that would appear twice: inlay hints, semantic highlighting, diagnostics, and (opt-in) code completion
  • Introduces VlangLspBridge project service with NoOpLspBridge (default) and Lsp4ijBridge (loaded via vlang-lsp4ij.xml when LSP4IJ is installed), using LanguageServersRegistry.isFileSupported() — synchronous, no I/O
  • Adds VlangLspSettings application service and settings UI under Settings → Languages & Frameworks → V → Language Server (LSP4IJ) with per-feature toggles (hints/highlighting/diagnostics on by default, completion off)
  • Also suppresses inlay hints that would render the type name as "unknown" (unresolvable types in composite types like map[string]unknown)

Test plan

  • With LSP4IJ absent: all features work normally, no-op bridge returns false
  • With LSP4IJ installed and a V language server configured: inlay hints, semantic highlighting, and diagnostics are suppressed; completion is not suppressed by default
  • Settings page visible at Settings → Languages & Frameworks → V → Language Server (LSP4IJ)
  • Toggling individual checkboxes takes effect immediately on the next editor pass
  • Unchecking the master checkbox re-enables all native features regardless of sub-checkbox state
  • Variables with unresolvable types (e.g. map[string]unknown) no longer show an inlay hint

Closes #80

🤖 Generated with Claude Code

PythonWillRule and others added 2 commits March 17, 2026 17:10
Adds optional LSP4IJ integration that detects when a V language server is
configured via LSP4IJ and suppresses native plugin features that would
otherwise appear twice:

- Inlay hints (type hints, chain method hints, parameter name hints)
- Semantic highlighting (VlangAnnotator)
- Diagnostics (VlangCheckerAnnotator)
- Code completion (opt-in, off by default)

Layer 1: VlangLspBridge service with NoOpLspBridge (default) and
Lsp4ijBridge (loaded via vlang-lsp4ij.xml optional dependency).
Uses LanguageServersRegistry.isFileSupported() — synchronous, no I/O.

Layer 2: Each suppressible feature checks the bridge before running.
Also suppresses inlay hints that render as "unknown" (unresolvable types).

Layer 3: VlangLspSettings application service + VlangLspSettingsConfigurable
UI under Settings → Languages & Frameworks → V → Language Server (LSP4IJ).
Defaults: suppress hints/highlighting/diagnostics on, completion off.

Closes vlang#80

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ilation

Required so Lsp4ijBridge.kt can reference LanguageServersRegistry at compile
time. The plugin remains optional at runtime via the existing <depends optional>
declaration in plugin.xml and vlang-lsp4ij.xml service override.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress duplicate features when a V language server (LSP4IJ) is active

2 participants