File-based apps: Add support for #:ref directive - #83985
Merged
Merged
Conversation
RikkiGibson
commented
Jun 2, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 40d9d26f-af18-47fd-9287-1b798322acf9 # Conflicts: # src/Features/CSharp/Portable/SyncedSource/commitid.txt # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.cs.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.de.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.es.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.fr.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.it.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.ja.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.ko.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.pl.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.pt-BR.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.ru.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.tr.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hans.xlf # src/Workspaces/CSharp/Portable/SyncedSource/FileBasedPrograms/xlf/FileBasedProgramsResources.zh-Hant.xlf
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds IDE support for the #:ref directive in C# file-based programs by introducing a dedicated completion provider, adding syntactic classification coverage, and wiring up the related user-facing resource strings (including localized .xlf entries).
Changes:
- Add
RefAppDirectiveCompletionProviderto offer#:refdirective completion and.cspath completion for file-based programs. - Extend completion provider ordering tests and add directive-specific completion tests for
#:ref. - Add syntactic classification coverage for
#:refand add new resource strings + localized.xlfentries.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf | Adds new localized string entries for the #:ref directive description and placeholder. |
| src/Features/CSharp/Portable/CSharpFeaturesResources.resx | Adds the base resource strings for #:ref directive placeholder and description. |
| src/Features/CSharp/Portable/Completion/CompletionProviders/LastBuiltInCompletionProvider.cs | Updates completion provider ordering so the built-in marker comes after the new RefAppDirectiveCompletionProvider. |
| src/Features/CSharp/Portable/Completion/CompletionProviders/FileBasedPrograms/RefAppDirectiveCompletionProvider.cs | Introduces the new completion provider for the #:ref directive and .cs file path completion. |
| src/EditorFeatures/CSharpTest/Completion/CompletionProviders/CompletionProviderOrderTests.cs | Updates expected built-in completion provider order to include the new provider. |
| src/EditorFeatures/CSharpTest/Completion/CompletionProviders/AppDirectiveCompletionProviderTests.cs | Adds completion tests specifically for #:ref path recommendations and .cs-only filtering. |
| src/EditorFeatures/CSharpTest/Classification/SyntacticClassifierTests_FileBasedApps.cs | Adds a syntactic classification test covering #:ref. |
Suppressed comments (1)
src/Features/CSharp/Portable/CSharpFeaturesResources.resx:638
Adds_a_file_based_app_referencecurrently says "References another file-based app as a library." The#:refspec describes this as referencing another.csfile as a separate (virtual) project reference, and the referenced file can still default toOutputType=Exeunless overridden. Consider rewording this string to describe a project reference to another.csfile-based program instead of implying it’s always a library.
<data name="Adds_a_file_based_app_reference" xml:space="preserve">
<value>References another file-based app as a library.</value>
</data>
Comment on lines
+632
to
+635
| <data name="Ref_directive_file_path" xml:space="preserve"> | ||
| <value>path</value> | ||
| <comment>'path' is a placeholder for a file path in a directive like '#:ref path'.</comment> | ||
| </data> |
JoeRobich
approved these changes
Aug 4, 2026
jjonescz
approved these changes
Aug 5, 2026
Member
Author
|
CI analysis for build 1540027:
Retrying |
Member
Author
|
/azp run roslyn-CI |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Microsoft Reviewers: Open in CodeFlow