Document relative path limitation and add cross-platform examples for F# Interactive #i directive #49118
+10
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #44256
Summary
This PR addresses a documentation gap in the F# Interactive reference regarding the
#i
directive for specifying package sources. The documentation now clearly states that relative paths are not supported and provides comprehensive cross-platform examples.Problem
Users were unclear whether relative paths work with the
#i
directive when specifying local package sources in F# Interactive. The documentation only showed a Windows absolute path example, leaving macOS and Linux users without guidance. For example, a user attempting to use:#i "./my/local/packages"
would encounter an error with no explanation in the documentation about why this doesn't work or what the alternative is.
Changes
Added cross-platform absolute path examples
/Users/username/path/to/my/local/source
/home/username/path/to/my/local/source
Added IMPORTANT callout clarifying that:
#i
directive__SOURCE_DIRECTORY__
combined withSystem.IO.Path.Combine()
Improved documentation quality
ai-usage: ai-assisted
frontmatter metadatams.date
to reflect current changesTesting
Validated the behavior by testing F# Interactive:
Impact
This change directly answers the user's question and prevents confusion for developers trying to use local package sources in F# Interactive scripts on macOS and Linux. The documentation now provides clear guidance on what works, what doesn't, and why.
Original prompt
Fixes #28973
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.