Bug 507846 - Task Tags Ignored in Assembly Code
Summary: Task Tags Ignored in Assembly Code
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.6.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-21 03:12 EST by Matthias Eckhart CLA
Modified: 2020-09-04 15:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Eckhart CLA 2016-11-21 03:12:07 EST
Comments for task tags such as `TODO` and `FIXME` in assembly code are not listed in the Tasks view.
Comment 1 Sergey Prigogin CLA 2016-11-21 18:29:13 EST
Task tags for the Tasks view are extracted by the C/C++ indexer but the indexer doesn't read assembly files.
Comment 2 Matthias Eckhart CLA 2016-11-22 01:51:08 EST
(In reply to Sergey Prigogin from comment #1)
> Task tags for the Tasks view are extracted by the C/C++ indexer but the
> indexer doesn't read assembly files.

Nathan Ridge suggested to open a separate bug for the support of task tags in assembly code. Please see Bug 507285.
Comment 3 Nathan Ridge CLA 2016-12-07 22:43:16 EST
I had a look at how handling of task tags is implemented.

It turns out that the mechanism used to syntax-color them is completely different from the mechanism used to populate the Tasks view.

  - Syntax coloring is based on CCodeScanner. It's the same mechanism
    that's used to syntax-color comments and preprocessor directives,
    and it works in both C/C++ and assembly files.

  - Extracting tasks to populate the Tasks view is done by parsing
    IASTComments from the AST, which only exists for C/C++ files, not
    assembly files.

As a result, fixing this isn't just a matter of plumbing existing things together, like bug 507285 was.
Comment 4 Nathan Ridge CLA 2016-12-11 05:00:10 EST
The solution options that I can think of are:

  (1) Create an AST for assembly files, containing at least enough
      detail to have IASTComments (but not necessarily any more
      detail). Then use the existing mechanism of extracting task
      tags from IASTComments for assembly files.

  (2) Implement a separate mechanism, perhaps reusing CCodeScanner,
      for extracting task tags from assembly files, and use that
      in the indexer (while continuing to use the IASTComment
      method for C/C++ files).

  (3) Implement a mechanism for extracting task tags from either
      assembly or C/C++ files, that does not require an AST,
      perhaps reusing CCodeScanner, and use it for both types of
      files, discarding the existing IASTComment-based mechanism.

I don't have any plans to work on this myself in the near future, but I would be happy to provide guidance to someone who would like to try.