Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ddfa78a
Add 'Convert to Project' command for file-based C# apps
Copilot Jun 25, 2026
a65db44
fileBasedApps: refactor for testability, add unit tests, no-csproj co…
Copilot Jun 26, 2026
f06ecb7
Restrict convert-to-project options in project cones
Copilot Jun 30, 2026
d591dfb
Fix convert-to-project eligibility helper placement
Copilot Jun 30, 2026
cb4abdd
Allow in-cone shebang convert-to-project option
Copilot Jun 30, 2026
fca7f30
Remove TODO comment from convert-to-project flow
Copilot Jun 30, 2026
ea45b95
Update comments to say "C# files" instead of generic "files/all files"
Copilot Jun 30, 2026
e244f02
Shorten long comments; add tests for all untested functions
Copilot Jun 30, 2026
0334c39
fix: always create new terminal for dotnet project convert, drop cd c…
Copilot Jul 1, 2026
2c6ec4e
Fix function header comment
mwiemer-microsoft Jul 1, 2026
6ca3109
fix: add #! to no-file-based-apps message, add l10n key, replace em d…
Copilot Jul 1, 2026
dc56b32
Explain when `picked?.detail` would be falsy
mwiemer-microsoft Jul 1, 2026
419e3b4
Fix explanation for FileBasedAppKind.None
mwiemer-microsoft Jul 1, 2026
22a90b1
fix: hide Convert to Project menu for non-FBA files; drop obj exclude…
Copilot Jul 1, 2026
a89a0ae
Rename shouldShowConvertToProjectOption to isLikelyFbaEntryPoint
Copilot Jul 1, 2026
983001a
Explain why we scan a few lines
mwiemer-microsoft Jul 1, 2026
fa74259
Simplify detectFileBasedAppKind: remove injectable readFileHead param…
Copilot Jul 1, 2026
7e079a5
Extract nonEmptyLinesToCheck constant, reduce buffer to 1 KB, use #re…
Copilot Jul 1, 2026
fdef088
Hey, FBAs are normal too
mwiemer-microsoft Jul 1, 2026
0772648
Remove region comments from test file
Copilot Jul 1, 2026
72c901b
Add test for #: directive after blank line, comment, blank line
Copilot Jul 1, 2026
b185a36
Reuse named terminal instead of always creating a new one
Copilot Jul 1, 2026
ebd95a1
Revert terminal reuse -- always create a new terminal
Copilot Jul 1, 2026
c74956f
Remove setContext approach -- show option for all C# files
Copilot Jul 1, 2026
8e54b61
Fix l10n string concatenation so message is properly extracted into l…
Copilot Jul 1, 2026
7090a62
Hide convert-to-project for likely FBA files only
Copilot Jul 2, 2026
d8bb812
test: replace blank promise awaits in convert-to-project tests
Copilot Jul 2, 2026
6c0063a
test: fix hardcoded absolute path in convertToProjectPick test
Copilot Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@
"Recording trace... Click Cancel to stop and save.": "Recording trace... Click Cancel to stop and save.",
"Recording logs... Click Cancel to stop and save.": "Recording logs... Click Cancel to stop and save.",
"Collecting C# Logs": "Collecting C# Logs",
"Only C# files can be converted to a project.": "Only C# files can be converted to a project.",
"This file is not detected as a file-based app entry point.": "This file is not detected as a file-based app entry point.",
"No C# files found in the workspace.": "No C# files found in the workspace.",
"No file-based C# apps were found in the workspace. A file-based app entry point must not be part of any `.csproj` project, unless it contains a top-of-file `#!` or `#:` directive.": "No file-based C# apps were found in the workspace. A file-based app entry point must not be part of any `.csproj` project, unless it contains a top-of-file `#!` or `#:` directive.",
"Select a file-based C# app to convert to a project": "Select a file-based C# app to convert to a project",
"dotnet project convert": "dotnet project convert",
"Nested Code Action": "Nested Code Action",
"Fix All: ": "Fix All: ",
"Pick a fix all scope": "Pick a fix all scope",
Expand Down
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2016,6 +2016,12 @@
"title": "%command.dotnet.restartServer%",
"category": ".NET",
"enablement": "isWorkspaceTrusted && dotnet.server.activationContext == 'Roslyn'"
},
{
"command": "dotnet.convertToProject",
"title": "%command.dotnet.convertToProject%",
"category": ".NET",
"enablement": "isWorkspaceTrusted && (dotnet.server.activationContext == 'Roslyn' || dotnet.server.activationContext == 'RoslynDevKit')"
}
],
"keybindings": [
Expand Down Expand Up @@ -5733,6 +5739,11 @@
"when": "(resourceLangId == csharp || resourceLangId == aspnetcorerazor) && (dotnet.server.activationContext == 'Roslyn' || dotnet.server.activationContext == 'RoslynDevKit')",
"group": "2_dotnet@1"
},
{
"command": "dotnet.convertToProject",
"when": "resourceLangId == csharp && resourcePath in dotnet.likelyFbaEntryPoints && (dotnet.server.activationContext == 'Roslyn' || dotnet.server.activationContext == 'RoslynDevKit')",
"group": "2_dotnet@2"
},
{
"command": "dotnet.test.runTestsInContext",
"when": "editorLangId == csharp && (dotnet.server.activationContext == 'Roslyn' || dotnet.server.activationContext == 'OmniSharp')",
Expand All @@ -5749,6 +5760,11 @@
"command": "csharp.changeProjectContextFileExplorer",
"when": "(resourceLangId == csharp || resourceLangId == aspnetcorerazor) && (dotnet.server.activationContext == 'Roslyn' || dotnet.server.activationContext == 'RoslynDevKit')",
"group": "2_dotnet@1"
},
{
"command": "dotnet.convertToProject",
"when": "resourceLangId == csharp && resourcePath in dotnet.likelyFbaEntryPoints && (dotnet.server.activationContext == 'Roslyn' || dotnet.server.activationContext == 'RoslynDevKit')",
"group": "2_dotnet@2"
}
],
"issue/reporter": [
Expand Down
1 change: 1 addition & 0 deletions package.nls.cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Zobrazit smlouvu o podmínkách dekompilátoru",
"command.dotnet.generateAssets.currentProject": "Generovat prostředky pro sestavení a ladění",
"command.dotnet.openSolution": "Otevřít řešení",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Restartovat jazykový server",
"command.dotnet.restore.all": "Obnovit všechny projekty",
"command.dotnet.restore.project": "Obnovit projekt",
Expand Down
1 change: 1 addition & 0 deletions package.nls.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Vereinbarung zu den Decompilerbedingungen anzeigen",
"command.dotnet.generateAssets.currentProject": "Ressourcen für Build und Debuggen generieren",
"command.dotnet.openSolution": "Projektmappe öffnen",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Sprachserver neu starten",
"command.dotnet.restore.all": "Alle Projekte wiederherstellen",
"command.dotnet.restore.project": "Projekt wiederherstellen",
Expand Down
1 change: 1 addition & 0 deletions package.nls.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Mostrar el contrato de términos del descompilador",
"command.dotnet.generateAssets.currentProject": "Generar recursos para compilar y depurar",
"command.dotnet.openSolution": "Abrir solución",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Reiniciar servidor de lenguaje",
"command.dotnet.restore.all": "Restaurar todos los proyectos",
"command.dotnet.restore.project": "Restaurar proyecto",
Expand Down
1 change: 1 addition & 0 deletions package.nls.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Afficher l'accord sur les termes du décompilateur",
"command.dotnet.generateAssets.currentProject": "Générer des actifs pour la construction et le débogage",
"command.dotnet.openSolution": "Solution ouverte",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Redémarrer le serveur de langue",
"command.dotnet.restore.all": "Restaurer tous les projets",
"command.dotnet.restore.project": "Restaurer le projet",
Expand Down
1 change: 1 addition & 0 deletions package.nls.it.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Mostra il contratto per i termini del decompilatore",
"command.dotnet.generateAssets.currentProject": "Genera gli asset per la compilazione e il debug",
"command.dotnet.openSolution": "Apri soluzione",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Riavvia il server di linguaggio",
"command.dotnet.restore.all": "Ripristina tutti i progetti",
"command.dotnet.restore.project": "Ripristina progetto",
Expand Down
1 change: 1 addition & 0 deletions package.nls.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "逆コンパイラの使用契約条件を表示する",
"command.dotnet.generateAssets.currentProject": "ビルド用およびデバッグ用の資産を生成する",
"command.dotnet.openSolution": "ソリューションを開く",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "言語サーバーを再起動する",
"command.dotnet.restore.all": "すべてのプロジェクトを復元する",
"command.dotnet.restore.project": "プロジェクトの復元",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"command.dotnet.test.runTestsInContext": "Run Tests in Context",
"command.dotnet.test.debugTestsInContext": "Debug Tests in Context",
"command.dotnet.restartServer": "Restart Language Server",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"configuration.dotnet.autoInsert.enableAutoInsert": "Enable automatic adjustments of code constructs on typing, including documentation comment insertion, brace formatting adjustments, and raw string literal support.",
"configuration.dotnet.formatting.organizeImportsOnFormat": "Specifies whether 'using' directives should be grouped and sorted during document formatting.",
"configuration.dotnet.defaultSolution.description": "The path of the default solution to be opened in the workspace when multiple solutions are available.",
Expand Down
1 change: 1 addition & 0 deletions package.nls.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "디컴파일러 계약 표시",
"command.dotnet.generateAssets.currentProject": "빌드 및 디버그에 대한 자산 생성",
"command.dotnet.openSolution": "솔루션 열기",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "언어 서버 다시 시작",
"command.dotnet.restore.all": "모든 프로젝트 복원",
"command.dotnet.restore.project": "프로젝트 복원",
Expand Down
1 change: 1 addition & 0 deletions package.nls.pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Pokaż umowę warunków dekompilowania",
"command.dotnet.generateAssets.currentProject": "Generuj zasoby na potrzeby kompilacji i debugowania",
"command.dotnet.openSolution": "Otwórz rozwiązanie",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Ponownie uruchom serwer języka",
"command.dotnet.restore.all": "Przywróć wszystkie projekty",
"command.dotnet.restore.project": "Przywróć projekt",
Expand Down
1 change: 1 addition & 0 deletions package.nls.pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Mostrar o contrato de termos do descompilador",
"command.dotnet.generateAssets.currentProject": "Gerar Ativos para Compilação e Depuração",
"command.dotnet.openSolution": "Abrir Solução",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Reiniciar o Servidor de Linguagem",
"command.dotnet.restore.all": "Restaurar Todos os Projetos",
"command.dotnet.restore.project": "Restaurar Projeto",
Expand Down
1 change: 1 addition & 0 deletions package.nls.ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Показать соглашение об условиях декомпиляции",
"command.dotnet.generateAssets.currentProject": "Создание ресурсов для сборки и отладки",
"command.dotnet.openSolution": "Открыть решение",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Перезапустить языковой сервер",
"command.dotnet.restore.all": "Восстановить все проекты",
"command.dotnet.restore.project": "Восстановить проект",
Expand Down
1 change: 1 addition & 0 deletions package.nls.tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "Derleyici koşulları sözleşmesini göster",
"command.dotnet.generateAssets.currentProject": "Derleme ve Hata Ayıklama için Varlıklar Oluşturun",
"command.dotnet.openSolution": "Çözümü Aç",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "Dil Sunucusunu Yeniden Başlat",
"command.dotnet.restore.all": "Tüm Projeleri Geri Yükleyin",
"command.dotnet.restore.project": "Projeyi Geri Yükle",
Expand Down
1 change: 1 addition & 0 deletions package.nls.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "显示反编译程序条款协议",
"command.dotnet.generateAssets.currentProject": "生成用于生成和调试的资产",
"command.dotnet.openSolution": "打开解决方案",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "重启语言服务器",
"command.dotnet.restore.all": "还原所有项目",
"command.dotnet.restore.project": "还原项目",
Expand Down
1 change: 1 addition & 0 deletions package.nls.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"command.csharp.showDecompilationTerms": "顯示解編程式條款合約",
"command.dotnet.generateAssets.currentProject": "產生用於建置和偵錯的資產",
"command.dotnet.openSolution": "開啟方案",
"command.dotnet.convertToProject": "Convert C# File-based App to Project",
"command.dotnet.restartServer": "重新啟動語言伺服器",
"command.dotnet.restore.all": "還原所有專案",
"command.dotnet.restore.project": "還原專案",
Expand Down
3 changes: 3 additions & 0 deletions src/lsptoolshost/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { registerCodeActionFixAllCommands } from './diagnostics/fixAllCodeAction
import { commonOptions, languageServerOptions } from '../shared/options';
import { registerNestedCodeActionCommands } from './diagnostics/nestedCodeAction';
import { registerRestoreCommands } from './projectRestore/restore';
import { registerConvertToProjectCommands } from './fileBasedApps/convertToProject';
import { registerMiscellaneousFileNotifier } from './workspace/miscellaneousFileNotifier';
import { TelemetryEventNames } from '../shared/telemetryEventNames';
import { WorkspaceStatus } from './workspace/workspaceStatus';
Expand Down Expand Up @@ -93,6 +94,8 @@ export async function activateRoslynLanguageServer(

registerRestoreCommands(context, languageServer, _channel);

registerConvertToProjectCommands(context);

registerSourceGeneratorRefresh(context, languageServer, _channel);

context.subscriptions.push(registerLanguageServerOptionChanges(optionObservable));
Expand Down
Loading