Skip to content

refactor(server): decouple analysis from visit logic and simplify definition provider#17

Merged
ntoulasm merged 7 commits into
mainfrom
refactor/server
Mar 4, 2026
Merged

refactor(server): decouple analysis from visit logic and simplify definition provider#17
ntoulasm merged 7 commits into
mainfrom
refactor/server

Conversation

@ntoulasm

@ntoulasm ntoulasm commented Mar 4, 2026

Copy link
Copy Markdown
Owner

Summary

This PR reorganizes the language server logic to improve readability and maintainability. It Decouples the generic AST visitation logic from the symbol extraction and analysis logic. It also breaks down the definition provider to smaller functions.

Key Changes

  1. Refactored visitor.ts to a generic callback based structural visitor. It now focuses solely on traversing the AST and providing accurate JSON paths.
  2. Introduced analyzer.ts a dedicated module for high level document analysis. It uses the visitor to collect symbols.
  3. Extracted the SymbolTable type definition and JRefSymbol interface into symbolTable.ts.
  4. Updated existing tests to align with the refactoring
    • Renamed visitor.test.ts to analyzer.test.ts, since it verified that symbols are correctly identified during analysis.
  5. Added visitor.test.ts with a unit test for the structural traversal itself.

@ntoulasm ntoulasm self-assigned this Mar 4, 2026
@ntoulasm ntoulasm marked this pull request as draft March 4, 2026 12:04
@ntoulasm ntoulasm changed the title refactor(server): improve readability and code quality refactor(server): decouple analysis from visit logic and simplify definition provider Mar 4, 2026
@ntoulasm ntoulasm marked this pull request as ready for review March 4, 2026 13:23
@ntoulasm ntoulasm merged commit 4e52bb9 into main Mar 4, 2026
2 checks passed
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.

1 participant