Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Transparent Compiler returns no completions after a dangling dot

Aperta
#20,660 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
fsharp
Ambito
compilers, tooling

Direzione di ricerca

Run ./run.sh to reproduce the difference between the transparent and default compilers. Start in Harness, where ParseAndCheckFileInProject and GetDeclarationListInfo are called, and use Library/Questions.fs and Library/Use.fs as the minimal case. Done means the transparent compiler returns the two expected completions after Questions. without requiring an unrelated reference to Questions.

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

Descrizione

Bug Needs-Triage

Hello,
While working on a project of mine I discovered some strange behavior in the intellisense results.

After some investigation, here is what I found:

Investigation# Transparent Compiler returns no completions after a dangling dot

With the transparent compiler enabled, GetDeclarationListInfo returns an empty list for Questions. when Questions is a module declared in an earlier file of the project and the namespace holding it declares no type of its own.

The default background compiler returns the expected list for the same input.

Reproduces on FSharp.Compiler.Service 43.9.300, 43.10.103, 43.12.400, and 43.1001.125 (the build shipped in FsAutoComplete 0.83.0).

Run

./run.sh
transparentCompiler=false  2 completions [|"singleton"; "count"|]
transparentCompiler=true   0 completions [||]

Pass -p:FcsVersion=43.9.300 to run.sh to use a different FCS build.

Input

Library/Questions.fs

namespace Demo

module Questions =

    let singleton = 1
    let count = 2

Library/Use.fs

namespace Demo

module Use =

    let f () =
        Questions.
        ()

Use.fs has one parse error, FS0599: Missing qualification after '.'. The harness asks for completions at the end of the Questions. line.

Observations

Editing Library/Questions.fs and rerunning gives:

Questions.fs shape default transparent
namespace holds only the module (as checked in) 2 0
a type added to the namespace, after the module 2 2
a type added to the namespace, before the module 2 2
a type added inside the module 3 0

Writing Demo.Questions. in Use.fs instead of Questions. changes nothing.

These are correct under both compilers, so the failure is not general to the dangling dot:

  • a module declared in the same file as the dot
  • an FSharp.Core module, such as String.
  • a .NET type, such as System.Console.
  • an instance member, such as s. on a string

Adding an unrelated statement to f does not help. Adding one that mentions Questions does:

    let f () =
        Questions.
        Questions.singleton |> ignore
        ()

With that line present the transparent compiler returns the 2 expected completions.

Effect in an editor

FsAutoComplete passes --use-fcs-transparent-compiler when the VSCode setting FSharp.fcs.transparentCompiler.enabled is true.

Typing a dot after such a module then offers nothing.

Layout

  • Library/ - the project being analysed. Its DumpFscArgs target writes the compiler arguments of a design-time build to Library/obj/args.txt.
  • Harness/ - console app that calls ParseAndCheckFileInProject and GetDeclarationListInfo against Library, once per compiler.
  • run.sh - runs the target, then the harness.

fcs-transparent-completion-repro.zip

Related information

Provide any related information (optional):

  • Operating system: Omarchy (Arch Linux based), kernel 7.2.3-arch1-3, x86_64
  • .NET Runtime kind: .NET (Core)
    • SDK 10.0.102, harness and repro project both target net8.0 and run on .NET 8.0.19
    • Installed runtimes: 6.0.36, 8.0.19, 9.0.11, 10.0.0, 10.0.1, 10.0.2, 10.0.8
  • Editing Tools: VSCode 1.137.0 with Ionide-fsharp 7.31.1 (FsAutoComplete 0.83.0), setting FSharp.fcs.transparentCompiler.enabled set to true
  • FSharp.Compiler.Service: reproduces on 43.9.300, 43.10.103, 43.12.400, and 43.1001.125 (the build inside FsAutoComplete 0.83.0)
Lingua principale
F#
Stelle
4.3k
Fork
880
Merge medio
4g 14m
PR unite (30g)
99

Preparare l'ambiente

Apri in Codespaces

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

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 dotnet/fsharp

Tutte le issue di dotnet/fsharp

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.