-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionArea → source tooling: code completionsource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source tooling
Description
Previous ID | SR-8898 |
Radar | rdar://problem/44942051 |
Original Reporter | @AnthonyLatsis |
Type | Bug |
Environment
Xcode 12.0 beta (12A6159)
Additional Detail from JIRA
Votes | 0 |
Component/s | CodeCompletion |
Labels | Bug |
Assignee | @rintaro |
Priority | Medium |
md5: 3b8fc482fb0b9539e17cde7ce92f056a
is duplicated by:
- SR-14431 Global completions at top level from module only appear after import statement
Issue Description:
The real problem here is that
consumeDecl
wants to useIsTopLevel
to meanTopLevelCode
- i.e. a script or main.swift file, where you cannot make forward references at all - but the caller is passing inTopLevelLibrary
as well, where forward references are fine. So we actually have the same bug already in e.g. inheritance completion where we only suggest the names earlier in the file.
Test case for inheritance completion:
$ cat t.swift
class C {}
class E: #^A^# {}
class D {}
$ xcrun swift-ide-test -code-completion -code-completion-token=A -source-filename=t.swift | grep CurrMo
found code completion token A at offset 20
Decl[Class]/CurrModule: C[#C#]; name=C
This should also find D.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionArea → source tooling: code completionsource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source tooling