Skip to content
aw-squarePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

C-Index

A minimal C code indexer for VSCode that provides Go to Definition functionality. This extension parses C code using tree-sitter and builds an in-memory index of functions, structs, and typedefs.

Features

  • Go to Definition (Ctrl+click or F12) for C functions and types
  • Support for multiple definitions with the same name (shows a picker)
  • Workspace-wide indexing of C source files
  • Auto-reindexing when files are changed or created

Getting Started

Prerequisites

  • Node.js and npm
  • Visual Studio Code

Installation

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run compile to build the extension
  4. Press F5 in VSCode to launch a new window with the extension loaded

Usage

  1. Open a folder containing C source files
  2. Wait for the indexing to complete
  3. Position cursor on a function call or type reference
  4. Press F12 or Ctrl+click to go to its definition
  5. If multiple definitions are found, a picker will be shown

How It Works

The extension uses tree-sitter to parse C files and extract symbol definitions:

  1. On activation, it scans all C files in the workspace
  2. It builds an in-memory index of functions, structs, and typedefs
  3. When you use "Go to Definition", it looks up the symbol in the index
  4. If found, it navigates to the definition location

Limitations

This is a proof of concept with the following limitations:

  • Limited support for C preprocessor directives
  • No support for complex include path resolution
  • May not handle all C language constructs correctly
  • Limited to Go to Definition functionality (no Find References, etc.)

Extension Settings

None currently.

Known Issues

This is a proof of concept and not a full-featured C language extension. For production use, consider using the official C/C++ extension or clangd.

Future Improvements

  • Support for include path configuration
  • More robust C preprocessor handling
  • Support for Find All References
  • Support for Hover information
  • Symbol renaming support

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages