[all-commits] [llvm/llvm-project] 3ac550: [clang][ExtractAPI] Complete declaration fragments...

R4444 via All-commits all-commits at lists.llvm.org
Thu Apr 13 09:56:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ac550984e83c2478772c800b1f1b5cffd63a10d
      https://github.com/llvm/llvm-project/commit/3ac550984e83c2478772c800b1f1b5cffd63a10d
  Author: ruturaj4 <ruturajkvaidya at ku.edu>
  Date:   2023-04-13 (Thu, 13 Apr 2023)

  Changed paths:
    M clang/include/clang/ExtractAPI/DeclarationFragments.h
    M clang/include/clang/ExtractAPI/ExtractAPIVisitor.h
    A clang/test/ExtractAPI/typedef_struct_enum.c

  Log Message:
  -----------
  [clang][ExtractAPI] Complete declaration fragments for TagDecl types defined in a typedef

enums and structs declared inside typedefs have incorrect declaration fragments, where the typedef keyword and other syntax is missing.

For the following struct:

typedef struct Test {
    int hello;
} Test;
The produced declaration is:

"declarationFragments": [
  {
    "kind": "keyword",
    "spelling": "struct"
  },
  {
    "kind": "text",
    "spelling": " "
  },
  {
    "kind": "identifier",
    "spelling": "Test"
  }
],
instead the declaration fragments should represent the following

typedef struct Test {
    …
} Test;

This patch removes the condition in SymbolGraphSerializer.cpp file and completes declaration fragments

Reviewed By: dang

Differential Revision: https://reviews.llvm.org/D146385




More information about the All-commits mailing list