Go To Definition on a managed function should not attempt to open a DLL as a text file

オープン
#8,539 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp
領域
tooling

調査の方向性

まず cl /clr を使って a.cpp の例を再現し、#using と System::Console に対する IntelliSense のエラーを確認します。次に、issue で説明されている tips.h と system.h の回避策を確認し、そのうえで DLL をテキストとして開かずに、Go To Definition がマネージド関数をどのように扱うべきかを判断します。C++/CLI コードが、コンパイル時の再定義を引き起こすヘッダーを必要とせずに有用な IntelliSense を受けられれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug Feature: Go to Definition Language Service

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.

主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-cpptools のほかの issue

microsoft/vscode-cpptools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。