Skip to content

Go To Definition does not work for local variables or use semantic information #255

Closed

Description

@Jackels

I don't know how else to describe this issue.

In a function I have this code:

real32 WorkSecondsElapsed = Win32GetSecondsElapsed(LastCounter, WorkCounter);

if ( WorkSecondsElapsed < TargetSecondsElapsedPerFrame )
{
  if ( SleepIsGranular )
  {
    real32 SleepMS = 1000.0f * (TargetSecondsElapsedPerFrame - WorkSecondsElapsed );

Now when I press f12 ( or select go to definition in the menu ) on the last instance of 'WorkSecondsElapsed ' nothing happens.

Activity

  1. Jackels commented on Sep 24, 2016

    @Jackels
    Author

    I made a video of it

    http://i.imgur.com/iHZO8an.gif

  2. bobbrow commented on Apr 24, 2017

    @bobbrow
    Contributor

    This is currently the expected behavior, but we will be improving it in the future. Currently, when files are scanned, local function variables are ignored. This is to avoid polluting the database with tons of local variables since we don't have semantic IntelliSense wired up yet.

  3. changed the title [-]Got To Definition does not work consistently[/-] [+]Go To Definition does not work consistently[/+] on May 22, 2017
  4. changed the title [-]Go To Definition does not work consistently[/-] [+]Go To Definition does not work for local variables[/+] on Jul 6, 2017
  5. changed the title [-]Go To Definition does not work for local variables[/-] [+]Go To Definition does not work for local variables or use semantic information[/+] on Jan 24, 2018
  6. JingGuo218 commented on Aug 9, 2018

    @JingGuo218

    I am greatly looking forward to "IntelliSense" a member mentioned. It is the final puzzle piece that I can finally get rid of SourceInsight!! May I know when will the feature be released? Many thanks!

  7. sean-mcmanus commented on Aug 9, 2018

    @sean-mcmanus
    Contributor

    Jing (@JingGuo218) We can try to remember to ping you -- it might take 3-6 months -- it's hard to say with any accuracy.

    UPDATE: As of August 27th, 2018 we're starting to work on this.
    UPDATE: As of September 27th, 2018 we've shipped the implementation for the "current translation unit" scenarios.

  8. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Sep 21, 2018
  9. sean-mcmanus commented on Sep 28, 2018

    @sean-mcmanus
    Contributor

    0.19.0 implements IntelliSense-based Go to Definition with local variables, but only if the definition exists in the same translation unit. The "out of the TU" case (i.e. non-local variables defined in a different C++ file) is still being worked on and will fall back to the previous behavior: see #2536.

  10. windless0530 commented on Dec 20, 2018

    @windless0530

    0.19.0 implements IntelliSense-based Go to Definition with local variables, but only if the definition exists in the same translation unit. The "out of the TU" case (i.e. non-local variables defined in a different C++ file) is still being worked on and will fall back to the previous behavior: see #2536.

    My version is 0.20.1, and the problem seems still exists.
    image

  11. sean-mcmanus commented on Dec 20, 2018

    @sean-mcmanus
    Contributor

    Elio (@windless0530) Could you file a new issue with more repro info? I can't tell from your example if it's a local variable or a global variable. Most likely you are falling back to the "Tag Parser" due to missing includes.

  12. locked and limited conversation to collaborators on Oct 18, 2020
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

    Feature RequestLanguage ServicefixedCheck the Milestone for the release in which the fix is or will be available.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions