fsprojects / fsharp-linting-for-vs Goto Github PK
View Code? Open in Web Editor NEWVisual Studio Linter for F#
Home Page: https://marketplace.visualstudio.com/items?itemName=asti.fslint-vs
Visual Studio Linter for F#
Home Page: https://marketplace.visualstudio.com/items?itemName=asti.fslint-vs
When I run the extension with a project open which has the configuration in the default file (fsharplint.json
in the root of the repo), the configuration isn't loaded by the extension when linting. I believe this is because the extension calls into FSharpLint through Lint.ParsedFileInformation
, and FSharpLint is looking for the default configuration in ./fsharplint.json
, from the current working directory. So the current working directory is likely the directory of the file being linted, and not necessarily the root of the repo or project.
This is probably a bigger question than just the extension. Ideally, every integration for FSharpLint should use similar rules for loading the default config, so possibly there should be a change in FSharpLint itself to make this work more consistently. But I'm not sure what would make the most sense. One option would be to load fsharplint.json
in the current directory, or in any of the parent directories of the current directory.
FSharpLint has a couple of commits since the submodule commit hash d81a422.
Especially the configuration file has been changed and the file linked in the official FSharpLint docs is out of sync from the default contained in d81a422.
The submodule should be updated to the latest release.
Thanks a lot for this extension!
Are there any plans to support VS 2022?
Documentation on how to start supporting it can be found here.
I just installed F# Lint 0.4.1 on VS 2019 16.8.0
System.MissingMethodException: Method not found: 'ParserResult`2<!!0,Microsoft.FSharp.Core.Unit> FParsec.CharParsers.run(Microsoft.FSharp.Core.FSharpFunc`2<FParsec.CharStream`1<Microsoft.FSharp.Core.Unit>,FParsec.Reply`1<!!0>>, System.String)'.
at FSharpLint.Framework.Configuration.parseHint@548(String hint)
at FSharpLint.Framework.Configuration.parseHints(String[] hints)
at FSharpLint.Framework.Configuration.deprecatedAllRules@566-3.Invoke(HintConfig config)
at Microsoft.FSharp.Core.OptionModule.Map[T,TResult](FSharpFunc`2 mapping, FSharpOption`1 option) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\option.fs:line 53
at FSharpLint.Framework.Configuration.flattenConfig(Configuration config)
at FSharpLint.Application.Lint.lint(LintInfo lintInfo, FileParseInfo fileInfo)
at FSharpLint.Application.Lint.lintParsedSource(OptionalLintParameters optionalParams, ParsedFileInformation parsedFileInfo)
at FSharpLintVs.LintChecker.<DoUpdateAsync>d__48.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.VisualStudio.Threading.ThreadingTools.<WithCancellationSlow>d__9.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 FSharpLintVs.LintActionsSource.<>c__DisplayClass11_0.<<HasSuggestedActionsAsync>b__0>d.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.VisualStudio.Text.Utilities.GuardedOperations.<CallExtensionPointAsync>d__36`1.MoveNext() --- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Version: 0.2
Visual Studio version: 16.6.0
We've installed FSharpLint as a dotnet tool and configured a git pre-commit hook to lint files there. I also installed the F# Lint VS extension for earlier detection and fixes. Today I had a successful build with no linting errors in VS, but the pre-commit hook rejected the commit because the linter there caught a violation.
Additional things I noticed while trying to diagnose and gather info for this report:
The option page for the extension is completely blank
The version appears a 0.2 in the extension manager but as 0.1 in Help | About Visual Studio
Hi @deviousasti!
Don already proposed to move fsharp-formatting-for-vs to fsprojects. fsprojects/fantomas-for-vs#22
I think that this project also deserves more attention. Do you interested in the move?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.