derive Show and Eq, improvements to LSP

This commit is contained in:
2026-02-24 20:01:58 -08:00
parent a789cffcce
commit 983dde4de2
21 changed files with 281 additions and 39 deletions

14
tests/Derive.newt Normal file
View File

@@ -0,0 +1,14 @@
module Derive
import Prelude
data Blah = Foo Int | Bar | Baz String
derive Eq Blah
derive Show Blah
main : IO Unit
main = do
printLn $ Foo 42
printLn $ Bar
printLn $ Baz "woo"

3
tests/Derive.newt.golden Normal file
View File

@@ -0,0 +1,3 @@
(Foo 42)
Bar
(Baz woo)

7
tests/ImportError.newt Normal file
View File

@@ -0,0 +1,7 @@
module ImportError
-- test the FC are right and don't include next line
-- TODO continue on and hit the next one.
import Blah
import Foo.Bar
import Prelude

View File

@@ -0,0 +1,2 @@
*** Process tests/ImportError.newt
ERROR at tests/ImportError.newt:5:8--5:12: error reading tests/Blah.newt: Error: ENOENT: no such file or directory, open 'tests/Blah.newt'

8
tests/UnsafeIO.newt Normal file
View File

@@ -0,0 +1,8 @@
module UnsafeIO
import Prelude
main : IO Unit
main = do
let x = unsafePerformIO $ putStrLn "Hello, World!"
pure MkUnit

View File

@@ -0,0 +1 @@
Hello, World!