microsoft / microsoft/vscode-cpptools
Make constraint based auto-complete work with alias declarations.
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
Feature Request
Environment
OS and Version: Ubuntu 23.04
VS Code Version: 1.79.0
C/C++ Extension Version: 1.16.3
This should be the last of my issues. I'm putting the finishing touches on my code base and this is the last of the low hanging issues with how autocomplete and intellisense work with my concept system. Really great work so far, btw. I think the autocomplete should document my library nicely.
The following is a minimal example of what I mean
template <typename Type>
concept HasFoo = requires(Type &type) {
type.foo();
};
struct T {
void foo () {}
};
template <HasFoo Type>
struct Foo {
using T = Type;
Foo () {
T x;
Type y;
// T will autocomplete `foo()`, x will NOT
}
};
int main () {
Foo<T> a{};
}
The name T cannot be associated to anything other than Type, which will have foo() suggested for it. However this suggestion does not appear after T x.
template <typename Types>
concept HasReal = requires(typename Types::Real &real) {
real.reduce();
};
struct T {
struct Real {
void reduce () {}
};
};
template <HasReal Types>
struct Foo {
using R = typename Types::Real x;
Foo () {
R x;
typename Types::Real y;
}
};
int main () {
Foo<T>();
}
This is another example of the auto complete not working as expected. It will work for typename Types::Real y but not R x.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo i due esempi C++ minimi, concentrandoti sul completamento automatico e su IntelliSense per i tipi vincolati da concept e le dichiarazioni di alias. Confronta il completamento per le dichiarazioni dirette dei tipi con quello degli alias; il lavoro è completato quando alias come T e R forniscono gli stessi suggerimenti sui membri dei rispettivi tipi sottostanti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, typescript, vscode
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100