Open
Description
Swift version
Swift version 6.1 (swift-6.1-RELEASE)
Platform
Windows 11
Editor
Visual Studio Code 1.99.3 with Swift plugin 2.2.0, other editors
Description
When a new identifier is added (a let constant, a func, etc.) in a different source file within a module, it is not listed in results of textDocument/completion
request, unless a significant portion of the new identifier is typed by user.
Expected behavior: When a new identifier is added in a different source file, it should appear in code completion when a user types just the first character of the new identifier (and not a significant portion of it), like it is already working now if the new identifier is added in the same file.
Steps to Reproduce
- Create a Swift package:
mkdir test
cd test
swift package init --type executable
- Add a new Swift file in the Sources folder of the package, e.g.
helpers.swift
in addition to the defaultmain.swift
. - Open the
test
package folder in Visual Studio Code. - Edit the
helpers.swift
in VS Code: add for examplelet zzzConst = 42
. - Switch to
main.swift
file in VS Code and type something that would use the new constant fromhelpers.swift
, e.g. "let aaa = z" - Code completion does not show
zzzConst
(shows only two suggestions starting with "zip") - Add more text, now "let aaa = zz"
- Code completion does not show any suggestions at all.
- Add more text, now "let aaa = zzz"
- At last
zzzConst
appears in code suggestions.
Logging
No response