Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[C#] Deeply nested parens causes editor hang.

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
csharp, typescript

調査の方向性

新しい evil_line.cs ファイルで、提供されたネストされた式を 1 行に結合してハングを再現し、その後、リポジトリの C# 構文文法と、ネストされた括弧およびキャストの処理を調査します。ソースファイルやテストは指定されていません。再現した C# の行によってエディターがハングしなくなり、複数行入力と報告された比較ケースが引き続き使用できれば完了です。

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

説明

Resolved-Duplicate

From @staticvoidmain on August 2, 2018 16:52

Issue Type: Bug

Problem

Too many nested parens on a single line cause C# file to hang.

Additional Info

  • I recently reversed some VB to C# and pasted it into code, resulting in a complete hang of the vscode process.
  • It's fine if these are separated into multiple lines as in the example, however if it's all on a single line you'll get a hang.
  • It's definitely the syntax highlighter, and seems to be specific to C#.
  • Tested against insiders, and with no extensions on the current build.
  • Tested the same line with other c-like language file extensions (js, ts, cpp, java) and they handle it without a crash.
  • Oh, also, if you drop the (object) casts off it's fine as well.

Steps To Reproduce

  1. New file > evil_line.cs
  2. Paste these contents
// don't try to join these lines...
var message = Conversions.ToString(
	Operators.ConcatenateObject(
		Operators.ConcatenateObject(
			Operators.ConcatenateObject(
				Operators.ConcatenateObject(
					Operators.ConcatenateObject(
						Operators.ConcatenateObject(
							Operators.ConcatenateObject(
								Operators.ConcatenateObject(
									Operators.ConcatenateObject(
										Operators.ConcatenateObject(
											Operators.ConcatenateObject(
												Operators.ConcatenateObject(
													Operators.ConcatenateObject(
														Operators.ConcatenateObject(
															Operators.ConcatenateObject(
																Operators.ConcatenateObject(
																	Operators.ConcatenateObject(
																		Operators.ConcatenateObject(
																			Operators.ConcatenateObject(
																				Operators.ConcatenateObject(
																					Operators.ConcatenateObject(
																						(object) strMsg,
																						Interaction.IIf(
																							Strings.Len(strMsg) > 0, 
																							(object) "\r\n", 
																							(object) null)), 
																					(object) "\r\n"),
																				(object) "name '"), 
																			(object) name), 
																		(object) "'"), 
																	(object) "\r\n"), 
																(object) "age '"), 
															(object) age), 
														(object) "'"),
													(object) "\r\n"),
												(object) "dob '"),
											(object) dob), 
										(object) "'"), 
									(object) "\r\n"), 
								(object) "favoriteColor '"), 
							(object) favoriteColor), 
						(object) "'"), 
					(object) "\r\n"), 
				(object) "favoriteFilm '"), 
			(object) favoriteFilm), 
		(object) "'")
	);
  1. Join Lines

VS Code version: Code 1.25.1 (1dfc5e557209371715f655691b1235b6b26a06be, 2018-07-11T15:43:53.668Z)
OS version: Windows_NT x64 10.0.14393

System Info
Item Value
CPUs Intel(R) Xeon(R) CPU E5-2695 v2 @ 2.40GHz (4 x 2400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 12.00GB (7.34GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 100%
Extensions (12)
Extension Author (truncated) Version
xml Dot 2.3.1
EditorConfig Edi 0.12.4
tslint eg2 1.0.34
vscode-great-icons emm 2.1.39
code-beautifier mic 2.1.0
mssql ms- 1.4.0
python ms- 2018.7.1
cpptools ms- 0.17.7
PowerShell ms- 1.8.2
team ms- 1.136.0
debugger-for-chrome msj 4.8.2
vscode-javascript-booster sbu 0.10.1

Copied from original issue: Microsoft/vscode#55687

主要言語
TypeScript
スター
78
フォーク
43
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

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

dotnet/csharp-tmLanguage のほかの issue

dotnet/csharp-tmLanguage の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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