microsoft / vscode-mssql

Visual Studio Code SQL Server extension.
Other
1.55k stars 458 forks source link

Folding incorrect for Transact SQL #17884

Open gbritton1 opened 8 months ago

gbritton1 commented 8 months ago

2024-03-05_11-52-02 Type: Bug

in SQL code like this:

CREATE OR ALTER PROCEDURE Production.AddNewBike @SubcategoryName NVARCHAR(50) , @ModelName NVARCHAR(50) , @productname NVARCHAR(50) , @ProductNumber NVARCHAR(25) , @color NVARCHAR(15) , @SafetyStockLevel SMALLINT , @ReorderPoint SMALLINT , @standardcost MONEY , @listprice MONEY , @DaysToManufacture INT , @SellStartDate DATETIME AS BEGIN

if I click the collapse arrow next to CREATE PROCEDURE, I expect the whole proc definition to collapse since the CREATE is the top level for the block, but it only folds the signature

Extension version: 1.22.1 VS Code version: Code 1.87.0 (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:41:44.469Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12800H (20 x 2803)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.69GB (1.67GB free)| |Process Argv|--crash-reporter-id e47ba1bc-3c8f-49a6-8d37-afc95fe7ad27| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 vscaac:30438847 c4g48928:30535728 azure-dev_surveyone:30548225 vscrpc:30673769 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 pydisww2:30959801 cppperfnew:30979542 d34g3935:30971562 edj9j583:30969295 a89i1917:30973842 bg6jg535:30979843 dsvsc020:30976470 ```
irfan7junior commented 2 months ago

Why is it happening, I'm also facing the same issue and if the number of lines is more then it becomes an issue to follow along the code without proper folding and unfolding. SSMS' folding works but I don't want to switch to it.