Bug 72695 - [Content Assist] CA in template argument uses wrong context
Summary: [Content Assist] CA in template argument uses wrong context
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.0 M5   Edit
Assignee: Doug Schaefer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2004-08-26 11:01 EDT by Andrew Niefer CLA
Modified: 2008-06-20 10:46 EDT (History)
2 users (show)

See Also:


Attachments
GNUCPPSourceParser fix (1.02 KB, patch)
2007-01-29 13:04 EST, Bryan Wilkinson CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2004-08-26 11:01:11 EDT
using the following, with proper include paths:

#include <list>
class Ptr {};
typedef std::list< p[CTRL+SPACE]

The context for the result list seems to be std, when it should be the 
compilation unit. 
The list should be the same as content assist on new line starting with p, 
currently the list is the same as content assist on a new line starting with 
std::p
Comment 1 Andrew Niefer CLA 2005-04-22 14:28:19 EDT
resolvePrefix is not getting called, the result list shows only keywords and macros.

To do content assist here I would expect that the IASTName would be part of
either an IASTTypeId or an IASTIdExpression
Comment 2 Bryan Wilkinson CLA 2007-01-29 13:04:37 EST
Created attachment 57720 [details]
GNUCPPSourceParser fix

This is a very small fix to the parser to allow completions in template arguments.

Originally, the parser was looking for a '>' token, and when it didn't find one, it ignored the template arguments that it processed and eventually backtracked, resulting in no IASTNames that were hooked up to the translation unit.

Now, the parser will also consider the template arguments when an End Of Completion token is reached instead of of a '>' token.
Comment 3 Doug Schaefer CLA 2007-01-29 14:57:52 EST
Excellent. Thanks, Bryan! Patch applied.