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

Scaffold codefix #1158

Merged
merged 11 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ This repository is prepared to use Gitpod for a web-based VSCode-style IDE. Clic

[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/fsharp/fsautocomplete)

### Creating a new code fix

Checkout [this guide](./docs/Creating%20a%20new%20code%20fix.md) to start with a new code fix.

## Releasing

* Update CHANGELOG.md with the release notes from the current release in the `Unreleased` section. Use section headings like `Added`, `Fixed`, etc from keepachangelog.com.
Expand Down
39 changes: 26 additions & 13 deletions build/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ let init args =
"reportgenerator"
"-reports:test/FsAutoComplete.Tests.Lsp/coverage.xml -reporttypes:Html;HtmlSummary -targetdir:./coverage"
|> fun r ->
if not r.OK then
failwithf "Errors while generating coverage report: %A" r.Errors)
if not r.OK then
failwithf "Errors while generating coverage report: %A" r.Errors)

Target.create "ReleaseArchive" (fun _ ->
Directory.ensure pkgsDir

!!(toolsDir </> "fsautocomplete.*.nupkg")
|> Shell.copy pkgsDir)
!!(toolsDir </> "fsautocomplete.*.nupkg") |> Shell.copy pkgsDir)

Target.create "LocalRelease" (fun _ ->
Directory.ensure toolsDir
Expand All @@ -89,7 +88,9 @@ let init args =
{ p with
OutputPath = Some(__SOURCE_DIRECTORY__ </> ".." </> toolsDir)
Configuration = DotNet.BuildConfiguration.fromString configuration
MSBuildParams = { MSBuild.CliArguments.Create() with Properties = [ packAsToolProp ] } })
MSBuildParams =
{ MSBuild.CliArguments.Create() with
Properties = [ packAsToolProp ] } })
"src/FsAutoComplete")

Target.create "Clean" (fun _ -> Shell.cleanDirs [ buildDir; buildReleaseDir; pkgsDir; toolsDir ])
Expand All @@ -98,7 +99,9 @@ let init args =

Target.create "Build" (fun _ ->
DotNet.build
(fun p -> { p with Configuration = DotNet.BuildConfiguration.fromString configuration })
(fun p ->
{ p with
Configuration = DotNet.BuildConfiguration.fromString configuration })
"FsAutoComplete.sln")

Target.create "EnsureRepoConfig" (fun _ ->
Expand Down Expand Up @@ -170,25 +173,35 @@ let init args =

Target.create "Promote" ignore

Target.create "ScaffoldCodeFix" (fun ctx ->
let codeFixName = ctx.Context.Arguments |> List.tryHead

match codeFixName with
| None -> failwith "Usage: dotnet run --project ./build/build.fsproj -- -t ScaffoldCodeFix <name>"
| Some codeFixName -> ScaffoldCodeFix.scaffold codeFixName)

Target.create "EnsureCanScaffoldCodeFix" (fun _ -> ScaffoldCodeFix.ensureScaffoldStillWorks ())

"PromoteUnreleasedToVersion" ==> "CreateVersionTag" ==> "Promote"
|> ignore<string>

"Restore" ==> "Build" |> ignore<string>

"Build" ==> "LspTest" ==> "Coverage" ==> "Test" ==> "All"
"Build"
==> "EnsureCanScaffoldCodeFix"
==> "LspTest"
==> "Coverage"
==> "Test"
==> "All"
|> ignore<string>

"Clean"
==> "LocalRelease"
==> "ReleaseArchive"
==> "Release"
|> ignore<string>
"Clean" ==> "LocalRelease" ==> "ReleaseArchive" ==> "Release" |> ignore<string>

"ReleaseArchive" ==> "All" |> ignore<string>

[<EntryPoint>]
let main args =
init ((args |> List.ofArray))
init (args |> List.ofArray)

try
Target.runOrDefaultWithArguments "ReleaseArchive"
Expand Down
Loading
Loading