[Bug]: No context-menu action to add an existing project to a solution

Aperta
#576 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript, vscode

Direzione di ricerca

Read the command contribution in src/editors/vscode/package.json and its implementation in src/scaffolding.ts, then trace how Solution Explorer distinguishes solution and project nodes. Add the context-menu actions for both cases described in the issue, including projects shown without a solution. Done means the actions appear in the relevant menus and let users add an existing project to a solution.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
What happened?

The Solution Explorer has no way to add an existing project to an existing solution. Right-clicking a project shows only Build / Clean / Rebuild / Consolidate Packages / Remove Unused Packages / Copy Name. Nothing on the solution node does it either.

The command already exists: sharplsp.addProjectToSolution is in src/editors/vscode/package.json and implemented in src/scaffolding.ts. But it has no contributes.menus entry, so you can only run it from the Command Palette.

The gap is worst when the solution is empty (<Solution></Solution>) or doesn't reference the project. The explorer shows the project with no solution node above it, so there's nothing to right-click to fix it.

Steps to reproduce
  1. Make a folder with an SDK App.csproj and an empty App.slnx (dotnet new sln --format slnx).
  2. Open it in VS Code with SharpLsp 0.33.0.
  3. Right-click the project, or the solution, in the Solution Explorer.
  4. There is no "Add Existing Project…" / "Add to Solution" item.

Expected:

  • On a solution node: "Add Existing Project…" opens a file picker for .csproj/.fsproj and runs addProjectToSolutionFile.
  • On a project node that isn't in any solution: "Add to Solution…" lets you pick a solution from the workspace.
  • When a project is shown without a solution, the user still has a context-menu way to add it to one.

Related: #575 (standalone csproj only loaded when a solution references it).

Component

VS Code extension

Language

C#

SharpLsp version

0.33.0 (latest release, v0.33.0)

Editor & OS

VS Code, macOS 26.7.1

Lingua principale
TypeScript
Stelle
185
Fork
12
Merge medio
7h 33m
PR unite (30g)
63

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Nimblesite/SharpLsp

Tutte le issue di Nimblesite/SharpLsp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.