llvm / llvm/llvm-project

[clangd][modules] Complete module names after `import`

Open
#221,762 10 comments 0 reactions 0 assignees View on GitHub
clang:modules clangd
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Suggesting possible module names after typing, is not implemented.

```cpp

import f // <- should suggest importable modules

int main()
{}

```

Today with `--experimental-modules-support` there is no completion.

A few consideration:

- Should probably work for `export import` too.
- Should probably handle partitions.
- Header units and 3rdparty modules like `std` ?

Contributor guide

Open the contributing guide

Research direction

Start by tracing clangd's completion handling for C++ import declarations with --experimental-modules-support. Reproduce the example with `import f` and determine how module names, export imports, partitions, header units, and third-party modules should be represented; done means relevant module suggestions appear after `import`.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.