Module parser

Module parser 

Source
Expand description

go.mod parser with position tracking.

Parses go.mod files using regex patterns and line-by-line parsing. Critical for LSP features like hover, completion, and inlay hints.

§Key Features

  • Position-preserving parsing with byte-to-LSP conversion
  • Handles go.mod directives: module, go, require, replace, exclude
  • Supports multi-line blocks and inline/block comments
  • Extracts indirect dependency markers (// indirect)
  • Note: retract directive is defined in types but not yet parsed

Structs§

GoParseResult
Result of parsing a go.mod file.

Functions§

parse_go_mod
Parses a go.mod file and extracts all dependencies with positions.