Skip to content

Some diagnostic not showing in Neovim #2229

Open
@sharpchen

Description

@sharpchen

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with PowerShell Editor Services itself and does not reproduce in a standalone PowerShell instance, and is not an issue with my editor.
  • I have verified that I am using the latest version of PowerShell Editor Services.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

Some diagnostic show in vscode with powershell extension but not in neovim.(warning, errors are fine)
Is there a default config I've missed for PSScriptAnalyzer or something else?

neovim(no diagnostic for trailing spaces) vscode
Image Image

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Arch Linux
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Editor Version

NVIM v0.11.0
Build type: Release
LuaJIT 2.1.1741730670
Run "nvim -V1 -v" for more info

Configured by nvim-lspconfig

local lsp = require('utils.lsp')
require('lspconfig').powershell_es.setup({
  bundle_path = lsp.path.pwsh_es,
  settings = {
    powershell = {
      codeFormatting = {
        Preset = 'OTBS',
        autoCorrectAliases = true,
        useConstantStrings = true,
        useCorrectCasing = true,
        whitespaceAroundOperator = true,
        whitespaceAfterSeparator = true,
        whitespaceBeforeOpenBrace = true,
        addWhitespaceAroundPipe = true,
      },
    },
  },
})

LspInfo:

- powershell_es (id: 1)
  - Version: 7.5.0 SHA: 99dab561892364d82d4965068f7f8b175e768b1b+99dab561892364d82d4965068f7f8b175e768b1b
  - Root directory: ~/.config/home-manager
  - Command: { "pwsh", "-NoLogo", "-NoProfile", "-Command", "& '/nix/store/w3d7s47qf8mfg04hmnpgd7h6l7l85zfc-powershell-editor-services-4.3.0/lib/powershell-editor-services/PowerShellEditorServices/Start-EditorServices.ps1' -BundledModulesPath '/nix/store/w3d7s47qf8mfg04hmnpgd7h6l7l85zfc-powershell-editor-services-4.3.0/lib/powershell-editor-services' -LogPath '/home/sharpchen/.cache/nvim/powershell_es.log' -SessionDetailsPath '/home/sharpchen/.cache/nvim/powershell_es.session.json' -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal" }
  - Settings: {
      powershell = {
        codeFormatting = {
          Preset = "OTBS",
          addWhitespaceAroundPipe = true,
          autoCorrectAliases = true,
          useConstantStrings = true,
          useCorrectCasing = true,
          whitespaceAfterSeparator = true,
          whitespaceAroundOperator = true,
          whitespaceBeforeOpenBrace = true
        }
      }
    }

PowerShell Editor Services Version

idk how to attach it in neovim

Steps to Reproduce

# any snippet with trailing spaces
ni foo.txt                 

Visuals

No response

Logs

[START][2025-04-04 22:18:33] LSP logging initiated
[WARN][2025-04-04 22:18:33] ...lsp/handlers.lua:564	"Microsoft.PowerShell.EditorServices.Logging.HostLoggerAdapter: The log level 'Normal' is deprecated and will be removed in a future release. Please update your settings or command line options to use one of the following options: 'Trace', 'Debug', 'Information', 'Warning', 'Error', 'Critical'. | "

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugA bug to squash.Needs: TriageMaintainer attention needed!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions