-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from kadena-io/rsoeldner/lsp-docs
Revise LSP hover details to produce new documentation
- Loading branch information
Showing
8 changed files
with
162 additions
and
1,782 deletions.
There are no files selected for viewing
File renamed without changes.
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,36 @@ | ||
module Pact.Core.Test.DocsTests (tests) where | ||
|
||
import Control.Monad | ||
import qualified Data.Set as S | ||
import Data.Text (Text) | ||
import qualified Data.Text as T | ||
import Pact.Core.Builtin | ||
import Pact.Core.Repl.BuiltinDocs.Internal | ||
import System.Directory | ||
import System.FilePath | ||
import Test.Tasty | ||
import Test.Tasty.HUnit | ||
|
||
tests :: IO TestTree | ||
tests = do | ||
let baseDir = "docs/builtins" | ||
cats <- listDirectory baseDir | ||
builtinWithDocs <- join <$> traverse (\cat -> map (T.pack . takeBaseName) <$> listDirectory (baseDir </> cat)) cats | ||
pure $ | ||
testGroup | ||
"Documentation Tests" | ||
[ docsExistsTest builtinWithDocs | ||
] | ||
|
||
docsExistsTest :: [Text] -> TestTree | ||
docsExistsTest b = testCase "Builtins should have docs" $ do | ||
let normBuiltins = builtinToNormalizedName <$> replCoreBuiltinNames | ||
let diff = (S.fromList normBuiltins `S.difference` excluded) `S.difference` S.fromList b | ||
assertEqual "Missing builtins should be empty" S.empty diff | ||
where | ||
excluded = S.fromList | ||
["cond", "env-ask-gasmodel", "env-chain-data", "env-exec-config" | ||
,"env-gaslog", "env-gasmodel-fixed", "env-milligas", "env-module-admin" | ||
,"env-set-milligas", "env-stackframe", "env-verifiers", "negate" | ||
,"pact-state", "print", "reset-pact-state", "rollback-tx", "show" | ||
,"sig-keyset", "test-capability"] |
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
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
Oops, something went wrong.