Replace ad-hoc regex or basic string manipulation in the language server with the official tree-sitter grammar for deep AST reasoning.