$PSVersionTable:Name Value
---- -----
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here
code -v
1.12.1
f6868fce3eeb16663840eb82123369dec6077a9b
$pseditor.EditorServicesVersion
Display nothing...
code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Just open any powershell script
Follow the instructions in the README
EditorServices.log
5/11/2017 2:31:56 AM [NORMAL] - Method "StartLogging" at line 126 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
PowerShell Editor Services Host v1.0.0.0 starting (pid 36992)...
Host application details:
Name: Visual Studio Code Host
ProfileId: Microsoft.VSCode
Version: 1.0.0
Arch: 64-bit
Operating system details:
Version: Microsoft Windows NT 6.1.7601 Service Pack 1
Arch: 64-bit
5/11/2017 2:31:56 AM [NORMAL] - Method "Initialize" at line 214 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
PowerShell runtime version: 5.1.14409.1005, edition: Desktop
5/11/2017 2:31:57 AM [NORMAL] - Method "FindPSScriptAnalyzerModule" at line 261 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs
PSScriptAnalyzer found at C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\modules\PSScriptAnalyzer\PSScriptAnalyzer.psd1
5/11/2017 2:31:57 AM [NORMAL] - Method "StartLanguageService" at line 160 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
Language service started, listening on port 22578
5/11/2017 2:31:57 AM [NORMAL] - Method "StartDebugService" at line 215 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
Debug service started, listening on port 29455
5/11/2017 2:31:58 AM [ERROR] - Method "DispatchMessage" at line 301 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs
MessageDispatcher: No handler registered for Event type 'initialized'
5/11/2017 2:31:58 AM [ERROR] - Method "DispatchMessage" at line 301 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs
MessageDispatcher: No handler registered for Event type '$/setTraceNotification'
5/11/2017 2:31:58 AM [ERROR] - Method "OnListenTaskCompleted" at line 337 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs
MessageDispatcher loop terminated due to unhandled exception:
System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass26_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<ListenForMessages>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc)
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass26_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<ListenForMessages>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc)
at System.Threading.Tasks.Task.Execute()<---
vscode-powershell.log
[2:31:55] Language server starting...
powershell.exe started --
exe: C:\WINDOWS\Sysnative\WindowsPowerShell\v1.0\powershell.exe
pid: 36992
args: C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\scripts\Start-EditorServices.ps1 -EditorServicesVersion '1.0.0' -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.0.0' -BundledModulesPath 'C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\modules' -EnableConsoleRepl -LogLevel 'Normal' -LogPath 'C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\logs\1494484315-421c0121-e093-4bd6-a688-5e28238a7b901494484314199\EditorServices.log' -SessionDetailsPath 'C:\Users\eperret\.vscode\extensions\ms-vscode.powershell-1.0.0\sessions\PSES-VSCode-36500-851452' -FeatureFlags @()
[2:31:57] Language server started.
{"debugServicePort":29455,"status":"started","channel":"tcp","languageServicePort":22578}
Connecting to language service on port 22578...
Language service connected.
When starting powershell... and with any powershell script be it empty or with a few lines... Im always getting systematically the error below:
Starting PowerShell...
PS C:\Users\eperret\Desktop\
Caught error while waiting for EditorServicesHost to complete:
One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.WaitForExit()
at CallSite.Target(Closure , CallSite , Object )
One or more errors occurred.
Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean check
ForDuplicates, Boolean needFullPath)
at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDo
cumentParams openParams, EventContext eventContext)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass26_0`2.<SetEventHandle
r>b__0(Message eventMessage, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<ListenForMessages>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc)
Any idea?
Hi @ehouarn-perret, thanks for sending along these logs! Can you turn on verbose logging and send the EditorServices.log again? It's missing one key piece of information that will help me fix the issue.
@daviwil sure, just changed the verbosity, here is below the full content:
vscode-powershell.log
[4:46:12] Language server starting...
powershell.exe started --
args: C:\Users\ehoua\.vscode\extensions\ms-vscode.powershell-1.0.0\scripts\Start-EditorServices.ps1 -EditorServicesVersion '1.0.0' -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.0.0' -BundledModulesPath 'C:\Users\ehoua\.vscode\extensions\ms-vscode.powershell-1.0.0\modules' -EnableConsoleRepl -LogLevel 'Verbose' -LogPath 'C:\Users\ehoua\.vscode\extensions\ms-vscode.powershell-1.0.0\logs\1494578772-c4272685-9e9b-4bc6-93cc-006ec8b9251d1494578770790\EditorServices.log' -SessionDetailsPath 'C:\Users\ehoua\.vscode\extensions\ms-vscode.powershell-1.0.0\sessions\PSES-VSCode-7988-133080' -FeatureFlags @()
exe: C:\WINDOWS\Sysnative\WindowsPowerShell\v1.0\powershell.exe
pid: 13024
[4:46:22] Language server started.
{"debugServicePort":26867,"status":"started","channel":"tcp","languageServicePort":10145}
Connecting to language service on port 10145...
Language service connected.
EditorServices.log
05/12/2017 4:46:18 AM [NORMAL] - Method "StartLogging" at line 126 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
PowerShell Editor Services Host v1.0.0.0 starting (pid 13024)...
Host application details:
Name: Visual Studio Code Host
ProfileId: Microsoft.VSCode
Version: 1.0.0
Arch: 64-bit
Operating system details:
Version: Microsoft Windows NT 10.0.14393.0
Arch: 64-bit
05/12/2017 4:46:18 AM [NORMAL] - Method "Initialize" at line 214 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
PowerShell runtime version: 5.1.14393.1198, edition: Desktop
05/12/2017 4:46:18 AM [VERBOSE] - Method "SetExecutionPolicy" at line 1417 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
Current execution policy: ExecutionPolicy.Unrestricted
05/12/2017 4:46:18 AM [VERBOSE] - Method "CheckForCapability" at line 154 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\Capabilities\DscBreakpointCapability.cs
Side-by-side DSC module was not found.
05/12/2017 4:46:18 AM [VERBOSE] - Method "SetProfileVariableInCurrentRunspace" at line 1535 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
Setting $profile variable in runspace. Current user host profile path: C:\Users\ehoua\OneDrive\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1
05/12/2017 4:46:19 AM [NORMAL] - Method "FindPSScriptAnalyzerModule" at line 261 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs
PSScriptAnalyzer found at C:\Users\ehoua\.vscode\extensions\ms-vscode.powershell-1.0.0\modules\PSScriptAnalyzer\PSScriptAnalyzer.psd1
05/12/2017 4:46:21 AM [VERBOSE] - Method "EnumeratePSScriptAnalyzerRules" at line 289 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs
Available PSScriptAnalyzer Rules:
PSAlignAssignmentStatement
PSAvoidUsingCmdletAliases
PSAvoidDefaultValueSwitchParameter
PSAvoidDefaultValueForMandatoryParameter
PSAvoidUsingEmptyCatchBlock
PSAvoidGlobalAliases
PSAvoidGlobalFunctions
PSAvoidGlobalVars
PSAvoidInvokingEmptyMembers
PSAvoidNullOrEmptyHelpMessageAttribute
PSAvoidUsingPositionalParameters
PSReservedCmdletChar
PSReservedParams
PSAvoidShouldContinueWithoutForce
PSAvoidUsingUserNameAndPassWordParams
PSAvoidUsingComputerNameHardcoded
PSAvoidUsingConvertToSecureStringWithPlainText
PSAvoidUsingDeprecatedManifestFields
PSAvoidUsingInvokeExpression
PSAvoidUsingPlainTextForPassword
PSAvoidUsingWMICmdlet
PSAvoidUsingWriteHost
PSMisleadingBacktick
PSMissingModuleManifestField
PSPlaceCloseBrace
PSPlaceOpenBrace
PSPossibleIncorrectComparisonWithNull
PSProvideCommentHelp
PSUseApprovedVerbs
PSUseBOMForUnicodeEncodedFile
PSUseCmdletCorrectly
PSUseCompatibleCmdlets
PSUseConsistentIndentation
PSUseConsistentWhitespace
PSUseDeclaredVarsMoreThanAssignments
PSUseLiteralInitializerForHashtable
PSUseOutputTypeCorrectly
PSUsePSCredentialType
PSShouldProcess
PSUseShouldProcessForStateChangingFunctions
PSUseSingularNouns
PSUseToExportFieldsInManifest
PSUseUTF8EncodingForHelpFile
PSDSCDscExamplesPresent
PSDSCDscTestsPresent
PSDSCReturnCorrectTypesForDSCFunctions
PSDSCUseIdenticalMandatoryParametersForDSC
PSDSCUseIdenticalParametersForDSC
PSDSCStandardDSCFunctionsInResource
PSDSCUseVerboseMessageInDSCResource
05/12/2017 4:46:21 AM [VERBOSE] - Method "Initialize" at line 103 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Extensions\ExtensionService.cs
Executing extension API cmdlet script at path: C:\Users\ehoua\AppData\Local\Temp\PSES_ExtensionCmdlets_zu1s43tq.ps1
05/12/2017 4:46:21 AM [VERBOSE] - Method "ExecuteCommand" at line 468 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
Attempting to execute command(s):
. C:\Users\ehoua\AppData\Local\Temp\PSES_ExtensionCmdlets_zu1s43tq.ps1
05/12/2017 4:46:21 AM [VERBOSE] - Method "OnSessionStateChanged" at line 1112 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
Session state changed --
Old state: Ready
New state: Running
Result: NotFinished
05/12/2017 4:46:21 AM [VERBOSE] - Method "OnSessionStateChanged" at line 1112 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
Session state changed --
Old state: Running
New state: Ready
Result: Completed
05/12/2017 4:46:21 AM [VERBOSE] - Method "ExecuteCommand" at line 528 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs
Execution completed successfully.
05/12/2017 4:46:21 AM [NORMAL] - Method "StartLanguageService" at line 160 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
Language service started, listening on port 10145
05/12/2017 4:46:21 AM [NORMAL] - Method "StartDebugService" at line 215 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Host\EditorServicesHost.cs
Debug service started, listening on port 26867
05/12/2017 4:46:23 AM [VERBOSE] - Method "ReadMessage" at line 111 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs
READ MESSAGE:
{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"processId": 12528,
"rootPath": "c:\\Users\\ehoua\\Desktop\\Powershell",
"rootUri": "file:///c%3A/Users/ehoua/Desktop/Powershell",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true
},
"didChangeConfiguration": {
"dynamicRegistration": false
},
"didChangeWatchedFiles": {
"dynamicRegistration": false
},
"symbol": {
"dynamicRegistration": true
},
"executeCommand": {
"dynamicRegistration": true
}
},
"textDocument": {
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"completionItem": {
"snippetSupport": true
}
},
"hover": {
"dynamicRegistration": true
},
"signatureHelp": {
"dynamicRegistration": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"definition": {
"dynamicRegistration": true
},
"codeAction": {
"dynamicRegistration": true
},
"codeLens": {
"dynamicRegistration": true
},
"documentLink": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true
}
}
},
"trace": "off"
}
}
05/12/2017 4:46:24 AM [VERBOSE] - Method "WriteMessage" at line 59 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageWriter.cs
WRITE MESSAGE:
{
"jsonrpc": "2.0",
"id": "0",
"result": {
"capabilities": {
"textDocumentSync": 2,
"hoverProvider": true,
"completionProvider": {
"resolveProvider": true,
"triggerCharacters": [
".",
"-",
":",
"\\"
]
},
"signatureHelpProvider": {
"triggerCharacters": [
" "
]
},
"definitionProvider": true,
"referencesProvider": true,
"documentHighlightProvider": true,
"documentSymbolProvider": true,
"workspaceSymbolProvider": true,
"codeActionProvider": true,
"codeLensProvider": null,
"documentFormattingProvider": null,
"documentRangeFormattingProvider": null,
"documentOnTypeFormattingProvider": null,
"renameProvider": null,
"documentLinkProvider": null,
"executeCommandProvider": null,
"experimental": null
}
}
}
05/12/2017 4:46:24 AM [VERBOSE] - Method "ReadMessage" at line 111 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs
READ MESSAGE:
{
"jsonrpc": "2.0",
"method": "initialized",
"params": {}
}
05/12/2017 4:46:24 AM [ERROR] - Method "DispatchMessage" at line 301 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs
MessageDispatcher: No handler registered for Event type 'initialized'
05/12/2017 4:46:24 AM [VERBOSE] - Method "ReadMessage" at line 111 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs
READ MESSAGE:
{
"jsonrpc": "2.0",
"method": "$/setTraceNotification",
"params": {
"value": "off"
}
}
05/12/2017 4:46:24 AM [ERROR] - Method "DispatchMessage" at line 301 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs
MessageDispatcher: No handler registered for Event type '$/setTraceNotification'
05/12/2017 4:46:24 AM [VERBOSE] - Method "ReadMessage" at line 111 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs
READ MESSAGE:
{
"jsonrpc": "2.0",
"method": "workspace/didChangeConfiguration",
"params": {
"settings": {
"powershell": {
"codeFormatting": {
"alignPropertyValuePairs": true,
"ignoreOneLineBlock": true,
"newLineAfterCloseBrace": true,
"newLineAfterOpenBrace": true,
"openBraceOnSameLine": true,
"whitespaceAfterSeparator": true,
"whitespaceAroundOperator": true,
"whitespaceBeforeOpenBrace": true,
"whitespaceBeforeOpenParen": true
},
"developer": {
"bundledModulesPath": "",
"editorServicesLogLevel": "Verbose",
"editorServicesWaitForDebugger": false,
"featureFlags": [],
"powerShellExeIsWindowsDevBuild": false,
"powerShellExePath": ""
},
"enableProfileLoading": true,
"integratedConsole": {
"focusConsoleOnExecute": true,
"showOnStartup": true
},
"scriptAnalysis": {
"enable": true,
"settingsPath": ""
},
"startAutomatically": true,
"useX86Host": false
}
}
}
}
05/12/2017 4:46:24 AM [VERBOSE] - Method "ReadMessage" at line 111 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs
READ MESSAGE:
{
"jsonrpc": "2.0",
"method": "textDocument/didOpen",
"params": {
"textDocument": {
"uri": "file:///c%3A/Users/ehoua/Desktop/Powershell/test.ps1",
"languageId": "powershell",
"version": 1,
"text": "$michelle = \"sdfg\"\r\n"
}
}
}
05/12/2017 4:46:24 AM [VERBOSE] - Method "ResolveFilePath" at line 316 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Workspace\Workspace.cs
Resolved path: c:\Users\ehoua\Desktop\Powershell\test.ps1
05/12/2017 4:46:24 AM [VERBOSE] - Method "GetFileBuffer" at line 135 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Workspace\Workspace.cs
Opened file as in-memory buffer: c:\Users\ehoua\Desktop\Powershell\test.ps1
05/12/2017 4:46:24 AM [VERBOSE] - Method "HandleDidOpenTextDocumentNotification" at line 500 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs
Finished opening document.
05/12/2017 4:46:24 AM [VERBOSE] - Method "ReadMessage" at line 111 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs
READ MESSAGE:
{
"jsonrpc": "2.0",
"method": "textDocument/didOpen",
"params": {
"textDocument": {
"uri": "perforce://print/c%3A/Users/ehoua/Desktop/Powershell/test.ps1?-q",
"languageId": "powershell",
"version": 1,
"text": ""
}
}
}
05/12/2017 4:46:24 AM [ERROR] - Method "OnListenTaskCompleted" at line 337 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs
MessageDispatcher loop terminated due to unhandled exception:
System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Illegal characters in path.
at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass26_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<ListenForMessages>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc)
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentException: Illegal characters in path.
at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
at Microsoft.PowerShell.EditorServices.Workspace.ResolveFilePath(String filePath)
at Microsoft.PowerShell.EditorServices.Workspace.GetFileBuffer(String filePath, String initialBuffer)
at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleDidOpenTextDocumentNotification(DidOpenTextDocumentParams openParams, EventContext eventContext)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<>c__DisplayClass26_0`2.<SetEventHandler>b__0(Message eventMessage, MessageWriter messageWriter)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<DispatchMessage>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.<ListenForMessages>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc)
at System.Threading.Tasks.Task.Execute()<---
05/12/2017 4:46:25 AM [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1358 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs
Analyzing script file: c:\Users\ehoua\Desktop\Powershell\test.ps1
05/12/2017 4:46:25 AM [VERBOSE] - Method "GetDiagnosticRecordsAsync" at line 327 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs
Found 0 violations
05/12/2017 4:46:25 AM [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1362 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs
Analysis complete.
05/12/2017 4:46:25 AM [VERBOSE] - Method "Post" at line 50 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Utility\ThreadSynchronizationContext.cs
Attempted to post message to synchronization context after it's already completed
OnListenTaskCompleted, seems there is an IO issue here, I haven't dug much in the vsc codebase, but on my side I don't think the path (be it the containing folder or the powershell script file itself, is containing any illegal character).
Thanks a lot! I see the issue now, you're using the Perforce plugin and it's opening a virtual file path that we don't support. I need to get this issue fixed: https://github.com/PowerShell/PowerShellEditorServices/issues/342
Nice I almost forget that one, I can actually deactivate the plugin was not really using it.
Just to confirm, works like a charm without the Perforce plugin
Just hit this issue. Work around of disabling perforce plugin worked.
I believe @tylerl0706 added support for the inmemory:// URI -- @ehouarn-perret, @Serivy would you be able to check if this bug is fixed? (Don't have perforce on my machine)
@rjmholt don't have it anymore
@Serivy?
I can confirm that the problem I was having before no longer occurs with the perforce plugin enabled. Thanks for the fix!
Awesome! Thanks everyone!
Most helpful comment
Thanks a lot! I see the issue now, you're using the Perforce plugin and it's opening a virtual file path that we don't support. I need to get this issue fixed: https://github.com/PowerShell/PowerShellEditorServices/issues/342