Support projects in subfolders

Aperta
#1,016 5 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
haskell, typescript, vscode

Direzione di ricerca

Non sono indicati file sorgente, test o punti di ingresso. Ricrea la struttura toplevel/project descritta e apri project/src/Main.hs, quindi segui il modo in cui l’estensione sceglie la radice HLS. Il lavoro è completato quando la directory HLS è toplevel/project se lì viene trovato stack.yaml, un file .cabal, cabal.project o package.yaml.

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

Descrizione

Is your feature request related to a problem? Please describe.

I'm currently working on a project of which a Haskell project is only a small part. When trying to open the root folder in VSCode however, the Haskell extension does not pick up on the Stack project in the Haskell-specific subfolder.

Describe the solution you'd like

I would like the extension to select the Haskell project folder by looking for stack.yaml/*.cabal/whatever files, instead of just naively picking the opened folder as Haskell project folder.

This is also what Kate does, its LSP client default configuration has the following line for HLS:
"rootIndicationFileNames": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml"]

Describe alternatives you've considered

  • Just open the Haskell project in a separate VSCode window, and have two windows open (kind of annoying imo)
  • Allow creating a file that instructs HLS where to actually find the project (a bit hacky, but would be a decent workaround)
  • Open both toplevel and projects in a multi-root workspace

Additional context

Consider the following folder layout:

toplevel
| - project
| | - stack.yaml, project.cabal, src/, all other parts of a Haskell project
| - otherStuff

In my example, I open toplevel in VSCode (instead of project), but want HLS to use project as root folder.

So if I open the file project/src/Main.hs, I want HLS to start with Directory: toplevel/project, not Directory: toplevel which causes it to miss the stack/cabal files that allow it to know what dependencies I am using etc.

Lingua principale
TypeScript
Stelle
594
Fork
99
Merge medio
18h 19m
PR unite (30g)
4

Preparare l'ambiente

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 haskell/vscode-haskell

Tutte le issue di haskell/vscode-haskell

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.