-
Notifications
You must be signed in to change notification settings - Fork 512
Extension doesn't start up when files.exclude
values are non-boolean
#2658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension doesn't start up when files.exclude
values are non-boolean
#2658
Comments
Do you have any privilege management software or antivirus software installed on this machine? We've heard reports that these slow down start up... |
No. |
@BooTheHamster thanks for the logs could you please also provide any settings you have in vscode? |
PS C:\Work\bin> code --list-extensions |
@BooTheHamster can you explain this line in your settings?
I think if you remove that, you won't see this issue. |
Looks like this is an (as far as I can tell) undocumented but used syntax. In order to accommodate it we'll need to either make parsing it fail nicely or implement a custom JSON parser for it |
Old settings to hide *.js files when correcponding *.ts file exists. @TylerLeonhardt thanks, I remove this settings and issue gone. |
files.exclude
values are non-boolean
I've reopened this to track us handling this setting better. |
I'm running into this issue as well when using the following settings:
Since it's just a QOL setting, I've removed it to make it work. |
I also get the failure with the following files.exclude settings:
The first of those settings will hide compiled Python 2 output files as long as the corresponding *.py file is present (but if you delete or rename the original file, then the *.pyc file will show up in the File Explorer pane). The second of those settings hides the directory where Python 3 compiled output is stored. Below are the exception and call stack reported in the PowerShell Editor Services output pane. Looks like the problem might originate near ConfigurationHandler.cs line 52? [Error - 1:56:34 PM] OmniSharp.Extensions.JsonRpc.InputHandler: Failed to handle request workspace/didChangeConfiguration - Newtonsoft.Json.JsonReaderException: Error reading boolean. Unexpected token: StartObject. Path 'files.exclude['**/*.pyc']'. |
Thanks for the extra info. We have a good idea where the problem is: See the use of Not sure if @david-driscoll has any ideas here on the best way to handle this... but we probably need this to be a Dictionary of class BoolOrWhen
{
public bool HasBool => _boolValue != null;
private bool? _boolValue;
public bool Bool => _boolValue ?? false;
public bool HasWhen => When != null;
public string When { get; private set; }
} and then we have a Newtonsoft serializer that will handle turning what's given into this class. With all that said... we've got a lot on our plate right now so this isn't the highest priority issue, unfortunately. If someone wants to help out and pick this up, we can probably be able to assist in walking through this. |
I observed this issue today and spent a few hours trying to get my debugger to connect. I modifed settings.json from: {
"files.exclude": {
"amplify/.config": true,
"amplify/**/*-parameters.json": true,
"amplify/**/amplify.state": true,
"amplify/**/transform.conf.json": true,
"amplify/#current-cloud-backend": true,
"amplify/backend/amplify-meta.json": true,
"amplify/backend/awscloudformation": true,
"**/.git": true,
"**/.DS_Store": true,
"**/*.js": {
"when": "$(basename).ts"
},
"**/*.d.ts": {
"when": "$(basename).ts"
}
},
"deepscan.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true,
"source.fixAll.eslint": true
}
} to (commenting out the causative issue) {
"files.exclude": {
"amplify/.config": true,
"amplify/**/*-parameters.json": true,
"amplify/**/amplify.state": true,
"amplify/**/transform.conf.json": true,
"amplify/#current-cloud-backend": true,
"amplify/backend/amplify-meta.json": true,
"amplify/backend/awscloudformation": true,
"**/.git": true,
"**/.DS_Store": true,
// "**/*.js": {
// "when": "$(basename).ts"
// },
// "**/*.d.ts": {
// "when": "$(basename).ts"
// }
},
"deepscan.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.markdownlint": true,
"source.fixAll.eslint": true
}
} My logs (EditorServices.log) whilst this was broken looked like follows 2021-02-26 11:26:12.706 +01:00 [INF] PowerShell runtime version: 5.1.19041.610, edition: Desktop
2021-02-26 11:26:13.446 +01:00 [INF] highlight handler loaded
2021-02-26 11:26:13.980 +01:00 [ERR] Execution of the following command(s) completed with errors:
Import-Module ~\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\Commands\PowerShellEditorServices.Commands.psd1
2021-02-26 11:26:14.892 +01:00 [FTL] Failed to handle request workspace/didChangeConfiguration
Newtonsoft.Json.JsonReaderException: Error reading boolean. Unexpected token: StartObject. Path 'files.exclude['**/*.js']'.
at Newtonsoft.Json.JsonReader.ReadAsBoolean()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject[T]()
at Microsoft.PowerShell.EditorServices.Handlers.PsesConfigurationHandler.<Handle>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.<Handle>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.<Handle>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestPreProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestPostProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<<RouteNotification>g__InnerRoute|4_1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteNotification>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.JsonRpc.InputHandler.<>c__DisplayClass39_0.<<RouteNotification>b__3>d.MoveNext()
2021-02-26 11:26:15.880 +01:00 [INF] PSScriptAnalyzer settings file not found. Falling back to default rules
And when fixed 2021-02-26 15:30:02.604 +01:00 [INF] PowerShell runtime version: 7.1.2, edition: Core
2021-02-26 15:30:02.931 +01:00 [INF] highlight handler loaded
2021-02-26 15:30:03.405 +01:00 [ERR] Execution of the following command(s) completed with errors:
Import-Module ~.vscode\extensions\ms-vscode.powershell-preview-2021.2.1\modules\PowerShellEditorServices\Commands\PowerShellEditorServices.Commands.psd1
2021-02-26 15:30:04.639 +01:00 [INF] Unable to find PSSA settings file at 'c:\PSScriptAnalyzerSettings.psd1'. Loading default rules.
2021-02-26 15:30:04.645 +01:00 [INF] PSScriptAnalyzer settings file not found. Falling back to default rules
|
I've finally tracked down the definition of this expression syntax. As far as I know it's still undocumented and it's not clear how stable this is intended to be, but we might at least be able to implement something around it given this information. |
It's a stable API. It's just... unfortunately... not documented. |
It's documented here on the official VSCode docs. Unless we are talking about it being documented somewhere else? |
The fix for this is out in PowerShell Preview v2022.2.2! |
Powershell integrated console hangs on when I open powershel source file. Running any powershell code by pressing F5 also hangs on.
Attach output console log, terminal window screenshot and logs.

ms-vscode.powershell-logs.zip
terminal-window-log.txt
vscode-output-log.txt
The text was updated successfully, but these errors were encountered: