-
-
Notifications
You must be signed in to change notification settings - Fork 391
Add support for brittany (needs aeson-2) and floskell with ghc-9.0.1 #2551
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
41 commits
Select commit
Hold shift + click to select a range
cb6ad8c
Enable tests for brittany and 9.0.2
jneira 4dc94ce
Enable tests for floskell plugin
jneira 9430cc6
Merge branch 'master' of https://github.com/haskell/haskell-language-…
jneira e2822c2
cabal-ghc901.project: naively enable brittany
Anton-Latukha 3b46968
haskell-language-server.cabal: bump brittany flag <(9.0.1->9.2.1)
Anton-Latukha 40b48da
Trying to add support for brittany
jneira 6d48732
Use last hackage floskell version
jneira 159d507
Activate floskell in func-test suite
jneira 0cd1c52
Restrict brittany in hackage for ghc<9.0.1
jneira 7eb59ae
Adapt to Aeson.Key
jneira aa29a92
Update lsp source repo package
jneira 0a70964
Refer pr for butcher
jneira ab79e36
Add missing prefix
jneira 08c5d94
Adapt to aeson-2 (incomplete)
jneira dfe6e37
Use compat module
jneira dc06c41
Support for aeson-2 and extra-1.7.10
jneira e419f6b
Remove lsp
jneira 5ea7bef
Allow newer aeson for stylish-haskell
jneira 1dbbc52
Add needed import for non windows
jneira b528bcd
Remove insertJson and toJsonKey
jneira 1a7c60b
Update cabal-ghc901.project
jneira ad303ff
Merge branch 'master' into brittany-9.0.1
jneira 223e6ee
Missing import
jneira e49c437
Merge branch 'master' into brittany-9.0.1
jneira eaef641
Avoid CPP by using lens-aeson
michaelpj 2d15a5c
Update hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs
jneira 9146431
Merge pull request #62 from michaelpj/mpj/brittany-lens
jneira 9e33d28
Merge branch 'master' into brittany-9.0.1
jneira 34000ba
Use ghcide compat module
jneira 238f553
Use type alias in cpp
jneira 31c3258
Fix stack build for ghc-8.6.5
jneira 8afbd7c
Use lens-aeson key
jneira c6d56f1
Use lens-aeson in func-test
jneira 478203c
Fixup shake-bench
michaelpj 61e8d7f
Merge branch 'master' into brittany-9.0.1
jneira 15b241c
Merge pull request #63 from michaelpj/mpj/shake-bench-aeson
jneira a545d9f
Update docs
jneira 0f1383f
Switch to lens ix
jneira b81761d
Try this
michaelpj 97a9bf3
Merge pull request #64 from michaelpj/mpj/shake-bench-aeson
jneira 5a6b878
Merge branch 'master' into brittany-9.0.1
mergify[bot] 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 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 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 |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
{-# LANGUAGE TypeFamilies #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
{-# LANGUAGE UndecidableInstances #-} | ||
{-# LANGUAGE ViewPatterns #-} | ||
-- See Note [Constraints] | ||
{-# OPTIONS_GHC -Wno-redundant-constraints #-} | ||
|
||
|
@@ -47,6 +46,7 @@ import Data.Function ((&)) | |
import Data.Kind (Constraint, Type) | ||
import qualified Data.Map.Strict as Map | ||
import Data.Proxy (Proxy (..)) | ||
import Data.String (IsString (fromString)) | ||
import qualified Data.Text as T | ||
import GHC.OverloadedLabels (IsLabel (..)) | ||
import GHC.TypeLits | ||
|
@@ -162,6 +162,7 @@ type HasProperty s k t r = (k ~ 'PropertyKey s t, Elem s r, FindByKeyName s r ~ | |
-- "Description of exampleNumber" | ||
-- 233 | ||
-- @ | ||
|
||
emptyProperties :: Properties '[] | ||
emptyProperties = Properties Map.empty | ||
|
||
|
@@ -235,7 +236,7 @@ parseProperty kn k x = case k of | |
(SEnum _, EnumMetaData {..}) -> | ||
A.parseEither | ||
( \o -> do | ||
txt <- o A..: keyName | ||
txt <- o A..: key | ||
if txt `elem` enumValues | ||
then pure txt | ||
else | ||
|
@@ -247,9 +248,9 @@ parseProperty kn k x = case k of | |
) | ||
x | ||
where | ||
keyName = T.pack $ symbolVal kn | ||
key = fromString $ symbolVal kn | ||
parseEither :: forall a. A.FromJSON a => Either String a | ||
parseEither = A.parseEither (A..: keyName) x | ||
parseEither = A.parseEither (A..: key) x | ||
|
||
-- --------------------------------------------------------------------- | ||
|
||
|
@@ -352,26 +353,26 @@ toDefaultJSON :: Properties r -> [A.Pair] | |
toDefaultJSON (Properties p) = [toEntry s v | (s, v) <- Map.toList p] | ||
where | ||
toEntry :: String -> SomePropertyKeyWithMetaData -> A.Pair | ||
toEntry (T.pack -> s) = \case | ||
toEntry s = \case | ||
(SomePropertyKeyWithMetaData SNumber MetaData {..}) -> | ||
s A..= defaultValue | ||
fromString s A..= defaultValue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to inline |
||
(SomePropertyKeyWithMetaData SInteger MetaData {..}) -> | ||
s A..= defaultValue | ||
fromString s A..= defaultValue | ||
(SomePropertyKeyWithMetaData SString MetaData {..}) -> | ||
s A..= defaultValue | ||
fromString s A..= defaultValue | ||
(SomePropertyKeyWithMetaData SBoolean MetaData {..}) -> | ||
s A..= defaultValue | ||
fromString s A..= defaultValue | ||
(SomePropertyKeyWithMetaData (SObject _) MetaData {..}) -> | ||
s A..= defaultValue | ||
fromString s A..= defaultValue | ||
(SomePropertyKeyWithMetaData (SArray _) MetaData {..}) -> | ||
s A..= defaultValue | ||
fromString s A..= defaultValue | ||
(SomePropertyKeyWithMetaData (SEnum _) EnumMetaData {..}) -> | ||
s A..= defaultValue | ||
fromString s A..= defaultValue | ||
|
||
-- | Converts a properties definition into kv pairs as vscode schema | ||
toVSCodeExtensionSchema :: T.Text -> Properties r -> [A.Pair] | ||
toVSCodeExtensionSchema prefix (Properties p) = | ||
[(prefix <> T.pack k) A..= toEntry v | (k, v) <- Map.toList p] | ||
[fromString (T.unpack prefix <> k) A..= toEntry v | (k, v) <- Map.toList p] | ||
where | ||
toEntry :: SomePropertyKeyWithMetaData -> A.Value | ||
toEntry = \case | ||
|
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
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.