Bug 525250 - "Create local variable" quick fix incorrectly offered outside of local scopes
Summary: "Create local variable" quick fix incorrectly offered outside of local scopes
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: Next   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 9.5.0   Edit
Assignee: Felix Morgner CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 537272
  Show dependency tree
 
Reported: 2017-09-26 17:39 EDT by Nathan Ridge CLA
Modified: 2018-07-24 02:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Ridge CLA 2017-09-26 17:39:52 EDT
Given the following code at global scope:

int global = undefined;  // Error: Symbol "undefined" could not be resolved

Codan offers the "create local variable" quick fix for this error, but when it's invoked, nothing happens.

Given that we're not in a local scope and therefore cannot create a local variable, the quick fix shouldn't be offered to begin with.
Comment 1 Eclipse Genie CLA 2018-03-07 11:51:24 EST
New Gerrit change created: https://git.eclipse.org/r/118915
Comment 3 Nathan Ridge CLA 2018-03-14 11:12:21 EDT
Thanks for the fix, Felix!