Transparent Compiler returns no completions after a dangling dot
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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 astring
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. ItsDumpFscArgstarget writes the compiler arguments of a design-time build toLibrary/obj/args.txt.Harness/- console app that callsParseAndCheckFileInProjectandGetDeclarationListInfoagainstLibrary, 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.0and 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
- SDK 10.0.102, harness and repro project both target
- Editing Tools: VSCode 1.137.0 with Ionide-fsharp 7.31.1 (FsAutoComplete 0.83.0), setting
FSharp.fcs.transparentCompiler.enabledset totrue - 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)
- 主要语言
- F#
- 星标
- 4.3k
- 派生
- 881
- 平均合并
- 4 天 16 小时
- 30 天内合并 PR
- 122
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/fsharp 的其他 Issue
-
Needs-Triage
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 4 天内回复
-
`FSharpValue.PreComputeTuplePropertyInfo` reports an out-of-range index for every struct tuple可能已有人在做 @T-Gro 于 1 天前认领。 未关闭Bug Needs-Triage
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 4 天内回复
-
Printed quotations show a struct tuple as `NewTuple`可能已有人在做 @T-Gro 于 1 天前认领。 未关闭Bug Needs-Triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 4 天内回复
-
Semantic classification cache for opened documents is never populated (written to the unopened-documents cache)可能已有人在做 @xperiandri 于 46 天前认领。 未关闭Needs-Triage
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 4 天内回复
-
Needs-Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 4 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
WebAssembly/spec#2284 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 78/100
ProvableHQ/leo#29657 ·
-
bug parser
难度 2/5 1-3 小时 新手友好度 84/100
swc-project/swc-next#1014 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
oxc-project/oxc#27992 ·
维护者通常 1 天内回复