Skip to content

PowerShell comment syntax highlight is not correct. #69771

Closed
@stefanita-mitran

Description

@stefanita-mitran

We have written the needed data into your clipboa
Issue Type: Bug

The highlight syntax for comments is wrong for PowerShell files.
EG.

.\procedure.ps1 `
   -arg1 $variableforarg1 ` #this syntax highlighting should not resemble a comment
   -arg2 $variableforarg2 ` <#this syntax highlight should not resemble a comment because it's invalid to add a comment here #>
   -arg3 $variableforarg3 <#this syntax higlight should be correct#>`
   -arg4 $variableforarg4

The example above shows that the "arg1" and "arg2" have incorrect comments and should not by syntax higlighted as comments.

For me saddly as a beginner powershell user this was an issue when trying to deploy :(. Just want to make that you have a visual cues when using this and not commit a faulty powershell script in production like me.
P.S. if you use the PowerShell ISE it will syntax highlight correctly.

VS Code version: Code 1.31.1 (1b8e830, 2019-02-12T02:20:54.427Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
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: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 31.89GB (15.24GB free)
Process Argv C:\Users\stem\Documents\Repos\track-system\TrackServices\Database\schema\58_upgrade_from_v57_to_v58.sql
Screen Reader no
VM 0%
Extensions (7)
Extension Author (truncated) Version
EditorConfig Edi 0.13.0
gc-excelviewer Gra 2.1.29
prettify-json moh 0.0.3
mssql ms- 1.4.0
csharp ms- 1.17.1
PowerShell ms- 1.11.0
vetur oct 0.16.2
rd because it was too large to send. Please paste.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions