Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[C#] Deeply nested parens causes editor hang.

Đang mở
#135 10 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp, typescript

Hướng nghiên cứu

Tái hiện hiện tượng treo trong một tệp evil_line.cs mới bằng cách nối biểu thức lồng nhau được cung cấp thành một dòng, sau đó kiểm tra ngữ pháp cú pháp C# của repository và cách xử lý dấu ngoặc lồng nhau và các phép cast. Không có tệp mã nguồn hoặc bài kiểm thử nào được nêu; công việc được xem là hoàn tất khi dòng C# được tái hiện không còn khiến trình soạn thảo bị treo, trong khi đầu vào nhiều dòng và các trường hợp so sánh đã nêu vẫn có thể sử dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
78
Fork
43
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/csharp-tmLanguage

Tất cả issue của dotnet/csharp-tmLanguage

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.