Commit 63f153a
Moritz Scherer
[circt-verilog-lsp][NFC] Break out implementation classes
**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.1 parent 35af03c commit 63f153a
File tree
12 files changed
+1259
-1039
lines changed- lib/Tools/circt-verilog-lsp-server/VerilogServerImpl
12 files changed
+1259
-1039
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments