microsoft / microsoft/vscode-cpptools
Go To Definition on a managed function should not attempt to open a DLL as a text file
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
Type: Feature Request
Once I want to code a tool for .net I found that I have few supports.Intellisence doesn't recognise the code concerning CLR.
//a.cpp
#using<system.dll>
using namespace System;
int main(void){
Console::WriteLine("Hello World");
return 0;
}
This code surely passes the compilation with cl a.cpp /clr ,but I got these Intellisence errors:
name followed by '::' must be a class or namespace name
"#using" requires C++/CLI mode
I think it it because intellisence can't find a file declaring these namespaces and function.So I build a header.
//tips.h
namespace System{
class Console final{
public:
static void WriteLine(...);
static void Write(...);
private:
};
}//namespace System
However, this will trigger a redefination error at compile time.
system.h(4): error C2011: redefination of “System::Console”:“class”
Is there a way to get tips and Intellisence check without coming into compile time errors? Can this problem be solved by extra features? or by manually making headers?,or other snippet options? I wish there is a method.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Beispiel a.cpp mit cl /clr zu reproduzieren, und beobachte die IntelliSense-Fehler für #using und System::Console. Sieh dir anschließend die im Issue beschriebene Umgehungslösung mit tips.h und system.h an, und ermittle dann, wie Go To Definition verwaltete Funktionen behandeln sollte, ohne eine DLL als Text zu öffnen. Die Aufgabe ist erledigt, wenn C++/CLI-Code nützliche IntelliSense erhält, ohne Header zu benötigen, die Compilezeit-Neudefinitionen verursachen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100