Git Product home page Git Product logo

Comments (6)

deviousasti avatar deviousasti commented on May 24, 2024 1

Could you describe the error?
Would be ideal if you can paste the log from the output window.

from fantomas-for-vs.

javicabanas avatar javicabanas commented on May 24, 2024

Formatting options not be found. I have F# Formatting extension installed and VS has already been restarted and I don't have the Formatting options, I only see the below options:

On Save: "Commit Changes" and "Format on Save" options
Performance: "Apply As Diff" and "Enable SpaceBar Heating" options

The link to "editor config" (https://marketplace.visualstudio.com/editorconfig.org) is broken

from fantomas-for-vs.

bartsokol avatar bartsokol commented on May 24, 2024

Experiencing the same issue, formatting fails, the exception from the stack trace is as below.
VS 2022 version 17.3.6.

Getting this exception when trying to reformat selection (Ctrl-K F). Formatting on save or formatting the whole file (Ctrl-E D) seems to work OK.

The formatting operation failed:
 System.AggregateException: One or more errors occurred. ---> StreamJsonRpc.RemoteInvocationException: Could not load type 'System.Runtime.CompilerServices.IsReadOnlyAttribute' from assembly 'System.Collections.Immutable, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__143`1.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Fantomas.Client.LSPFantomasService.Fantomas-Client-Contracts-FantomasService-FormatSelectionAsync@274-1.Invoke(Task`1 t) in C:\Users\nojaf\Projects\fantomas\src\Fantomas.Client\LSPFantomasService.fs:line 274
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- 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 FantomasVs.FantomasHandler.<FormatAsync>d__8.MoveNext()
---> (Inner Exception #0) StreamJsonRpc.RemoteInvocationException: Could not load type 'System.Runtime.CompilerServices.IsReadOnlyAttribute' from assembly 'System.Collections.Immutable, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__143`1.MoveNext()
RPC server exception:
System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.IsReadOnlyAttribute' from assembly 'System.Collections.Immutable, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
      at System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
      at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
      at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
      at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg)
      at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
      at System.Reflection.CustomAttribute.IsDefined(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
      at System.Reflection.RuntimeMethodInfo.IsDefined(Type attributeType, Boolean inherit)
      at Newtonsoft.Json.Serialization.DefaultContractResolver.IsValidCallback(MethodInfo method, ParameterInfo[] parameters, Type attributeType, MethodInfo currentCallback, Type& prevAttributeType)
      at Newtonsoft.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type type, List`1& onSerializing, List`1& onSerialized, List`1& onDeserializing, List`1& onDeserialized, List`1& onError)
      at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveCallbackMethods(JsonContract contract, Type t)
      at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(JsonContract contract)
      at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)
      at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
      at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
      at Newtonsoft.Json.Utilities.ThreadSafeStore`2.Get(TKey key)
      at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
      at StreamJsonRpc.JsonMessageFormatter.ImplicitMarshalContractResolver.ResolveContract(Type type)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
      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.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
      at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
      at StreamJsonRpc.JsonMessageFormatter.JsonRpcRequest.TryGetTypedArguments(ReadOnlySpan`1 parameters, Span`1 typedArguments)
      at StreamJsonRpc.TargetMethod.TryGetArguments(JsonRpcRequest request, MethodSignature method, Span`1 arguments)
      at StreamJsonRpc.TargetMethod..ctor(JsonRpcRequest request, List`1 candidateMethodTargets, SynchronizationContext fallbackSynchronizationContext)
      at StreamJsonRpc.Reflection.RpcTargetInfo.TryGetTargetMethod(JsonRpcRequest request, TargetMethod& targetMethod)
      at StreamJsonRpc.JsonRpc.DispatchIncomingRequestAsync(JsonRpcRequest request)
<---

from fantomas-for-vs.

nojaf avatar nojaf commented on May 24, 2024

As for this last issue, @deviousasti a fix was made in Fantomas.Client 0.7.0.
Please update the extension to that version.
The fix is on both sides, users would need to update to fantomas 5.1.2 (or higher) in order for selection to work.

from fantomas-for-vs.

deviousasti avatar deviousasti commented on May 24, 2024

Will update Fantomas client.

from fantomas-for-vs.

deviousasti avatar deviousasti commented on May 24, 2024

Should be closed by #43

from fantomas-for-vs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.