Skip to content
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

Can't get the analyzer to work with Ionide #37

Open
rodrigoj42 opened this issue Dec 7, 2021 · 1 comment
Open

Can't get the analyzer to work with Ionide #37

rodrigoj42 opened this issue Dec 7, 2021 · 1 comment

Comments

@rodrigoj42
Copy link

Describe the bug
After installing Npgsql.FSharp.Analyzer and adding the necessary settings to Ionide I get this error in Ionide's output:

[16:54:48.502 ERR] [Analyzers] Analyzer Npgsql.FSharp.Analyzer errored while processing <file>: Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.MissingMethodException: Method not found: 'ParsedInput FSharp.Analyzers.SDK.Context.get_ParseTree()'.
   at Npgsql.FSharp.Analyzers.SqlAnalyzer.sqlAnalyzerContext(Context ctx)
   at Npgsql.FSharp.Analyzers.SqlAnalyzer.queryAnalyzer(Context ctx) in C:\projects\NpgsqlFSharpAnalyzer\src\NpgsqlFSharpAnalyzer\SqlAnalyzer.fs:line 40
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at FSharp.Analyzers.SDK.Client.getAnalyzerFromMemberInfo@39-1.Invoke(Context ctx) in /Users/chethusk/oss/FSharp.Analyzers.SDK/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.Client.fs:line 39
   at [email protected](Tuple`2 tupledArg) in /Users/chethusk/oss/FSharp.Analyzers.SDK/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.Client.fs:line 120
[Error - 4:54:48 PM] Request textDocument/documentHighlight failed.
  Message: No symbol information found
  Code: -32603 
[Error - 4:54:48 PM] Request textDocument/documentHighlight failed.
  Message: No symbol information found
  Code: -32603 

I'm not entirely sure what to make of this, as I haven't worked with analyzers before — I don't even know if it's a problem with this package or with FSharp.Analyzers.SDK, to be honest. I've tried uninstalling Npgsql.FSharp.Analyzer and then installing it back again using both nuget and paket (I thought maybe there was a versioning issue) but it didn't make a difference. I've also tried to reinstall Ionide.

Desktop:

  • OS: macOS 10.15.7
  • .NET: 6.0.100
  • Ionide: v5.10.2

Additional context
This error does not happen when using Ubik (version 3.28.0)

Any assistance will be greatly appreciated.

@bongjunj
Copy link

bongjunj commented May 28, 2023

let sqlAnalyzerContext (ctx: Context) : Core.SqlAnalyzerContext = {
Content = ctx.Content
FileName = ctx.FileName
Symbols = ctx.Symbols
ParseTree = ctx.ParseTree
}

The error message indicates that ctx.ParseTree property is not found. Seems like is its the interface of Context object has been changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants