ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

linting doesn't work

Open inwenis opened this issue 9 months ago • 7 comments

Describe the bug

linting doesn't work

Steps to reproduce

dotnet new console -lang F# put this as Program.fs

open System

[<EntryPoint>]
let main argv =
    let hello_world = "Hello world"
    printfn "%s from F#!" hello_world
    0 // return an integer exit code

Link to sample reproduction

Expected behaviour

ionide highlights hello_world as an issue

Screenshots

Image

Machine info

  • OS: Windows
  • .NET SDK version: 8.0.403
  • Ionide version: 7.25.2

Additional context

inwenis avatar Feb 25 '25 15:02 inwenis

Why do you think hello_world should be a linting error? Are there other tools that signal it that Ionide isn't showing?

baronfel avatar Feb 25 '25 15:02 baronfel

Because it works from CLI

Image

As per (https://raw.githubusercontent.com/fsprojects/FSharpLint/refs/heads/master/src/FSharpLint.Core/fsharplint.json)[https://raw.githubusercontent.com/fsprojects/FSharpLint/refs/heads/master/src/FSharpLint.Core/fsharplint.json]

    "publicValuesNames": {
        "enabled": true,
        "config": {
            "underscores": "AllowPrefix"
        }
    },

hello_world should not contain underscores

inwenis avatar Feb 25 '25 15:02 inwenis

Ah - it looks like we've disabled that feature due to API incompatibilities with FSharp.Core/FSharp.Compiler.Services. This is a problem we have with many components (including the Analyzer SDK!) so we'd need FSharpLint to update to the 9.0.200 versions before we could re-enable it.

baronfel avatar Feb 25 '25 15:02 baronfel

That explains it, thank you for answering!

inwenis avatar Feb 25 '25 15:02 inwenis

Thanks for raising this - I had actually forgotten! It's good for us to have tracking for the currently-disabled features/etc.

baronfel avatar Feb 25 '25 15:02 baronfel

https://github.com/ionide/FsAutoComplete/issues/942#issuecomment-1973585432 is the last update on the subject

TheAngryByrd avatar Feb 25 '25 15:02 TheAngryByrd

Unfortunately, fsharplint development seems to have stalled again before the PR to create a client for it was merged :-(

Maybe it's still possible to get some info into the UI by doing https://fsprojects.github.io/FSharpLint/how-tos/msbuild-task.html (I haven't tried it lately)

Numpsy avatar Mar 07 '25 09:03 Numpsy

Just a reminder here, as it seems like FSharpLint has migrated to net9.0 about 1 month ago.

Ref: https://github.com/fsprojects/FSharpLint/blob/ef77d8d9f3e468d7a887851572fbcd88fd3e7414/src/FSharpLint.Console/FSharpLint.Console.fsproj

Nyaacinth avatar Jul 26 '25 16:07 Nyaacinth

It was updated to FCS 43.9.201 which is more more up to date than it was but still a version behind here. It might still be best to try ro complete https://github.com/fsprojects/FSharpLint/pull/637 so there's less chance of it breaking again when Ionide gets updated to .NET 10

Numpsy avatar Jul 27 '25 09:07 Numpsy