Skip to content

Conversation

@hunterjsb
Copy link

Fixes #473

Compiles workspace directory instead of single file, making functions from all files in a module visible.

Changes:

  • Add workspace detection (looks for v.mod, vpkg.json, or uses file directory)
  • Compile with v folder/ instead of v file.v
  • Filter errors to current file
  • Fallback to single-file mode when multiple main() detected

Uses existing v folder/ behavior instead of adding special VLS flags (addressing concerns from #475 and vlang/v#25703).

Tested with multi-file modules and edge cases.

@hunterjsb hunterjsb changed the title fix module-wide symbol visibility (#473) fix module-wide symbol visibility Nov 18, 2025
@JalonSolov
Copy link
Contributor

As mentioned elsewhere, blindly doing v folder/ may be just as bad as v file.v.

@hunterjsb hunterjsb force-pushed the fix-module-wide-symbol-visibility branch from 028d03c to c46f995 Compare November 18, 2025 03:15
@hunterjsb
Copy link
Author

hunterjsb commented Nov 18, 2025

closing and will wait on vlang/v#25749

@hunterjsb hunterjsb closed this Nov 18, 2025
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.

Functions in the same module are not automatically imported

2 participants