VB -> C#: #if conditional compilation preprocessor directives are not converted

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

メンテナーはふだん 1 日以内に返信

@Sympatron がすでに取り組んでいます。

2023年10月18日 から。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
compilers

調査の方向性

VB.NET 入力を使用して問題を再現し、コンバーターの出力を期待される C# の条件付きディレクティブと比較します。#If、#Else、無効化されたテキスト、#End If がどのように処理されるかを追跡し、その後、出力が条件付き構造を保持し、ディレクティブに期待される大文字と小文字の表記を使用していることを確認します。

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

説明

VB -> C#
VB.Net input code
#If Debug
        Console.WriteLine("A")
#Else
        Console.WriteLine("B")
#End If
Erroneous output
/* TODO ERROR: Skipped IfDirectiveTrivia
#If Debug
*/
Console.WriteLine("A");
/* TODO ERROR: Skipped ElseDirectiveTrivia
#Else
*//* TODO ERROR: Skipped DisabledTextTrivia
        Console.WriteLine("B")
*//* TODO ERROR: Skipped EndIfDirectiveTrivia
#End If
*/
Expected output
#if DEBUG
    Console.WriteLine("A");
#else
    Console.WriteLine("B");
#endif
Details
  • Product in use: e.g. codeconverter.icsharpcode.net / VS extension / both
  • Version in use: e.g. 5.6.3 or a commit hash 69a16a7bb0af66c511c2493d4e5e771f90bff439
  • Did you see it working in a previous version, which?
  • Any other relevant information to the issue, or your interest in contributing a fix.
主要言語
C#
スター
918
フォーク
244
平均マージ
1日 10時間
マージ済み PR(30日)
29

環境構築

はじめの一歩

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

icsharpcode/CodeConverter のほかの issue

icsharpcode/CodeConverter の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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