-
Notifications
You must be signed in to change notification settings - Fork 789
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
WIP - [RFC FST-1033] analyzers draft #11057
Closed
Closed
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
d3efce4
analyzers draft
03d01a6
analyzers draft
0f2d736
analyzers draft
3b1c7f4
fix some basics
e025cd7
update surface area
92ca504
update surface area
89675e7
updates to contain more in result types
4ddc61e
allow analyzers to run in fsi.exe with --runanalyzers, also respect -…
c4b50cc
update baseline
46ab877
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
d134f4c
fix issues with .NET core scripting references in editing
ea42d54
fix issues with .NET core scripting references in editing
0634df8
fix issues with .NET core scripting references in editing
3da2ab5
fix issues with .NET core scripting references in editing
84fe602
add tests
89b6a4f
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
4fbf151
Merge branch 'fix-11115' into feature/analyzers
f3fd8ef
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
77817f0
add test project
6d899df
interpret compilerToolPath as a path, not a file
647f820
interpret compilerToolPath as a path, not a file
534226e
better incrementality for analyzers
af2679c
test script for analyzer
8718983
merge main
a964a1e
merge main
c2e9b9f
merge main
8e49b2e
merge main
0c2751c
merge main
d63f87e
fix regression 11176
bfad0d2
integrate main
0bb5548
integrate fix-11176
dd72dcd
merge main
c5fdb0c
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
b364d95
fix build
1c90ead
fix build
6bf0f5e
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
39dc1dd
integrate main
57fd135
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
2b3592c
Don't deploy Full extension after build
d013209
Merge branch 't6' into feature/analyzers
d5a5915
merge main
87a9caf
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
ed79d68
merge main
d924143
update baselines
3ecf924
fix baselines
87c241c
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
0abfaee
update baselines
97c1bfc
fix build
66286b8
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
163017d
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
d898cf0
merge main and cleanup
b56f7b7
merge main
dsyme e7daabd
merge main
6ec7ba2
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
7693168
simplify code
355dbd7
fix build
6f29d6e
Merge branch 'main' of https://github.com/dotnet/fsharp into feature/…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace TestAnalyzer | ||
|
||
open FSharp.Core.CompilerServices | ||
open FSharp.Compiler.CodeAnalysis | ||
open FSharp.Compiler.Diagnostics | ||
open FSharp.Compiler.Text | ||
|
||
[<assembly: AnalyzerAssemblyAttribute>] | ||
do() | ||
|
||
[<AnalyzerAttribute>] | ||
type MyAnalyzer(ctxt) = | ||
inherit FSharpAnalyzer(ctxt) | ||
|
||
override _.OnCheckFile(fileCtxt, ct) = | ||
|
||
let m = Range.mkRange fileCtxt.ParseFileResults.FileName (Position.mkPos 3 0) (Position.mkPos 3 80) | ||
let m2 = Range.mkRange fileCtxt.ParseFileResults.FileName (Position.mkPos 6 0) (Position.mkPos 6 80) | ||
let source = fileCtxt.TryGetFileSource(fileCtxt.ParseFileResults.FileName).Value | ||
[| if source.ToString().Contains("WIBBLE") |> not then | ||
FSharpDiagnostic.Create(FSharpDiagnosticSeverity.Warning, "this diagnostic is always on line 6 until the magic word WIBBLE appears", 45, m2, "FA") | ||
if source.ToString().Contains("WAZZAM") |> not then | ||
FSharpDiagnostic.Create(FSharpDiagnosticSeverity.Warning, "this diagnostic is always on line 3 until the magic word WAZZAM appears", 45, m, "FA") |] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net472</TargetFramework> | ||
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference> | ||
<UnitTestType>nunit</UnitTestType> | ||
<OtherFlags>$(OtherFlags) --nowarn:3390 --nowarn:3218</OtherFlags> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="Analyzer.fs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj" /> | ||
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a key part of the roslyn analyzer business is they are netstandard only. it's worth requiring here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure yup makes sense