coc-extensions / coc-powershell

PowerShellEditorService integration for coc.vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linting (Diagnostics) doesn't work

mikeTWC1984 opened this issue · comments

System Details

  • Vim or NeoVim?: both
  • Version of Vim (run vim --version) or NeoVim (run nvim --version): Neovim 0.4.3
  • _Version of coc-powershell : 0.1.1
  • Operating System: linux
  • PowerShell version (in PowerShell: $PSVersionTable): 7

Issue Description

I'm installing coc-extensions on the plain containers (various OS). Looks like there is some issue with linting for coc-powershell and coc-omnisharp. Initially I thought it's some global coc-nvim issue, because linting didn't work with python extension either. However after installing msft python server it was fixed. Then I realized linting is working with my old coc-powershell fork (I think it was v0.73).
When I do CocInfo using latest coc-powershell/omnisharp I see additional output channel (cs and ps1). Using my old fork I only see one output channel (Powershell or omnisharp)
image

image

Expected Behaviour

image

Actual Behaviour

-- Description of what actually happens --
image

It looks like it's unable to find PSScriptAnalyzer... in the integrated console, can you run:

gmo -list PSScriptAnalyzer

You are right, the command return nothing, and after installing PSScriptAnalyzer I see linting again. Thanks! Is it a bug or feature though? I guess coc-powershell used to install this module automatically

Hmm it should "just work" what's your $env:PSModulePath set to?

The last path should be a coc-powershell specific path and PSSA is supposed to be in that but I might have packaged it wrong.

/root/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules

When I use the old fork I do see coc-powershell in PSModulePath indeed.

hmm and that's from within the PowerShell Integrated Console, yes?

On macOS, I have the correct path:

PS > $env:PSModulePath

  /Users/tyleonha/.local/share/powershell/Modules
:/usr/local/share/powershell/Modules
:/usr/local/microsoft/powershell/7/Modules
:/usr/local/Cellar/powershell-daily/7.1.0-daily.20200430/libexec/Modules
:/Users/tyleonha/.config/coc/extensions/node_modules/coc-powershell/PowerShellEditorServices
/Users/tyleonha/.config/coc/extensions/node_modules/coc-powershell/PowerShellEditorServices

I just installed everything again on the new linux machine, I do see coc-powershell/PowerShellEditorServices in the psmodulepath now, but linting is not working. PSScriptAnalyzer is not in that folder. I do see it when I install my the old fork.

This is what old extension has in this folder:
docs Plaster PowerShellEditorServices PowerShellEditorServices.VSCode PSScriptAnalyzer

The new one has only PowerShellEditorServices

OK, somehow 2.1.0 release does not contain those extra modules
https://github.com/PowerShell/PowerShellEditorServices/releases/tag/v2.1.0

Great find! I'll get that fixed

This should be fixed now :)