-
-
Notifications
You must be signed in to change notification settings - Fork 391
Extract last 2 plugins and clean up others #1836
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0439024
Add goldenWithHaskellDoc test util
Ailrun 34dde12
Extract module name plugin
Ailrun 0a9b876
Extract ormolu plugin
Ailrun 9f014e2
Clean up brittany plugin
Ailrun 13ed087
Clean up class plugin
Ailrun 8025095
Clean up eval plugin
Ailrun 717b1ff
Clean up explicit imports plugin
Ailrun 00c51b0
Clean up floskell plugin
Ailrun f653555
Clean up fourmolu plugin
Ailrun f975f87
Clean up haddock comments plugin
Ailrun 1394eb8
Clean up hlint plugin
Ailrun 282b328
Clean up pragmas plugin
Ailrun d3eb980
Clean up refine imports plugin
Ailrun eab6382
Clean up retrie plugin
Ailrun 4bc05a5
Clean up splice plugin
Ailrun 34093a8
Clean up stylish haskell plugin
Ailrun e71318e
Fix formatter tests
Ailrun 14b5425
Fix tests' hie.yaml
Ailrun f0c0062
Clean up Wingman
Ailrun 71c6f7c
Fix eval tests
Ailrun 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,39 +1,37 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
module Main(main) where | ||
module Main | ||
( main | ||
) where | ||
|
||
import qualified Data.ByteString.Lazy as BS | ||
import qualified Data.Text.Encoding as T | ||
import qualified Data.Text.IO as T | ||
import qualified Ide.Plugin.Brittany as Brittany | ||
import qualified Ide.Plugin.Brittany as Brittany | ||
import System.FilePath | ||
import Test.Hls | ||
|
||
main :: IO () | ||
main = defaultTestRunner tests | ||
|
||
plugin :: PluginDescriptor IdeState | ||
plugin = Brittany.descriptor "brittany" | ||
brittanyPlugin :: PluginDescriptor IdeState | ||
brittanyPlugin = Brittany.descriptor "brittany" | ||
|
||
tests :: TestTree | ||
tests = testGroup "brittany" [ | ||
goldenGitDiff "formats a document with LF endings" "test/testdata/BrittanyLF.formatted_document.hs" $ runSessionWithServerFormatter plugin "brittany" "test/testdata" $ do | ||
doc <- openDoc "BrittanyLF.hs" "haskell" | ||
formatDoc doc (FormattingOptions 4 True Nothing Nothing Nothing) | ||
BS.fromStrict . T.encodeUtf8 <$> documentContents doc | ||
|
||
, goldenGitDiff "formats a document with CRLF endings" "test/testdata/BrittanyCRLF.formatted_document.hs" $ runSessionWithServerFormatter plugin "brittany" "test/testdata" $ do | ||
doc <- openDoc "BrittanyCRLF.hs" "haskell" | ||
formatDoc doc (FormattingOptions 4 True Nothing Nothing Nothing) | ||
BS.fromStrict . T.encodeUtf8 <$> documentContents doc | ||
|
||
, goldenGitDiff "formats a range with LF endings" "test/testdata/BrittanyLF.formatted_range.hs" $ runSessionWithServerFormatter plugin "brittany" "test/testdata" $ do | ||
doc <- openDoc "BrittanyLF.hs" "haskell" | ||
let range = Range (Position 1 0) (Position 2 22) | ||
formatRange doc (FormattingOptions 4 True Nothing Nothing Nothing) range | ||
BS.fromStrict . T.encodeUtf8 <$> documentContents doc | ||
|
||
, goldenGitDiff "formats a range with CRLF endings" "test/testdata/BrittanyCRLF.formatted_range.hs" $ runSessionWithServerFormatter plugin "brittany" "test/testdata" $ do | ||
doc <- openDoc "BrittanyCRLF.hs" "haskell" | ||
let range = Range (Position 1 0) (Position 2 22) | ||
formatRange doc (FormattingOptions 4 True Nothing Nothing Nothing) range | ||
BS.fromStrict . T.encodeUtf8 <$> documentContents doc | ||
] | ||
tests = testGroup "brittany" | ||
[ brittanyGolden "formats a document with LF endings" "BrittanyLF" "formatted_document" $ \doc -> do | ||
formatDoc doc (FormattingOptions 4 True Nothing Nothing Nothing) | ||
|
||
, brittanyGolden "formats a document with CRLF endings" "BrittanyCRLF" "formatted_document" $ \doc -> do | ||
formatDoc doc (FormattingOptions 4 True Nothing Nothing Nothing) | ||
|
||
, brittanyGolden "formats a range with LF endings" "BrittanyLF" "formatted_range" $ \doc -> do | ||
let range = Range (Position 1 0) (Position 2 22) | ||
formatRange doc (FormattingOptions 4 True Nothing Nothing Nothing) range | ||
|
||
, brittanyGolden "formats a range with CRLF endings" "BrittanyCRLF" "formatted_range" $ \doc -> do | ||
let range = Range (Position 1 0) (Position 2 22) | ||
formatRange doc (FormattingOptions 4 True Nothing Nothing Nothing) range | ||
] | ||
|
||
brittanyGolden :: TestName -> FilePath -> FilePath -> (TextDocumentIdentifier -> Session ()) -> TestTree | ||
brittanyGolden title path desc = goldenWithHaskellDocFormatter brittanyPlugin "brittany" title testDataDir path desc "hs" | ||
|
||
testDataDir :: FilePath | ||
testDataDir = "test" </> "testdata" |
This file contains hidden or 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,3 @@ | ||
cradle: | ||
direct: | ||
arguments: [] |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.