Skip to content

Conversation

@Scheremo
Copy link
Contributor

@Scheremo Scheremo commented Oct 5, 2025

Summary

  • Refactored VerilogServerImpl into smaller, well-structured components for clarity, testability, and maintainability.
  • Moved large inline class implementations out of VerilogServer.cpp into dedicated compilation units.

Changes

  • New modules
    • VerilogTextFile: manages LSP file contents, versioning, and incremental updates.
    • VerilogDocument: handles Slang integration, parsing, diagnostics, and indexing setup.
    • VerilogIndex: implements symbol/reference tracking using interval maps.
    • LSPDiagnosticClient: converts Slang diagnostics to LSP diagnostics.
    • VerilogServerContext: stores server-wide options and shared configuration.
  • Refactors
    • VerilogServer: simplified to a coordinator using the pImpl pattern and VerilogTextFile instances.
    • Removed large class definitions (Document, Index, DiagnosticClient, etc.) from VerilogServer.cpp.
    • Updated CMakeLists.txt to compile new files.
  • Headers
    • Added clear LLVM-style header comments.
    • Reduced includes and replaced them with forward declarations where possible.

Impact

  • No functional changes; purely structural refactor.
  • Improved code organization and readability.
  • Enables independent testing and clearer layering between LSP, Slang, and CIRCT logic.

@Scheremo Scheremo force-pushed the pr-lsp-refactor branch 4 times, most recently from 63f153a to ec56444 Compare October 5, 2025 10:22
@Scheremo Scheremo marked this pull request as ready for review October 5, 2025 14:00
@Scheremo Scheremo requested a review from uenoku October 5, 2025 16:26
Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace #pragma once with macro based header guards as it's non-standard feature unfortunately. Otherwise LGTM.

@Scheremo
Copy link
Contributor Author

Scheremo commented Oct 6, 2025

Please replace #pragma once with macro based header guards as it's non-standard feature unfortunately. Otherwise LGTM.

Fixed the nit and pragma once isssues. I've got commit access now, so I will merge once the pipeline passes.

**Summary**
- Refactored `VerilogServerImpl` into smaller, well-structured components for clarity, testability, and maintainability.
- Moved large inline class implementations out of `VerilogServer.cpp` into dedicated compilation units.

**Changes**
- **New modules**
  - `VerilogTextFile`: manages LSP file contents, versioning, and incremental updates.
  - `VerilogDocument`: handles Slang integration, parsing, diagnostics, and indexing setup.
  - `VerilogIndex`: implements symbol/reference tracking using interval maps.
  - `LSPDiagnosticClient`: converts Slang diagnostics to LSP diagnostics.
  - `VerilogServerContext`: stores server-wide options and shared configuration.
- **Refactors**
  - `VerilogServer`: simplified to a coordinator using the pImpl pattern and `VerilogTextFile` instances.
  - Removed large class definitions (Document, Index, DiagnosticClient, etc.) from `VerilogServer.cpp`.
  - Updated `CMakeLists.txt` to compile new files.
- **Headers**
  - Added clear LLVM-style header comments.
  - Reduced includes and replaced them with forward declarations where possible.

**Impact**
- No functional changes; purely structural refactor.
- Improved code organization and readability.
- Enables independent testing and clearer layering between LSP, Slang, and CIRCT logic.
@Scheremo Scheremo merged commit 741cbd6 into llvm:main Oct 6, 2025
7 checks passed
@Scheremo Scheremo deleted the pr-lsp-refactor branch October 21, 2025 07:49
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.

2 participants