Skip to content

Editor features inside inactive #if branches should resolve active declarations #1899

Open

Description

@TwitchBronBron

Follow-up from #1886.

Code in an inactive #if branch is never added to the symbol tables, so hover, go-to-definition and completions do little there. Editor features should mainly reflect the active branches. But when the cursor is inside an inactive branch, it would help to reach out to declarations we're confident still apply. Those are mainly active declarations: global and namespace functions, classes, enums, consts and interfaces declared outside any #if.

Example: with DEBUG=true, hovering helper() inside #else should show the active sub helper() declared at the top level of the file.

Keep it small: resolve inactive-branch references against active declarations only. Fully resolving inactive code (its own locals and inactive declarations) is part of #1898.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    LanguageServerenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions