Replies: 12 comments
-
it depends on what you want to do with your extension. Because F# has a good … wide distribution, it makes it convenient for other software to be distributed with us, that one stop shop for all things F# is certainly enticing. However, the price of that, is that we control what goes into our repo and products, which may make it hard for you to add the exact features that you want to add. There are now alternate distribution mechanisms, nuget.org, the vs package store, and the vs code packaging mechanism spring to mind. Each of which gives the ability to develop your add-in in a way that suits you. However, that still leaves the problem of discovery, how does a user know to go and find and install your tool. It is conceivable that we could figure out a mechanism, but I'm not sure what that would look like, but would likely involve evangelism and education via fsharp.org. |
Beta Was this translation helpful? Give feedback.
-
Another mechanical issue is that FSharpLint relies on the FCS package, whereas the F# tools do not. We may eventually rely on FCS directly (but still built it out of this repo), but we're not there yet. So any integration would demolish performance as we'd need to load two FSharp.Compiler.Private .dlls in the same process. |
Beta Was this translation helpful? Give feedback.
-
Another thing to consider is working with @deviousasti to add/make a parallel extension for FSharpLint in a similar way to what they did for Fantomas. |
Beta Was this translation helpful? Give feedback.
-
I'm open to the idea. I was actually thinking there needs to be a FSharp.Analyzers for Visual Studio. I think it might align with FSharpLint. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately the current state of affairs within VS is still that unless it's done as a part of the compiler service proper, then it'll have a big performance impact :( |
Beta Was this translation helpful? Give feedback.
-
fantomas-vs was not too bad on perf for <1k loc files - although it just needed AST and trivia. FSharpLint seems to use the TAST, but it seems - optional?
Maybe linting on build is better than none at all. Ideally, we'd model it like a roslyn analyzer - although to make full use of it, we'd need Code fixes (aka refactoring suggestions). Is it possible to get FCS to incrementally check a file? |
Beta Was this translation helpful? Give feedback.
-
@deviousasti The first thing I thought when I saw fantomas-vs was I wish we had something like that for FSharpLint :) If you want to try to make a FSharpLint extension for VS (in whatever form you think makes sense), that would be great; feel free to reach out to me with any questions about FSharpLint. You are right that the TAST is optional; only a handful of rules rely on type information, and without it they simply won't run. By the way, you can set up an MSBuild task for FSharpLint, which makes it run as part of the build. Warnings/errors will show up in the output pane in whatever IDE you use, and clicking on them will jump to the error; however, there is no underlining of the errors themselves in the source, and of course no live feedback of lint errors. |
Beta Was this translation helpful? Give feedback.
-
Actually, I did get a small POC working using The modern way it turns out that it's a bit more involved than I expected. 🙃 P.S. @jgardella I'll gladly take you up on your offer. |
Beta Was this translation helpful? Give feedback.
-
@jgardella Are the lints returned absolutely ordered by position? |
Beta Was this translation helpful? Give feedback.
-
I deployed an alpha release. Source: Hopefully things get much better when we move toward FCS in VS. |
Beta Was this translation helpful? Give feedback.
-
@deviousasti I just tested this out and it's really awesome! For an initial release it seems really full-featured, with live linting and quick-fix support. I haven't tried it out on any larger projects yet, would be curious to know how the performance is there.
Sorry for the delayed response on this. There is no explicit guarantee on the ordering of the returned lint warnings. Looking at the code, it looks like they would not necessarily be returned in order. |
Beta Was this translation helpful? Give feedback.
-
We're doing double duty until we get access to the VF# checker. We'll have to trade responsiveness for resource usage - for now it's kept fairly responsive to user input. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone.
I'm curious to hear people's thoughts on providing a Visual Studio integration for FSharpLint. I believe previously Visual F# Power Tools integrated with the linter to provide linting within Visual Studio. That extension was deprecated in favor of the VSIX in this repo, so this seems like the place to have this discussion. I've already discussed this a bit with @cartermp but wanted to open it up to the community for wider discussion. I'll post a list of my open questions and the discussion can proceed from there. If there's any other concerns people have, please raise them. If we can come to a general consensus on how to move forward, I would be interested in working on this.
Thanks for your input!
Extension Ownership
Who should own should the linting extension?
I think there are two main approaches:
visualfsharp
adds a reference toFSharpLint
, and provides linting in the existing F# support for Visual StudioFSharpLint
creates its own VS extension for F# lintingPersonally think (1) probably makes the most sense, to have all the useful F# functionality in one extension. Open to other ideas.
Triggering Linting
When should linting trigger? Is it feasible to have live linting, lint on save, lint on build?
Extension Design
I'm not very familiar with creating VS extensions. If anyone has any thoughts on the best approach for creating a linting extension, I would be very curious to hear.
Beta Was this translation helpful? Give feedback.
All reactions