PowerShell / PowerShell/vscode-powershell

PS Class type not found error with using module

Aperta
#2,887 10 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Issue-Bug Up for Grabs
Lingua principale
TypeScript
Stelle
1.9k
Fork
548
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

System Details

System Details Output

### VSCode version: 1.47.3 91899dcef7b8110878ea59626991a18c8a6a1b3e x64

### VSCode extensions:
Damien.autoit@1.0.5
DavidAnson.vscode-markdownlint@0.36.2
eamodio.gitlens@10.2.2
fernandoescolar.vscode-solution-explorer@0.3.10
GrapeCity.gc-excelviewer@3.0.39
jmrog.vscode-nuget-package-manager@1.1.6
mechatroner.rainbow-csv@1.7.1
mhutchie.git-graph@1.25.0
ms-dotnettools.csharp@1.22.1
ms-mssql.mssql@1.9.0
ms-python.python@2020.7.96456
ms-vscode-remote.remote-wsl@0.44.4
ms-vscode.cpptools@0.29.0
ms-vscode.powershell@2020.6.0
ms-vscode.powershell-preview@2020.7.0
redhat.vscode-xml@0.13.0
streetsidesoftware.code-spell-checker@1.9.0
zhuangtongfa.material-theme@3.8.5


### PSES version: 2.3.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.1.0-preview.5
PSEdition                      Core
GitCommitId                    7.1.0-preview.5
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue Description

PS Class with using module statement throws type not found. If in the integrated PS console I run using module X and then remove and add back the using statements the error will away.

It looks as though VS code is not running the using statements while editing the script.

Expected Behaviour

Open a class file with types residing in a module and no type not found error is thrown.

Actual Behaviour

Type not found until manually running using statements in integrated console.

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Iniziare dalla documentazione di troubleshooting e riprodurre il problema aprendo un file di classe i cui tipi provengono da un modulo. Confrontare il comportamento del file di classe con l'esecuzione di using module X nella console PowerShell integrata; il lavoro è completato quando l'errore di tipo non trovato non compare più senza rieseguire manualmente le using statements.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell, typescript
Ambito
tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.