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.

No Semantic Tokens are Being Generated, while the IntegratedTerminal is working

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

There are no semantic tokens being used by the editor. ( I was debugging why semantic colors for the powershell language was ignoring all semantic configurations. )

image

It’s supposed to look like this:

image

PowerShell Version

🐒> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.0
PSEdition                      Core
GitCommitId                    7.2.0
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.63.0
7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e
x64

code.cmd --list-extensions --show-versions | select-string powershell

Extension Version

ms-vscode.powershell@2021.10.2

Steps to Reproduce

  1. Enable semantic in your settings.json
  2. Open any *.ps1 file .1 Use token inspector, and you get no info.

semantic config

I have every possible semantic config enabled.

Visuals

I think the Language Server is running

This screen shows that these are all running

  • autocomplete
  • 1 reference
  • ScriptAnalyzer warnings

image image

Logs

{
    "csharp.semanticHighlighting.enabled": true, // default is false?
    "editor.semanticHighlighting.enabled": true, //     // <true | false | ConfiguredbByTheme>
    "editor.semanticTokenColorCustomizations": {
        "csharp.semanticHighlighting.enabled": true, // default is false?
        "editor.semanticHighlighting.enabled": "true",
        "editor.semanticTokenColorCustomizations": {
            // per-theme
            "enabled": true,
            "rules": {
                "parameter": {
                    "foreground": "#ea00ff",
                    "underline": true,
                    "bold": true,
                    "italic": true,
                    "fontStyle": "italic bold underline"
                },
            },
            "[Default Dark+]": {
                "enabled": true,
                "rules": {
                    // single value
                    // vs many
                    "*.abstract": {
                        "foreground": "#0000ff",
                        "underline": true,
                        "fontStyle": "bold underline"
                    },
                    "parameter": {
                        "foreground": "#ea00ff",
                        "underline": true,
                        "bold": true,
                        "italic": true,
                        "fontStyle": "italic bold underline"
                    },
                }
            },
        },
    }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ninmonkeycommented, Dec 19, 2021

Working

Addon Version Code Version
ms-vscode.powershell 2021-10-02 insider ‘1.64.0-insider’, ‘d12df34e31b4a018735d312a8947d79331132368’, ‘x64’
ms-vscode.powershell-preview 2021-11-01 insider ‘1.64.0-insider’, ‘d12df34e31b4a018735d312a8947d79331132368’, ‘x64’

Failed

Addon Version Code Version
ms-vscode.powershell 2021-06-01 code ‘1.63.0’, ‘7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e’, ‘x64’
ms-vscode.powershell 2021-10-02 code ‘1.63.0’, ‘7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e’, ‘x64’
ms-vscode.powershell-preview 2021-11-01 code ‘1.63.0’, ‘7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e’, ‘x64’

Since code is failing but powershell-preview and powershell both work correctly on code-insiders, I’ll close this as resolved.

0reactions
andschwacommented, Dec 20, 2021

Oh awesome, thanks so much @ninmonkey!

Read more comments on GitHub >

github_iconTop Results From Across the Web

January 2021 (version 1.53) - Visual Studio Code
Learn what is new in the Visual Studio Code January 2021 Release (1.53)
Read more >
STViT: Semantic Tokens for Efficient Global and Local Vision ...
In this work, we propose a novel Semantic Token ViT (STViT), for efficient global and local vision transformers, which can also be revised ......
Read more >
Monaco editor custom token provider behaviour - Stack Overflow
I have a vague prototype working with decorations, but for my usecase there's just no way of using decorations or semantic tokens, ...
Read more >
Semantic token highlighting - SourceKit-LSP - Swift Forums
I'm going to use now response captured in handleDocumentUpdate to extract semantic tokens, but the issue is that textDocument/semanticTokens ...
Read more >
Enhanced colorization - vscode-docs-arc
We've created a set of VS Code themes that closely resemble the default Light and Dark themes in Visual Studio, and include colors...
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