Skip to content

Only Snippets in intellisense (no modules) #2048

@scottmckendry

Description

@scottmckendry

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Using PowerShell Editor Services in neovim with the following LSPConfig:

local bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services"
local command_fmt = [[& '%s/PowerShellEditorServices/Start-EditorServices.ps1' -BundledModulesPath '%s' -LogPath '%s/powershell_es.log' -SessionDetailsPath '%s/powershell_es.session.json' -FeatureFlags @() -AdditionalModules @() -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -Stdio -LogLevel Normal]]
local temp_path = vim.fn.stdpath("cache")
local command = command_fmt:format(bundle_path, bundle_path, temp_path, temp_path)
lspconfig.powershell_es.setup {
  on_attach = on_attach,
  capabilities = capabilities,
  filetypes = { "ps1" },
  bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services",
  cmd = { "pwsh", "-NoLogo", "-Command", command },
}

As part of troubleshooting, I set the cmd to include my profile which had this line:

Get-Module -ListAvailable | Import-Module

However, still no modules in Intellisense.

Expected behavior

Typing `Get-C` in a ps1 buffer should display Get-ChildItem in autocomplete

Actual behavior

Type `Get-C` in a ps1 buffer only shows snippets

Error details

No response

Environment data

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

Version

3.8.7 - Mason Registry

Visuals

Example of missing IntelliSense
image

Output of :LspInfo
image

Metadata

Metadata

Assignees

No one assigned

    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