question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where-Object not coloured correctly.

See original GitHub issue

System Details

  • Operating system name and version: BuildNumber : 15063 Version : 10.0.15063

code -v 1.16.1 27492b6bf3acb0775d82d2f87b25a93490673c6d

$pseditor.EditorServicesVersion Major Minor Build Revision


1 4 1 0

code --list-extensions --show-versions

eamodio.gitlens@5.1.0 filipw.scriptcsRunner@0.1.0 formulahendry.code-runner@0.7.1 groksrc.ruby@0.0.6 jcanero.hoogle-vscode@0.0.4 johnpapa.azure-functions-tools@0.3.1 justusadam.language-haskell@2.3.2 ms-mssql.mssql@1.1.0 ms-vscode.azurecli@0.2.0 ms-vscode.csharp@1.12.1 ms-vscode.PowerShell@1.4.3 ms-vscode.vscode-azureextensionpack@0.0.6 ms-vsts.team@1.122.0 msazurermtools.azurerm-vscode-tools@0.3.7 PeterJausovec.vscode-docker@0.0.17 rebornix.Ruby@0.15.0 usqlextpublisher.usql-vscode-ext@0.2.4 Vans.haskero@1.3.1 VisualStudioOnlineApplicationInsights.application-insights@0.4.1 vsciot-vscode.azure-iot-toolkit@0.2.2 wayou.vscode-todo-highlight@0.5.11

$PSVersionTable Name Value


PSVersion 5.1.15063.608 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} BuildVersion 10.0.15063.608 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1


### Issue Description

Where-Object is miscoloured. The verb 'where' is coloured, but the noun 'object' is not.

### Attached Logs

Follow the instructions in the [README](https://github.com/PowerShell/vscode-powershell#reporting-problems)
about capturing and sending logs.
![image](https://user-images.githubusercontent.com/17741734/30573395-fb0f16ae-9d36-11e7-877f-b800ba38d0b3.png)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

2reactions
thezimcommented, Sep 20, 2017

This bugs me to. This is what I have for my PowerShellSyntax.tmLanguage installed within my vscode (1.16.1) on OSX.

PS /Applications/Visual Studio Code.app/Contents> gci -Recurse -Filter Power*.tm*                                                                                                                                                                                       

    Directory: /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/powershell/syntaxes


Mode                LastWriteTime         Length Name                                                                              
----                -------------         ------ ----                                                                              
------          9/19/17   9:05 PM          32062 PowershellSyntax.tmLanguage

File itself appears to be very different from https://github.com/PowerShell/EditorSyntax/blob/master/PowerShellSyntax.tmLanguage

foreach has an exclusion with object. where should get the same treatment or outright removed as @rkeithhill recommended.

<dict>
     <key>match</key>
     <string>(?&lt;!\w)((?i:begin|break|catch|continue|data|define|do|dynamicparam|else|elseif|end|exit|finally|for|foreach(?!-object)|from|if|in|inlinescript|parallel|param|process|return|switch|throw|trap|try|until|using|var|where|while)|%|\?)(?!\w)</string>
    <key>name</key>
    <string>keyword.control.powershell</string>
</dict>

Adding the following (in patterns section) with the exclusion above for where corrects the issue in my case.

<dict>
	<key>comment</key>
	<string>Builtin cmdlets with reserved verbs</string>
	<key>match</key>
	<string>(?&lt;!\w)(?i:where-object)(?!\w)</string>
	<key>name</key>
	<string>support.function.powershell</string>
</dict>
1reaction
daviwilcommented, Sep 22, 2017

Yep, we’ve overhauling the syntax definition, hoping to have that ready soon. Thanks for your PR! I’ll close this issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: why are my objects not getting colored? - 11604744
Try to change the colour using the Appereance palette. If not double click on the text to expand it and then try changing...
Read more >
Unable to change color of object in Illustrator - YouTube
Lets learn how to fix the problem when you are trying to change color of an object in illustrator, but its not working, ......
Read more >
Object colors are incorrectly displayed in Model Space in ...
Issue: Layer colors in Model space are displayed different than expected, while paper space layouts display correctly in AutoCAD. The object ...
Read more >
What determines the colour of an object?
The 'colour' of an object is the wavelengths of light that it reflects. This is determined by the arrangement of electrons in the...
Read more >
Loaded objects in OpenGL have no color - Stack Overflow
Yes, I have the .mtl file along with the obj file. The object is loaded correctly (I can see the teapot model when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found