Permalink
Browse files

remove obsolete cohatoe code

  • Loading branch information...
1 parent 3555e51 commit e92cbaa940dc77840af756699f3559839c639f4a @JPMoresmau committed Dec 4, 2012
Showing with 2 additions and 9,275 deletions.
  1. +1 −2 net.sf.eclipsefp.haskell.core/build.properties
  2. +0 −17 net.sf.eclipsefp.haskell.core/hs-src/Cohatoe/Data.hs
  3. +0 −30 net.sf.eclipsefp.haskell.core/hs-src/Cohatoe/Data/MarkerDesc.hs
  4. +0 −29 net.sf.eclipsefp.haskell.core/hs-src/EclipseFP/Haskell/Core/Marshal.hs
  5. +0 −59 net.sf.eclipsefp.haskell.core/hs-src/EclipseFP/Haskell/Core/Refactor/Diff.hs
  6. +0 −56 net.sf.eclipsefp.haskell.core/hs-src/EclipseFP/Haskell/Core/Refactor/Rename.hs
  7. +0 −32 net.sf.eclipsefp.haskell.core/hs-src/EclipseFP/Haskell/Core/Refactor/RenameInfo.hs
  8. +0 −32 net.sf.eclipsefp.haskell.core/hs-src/EclipseFP/Haskell/Core/Refactor/ReplaceEdit.hs
  9. +0 −19 net.sf.eclipsefp.haskell.core/hs-src/EclipseFP/Haskell/Core/SrcLoc.hs
  10. +0 −124 net.sf.eclipsefp.haskell.core/hs-src/GHCOutputParser.hs
  11. +0 −31 net.sf.eclipsefp.haskell.core/hs-src/MakePointFree.hs
  12. +0 −103 net.sf.eclipsefp.haskell.core/hs-src/ManipulateCabalFile.hs
  13. +0 −18 net.sf.eclipsefp.haskell.core/hs-src/OrganizeImports.hs
  14. +0 −21 net.sf.eclipsefp.haskell.core/hs-src/ParseGHCOutput.hs
  15. +0 −149 net.sf.eclipsefp.haskell.core/hs-src/Plugin/Pl/Common.hs
  16. +0 −106 net.sf.eclipsefp.haskell.core/hs-src/Plugin/Pl/Op.hs
  17. +0 −230 net.sf.eclipsefp.haskell.core/hs-src/Plugin/Pl/Parser.hs
  18. +0 −149 net.sf.eclipsefp.haskell.core/hs-src/Plugin/Pl/PrettyPrinter.hs
  19. +0 −763 net.sf.eclipsefp.haskell.core/hs-src/Plugin/Pl/Rules.hs
  20. +0 −119 net.sf.eclipsefp.haskell.core/hs-src/Plugin/Pl/Transform.hs
  21. +0 −34 net.sf.eclipsefp.haskell.core/hs-src/ValidateCabalFile.hs
  22. +1 −1 net.sf.eclipsefp.haskell.ui/build.properties
  23. +0 −69 net.sf.eclipsefp.haskell.ui/hs-src/CodeFolding.hs
  24. +0 −77 net.sf.eclipsefp.haskell.ui/hs-src/EclipseFP/Haskell/Core/GHC/Interactive.hs
  25. +0 −48 net.sf.eclipsefp.haskell.ui/hs-src/EclipseFP/Haskell/Core/GHC/Session.hs
  26. +0 −55 net.sf.eclipsefp.haskell.ui/hs-src/EclipseFP/Haskell/Core/GHC/TypeCheck.hs
  27. +0 −51 net.sf.eclipsefp.haskell.ui/hs-src/EclipseFP/Haskell/UI/Hover/EditorTextHover.hs
  28. +0 −78 net.sf.eclipsefp.haskell.ui/hs-src/FindIdentifier.hs
  29. +0 −14 net.sf.eclipsefp.haskell.ui/hs-src/HaskellOutline.hs
  30. +0 −539 net.sf.eclipsefp.haskell.ui/hs-src/Language/Haskell/Lexer.hs
  31. +0 −235 net.sf.eclipsefp.haskell.ui/hs-src/Language/Haskell/ParseMonad.hs
  32. +0 −312 net.sf.eclipsefp.haskell.ui/hs-src/Language/Haskell/ParseUtils.hs
  33. +0 −4,129 net.sf.eclipsefp.haskell.ui/hs-src/Language/Haskell/Parser.hs
  34. +0 −854 net.sf.eclipsefp.haskell.ui/hs-src/Language/Haskell/Parser.ly
  35. +0 −549 net.sf.eclipsefp.haskell.ui/hs-src/Language/Haskell/Syntax.hs
  36. +0 −15 net.sf.eclipsefp.haskell.ui/hs-src/MarkOccurrences.hs
  37. +0 −43 net.sf.eclipsefp.haskell.ui/hs-src/OutputAbleAdd.hs
  38. +0 −83 net.sf.eclipsefp.haskell.ui/hs-src/TypeSignature.hs
@@ -5,5 +5,4 @@ bin.includes = plugin.xml,\
.options,\
META-INF/,\
plugin.properties
-src.includes = schema/,\
- hs-src/
+src.includes = schema/
@@ -1,17 +0,0 @@
-
-module Cohatoe.Data( CohatoeData, marshal, module Cohatoe.Data.MarkerDesc ) where
-
-import Cohatoe.Data.MarkerDesc
-
-class CohatoeData a where
- marshal :: a -> [String]
- unmarshal :: [String] -> Maybe a
-
-instance CohatoeData MarkerDesc where
- marshal md = [
- fileName md, show $ lineStart md, show $ lineEnd md, message md,
- show $ charStart md, show $ charEnd md, show $ severity md
- ]
- unmarshal [] = Nothing
- unmarshal (str:_) = Just $ read str
-
@@ -1,30 +0,0 @@
--- Copyright (c) 2006-2008 by Leif Frenzel - see http://leiffrenzel.de
--- This code is made available under the terms of the Eclipse Public
--- License, version 1.0 (EPL). See http://www.eclipse.org/legal/epl-v10.html
-module Cohatoe.Data.MarkerDesc (
- MarkerDesc(..),
- Severity(..),
- unspecified,
- mkWarning
- ) where
-
-data MarkerDesc = MarkerDesc {
- fileName :: String,
- lineStart :: Int,
- lineEnd :: Int,
- message :: String,
- charStart :: Int,
- charEnd :: Int,
- severity :: Severity
-} deriving (Eq, Show, Read)
-
-data Severity = Error | Warning
- deriving (Eq, Show, Read)
-
-unspecified :: Int
-unspecified = -1
-
--- convenience function for making a warning with file name and message,
--- locations unspecified
-mkWarning :: FilePath -> String -> MarkerDesc
-mkWarning fp msg = MarkerDesc fp unspecified unspecified msg unspecified unspecified Warning
@@ -1,29 +0,0 @@
-{-# language TypeSynonymInstances, OverlappingInstances, FlexibleInstances, UndecidableInstances #-}
-
-module EclipseFP.Haskell.Core.Marshal where
-
--- | from Haskel land to Java land
-class Marshal a where
- marshal :: a -> [ String ]
-
--- | from Java land to Haskell land
-class UnMarshal a where
- unmarshal_partial :: [ String ] -> ( a , [ String ] )
-
--- | complete unmarshalling
-unmarshal css = let ( x, [] ) = unmarshal_partial css in x
-
-instance Marshal Int where
- marshal x = [ show x ]
-
-instance UnMarshal Int where
- unmarshal_partial (x : xs) = ( read x , xs )
-
-instance Marshal String where
- marshal s = [ s ]
-
-instance UnMarshal String where
- unmarshal_partial (x : xs ) = ( x, xs )
-
-
-
@@ -1,59 +0,0 @@
-module EclipseFP.Haskell.Core.Refactor.Diff where
-
-import Prelude hiding ( Either (..))
-
-import Data.Array
-import Data.List ( group )
-
-data Direction = Left | Right | Both | Stop
- deriving ( Eq, Ord, Show )
-
-edit :: Eq a => [a] -> [a] -> [ Edit a ]
-edit xs ys = let a = table xs ys
- ((0,0),(p,q)) = bounds a
- in reverse $ traverse a (p,q) ys
-
--- NOTE: quadratic cost
-table :: Eq a => [a] -> [a] -> Array (Int,Int) (Int, Direction)
-table xs ys =
- let bnd = ((0,0),(length xs, length ys))
- a = array bnd $ do
- (p,q) <- range bnd
- return ( (p,q)
- , if p == 0 || q == 0
- then ( 0, Stop )
- else maximum [ ( fst ( a!(p-1,q) ), Right )
- , ( fst ( a!(p,q-1) ), Left )
- , if xs !! (p-1) == ys !! (q-1)
- then ( 1 + fst ( a!(p-1,q-1) ), Both )
- else ( 0, Both )
- ]
- )
- in a
-
-data Edit a = Delete Int | Insert [a] | Keep Int
- deriving ( Eq, Ord, Show )
-
-traverse a (p,q) ys =
- if p == 0 then if q == 0 then [] else [ Insert ( take q ys ) ]
- else if q == 0 then [ Delete p ]
- else let ( h, d ) = a ! (p,q)
- in case d of
- Left -> Insert [ ys !! ( q - 1 ) ] : traverse a (p,q-1) ys
- Right -> Delete 1 : traverse a (p-1, q) ys
- Both -> Keep 1 : traverse a (p-1,q-1) ys
-
-
-compress :: Eq a => [ Edit a ] -> [ Edit a ]
-compress [] = []
-compress [x] = [x]
-compress (x:xs) =
- let y : ys = compress xs
- top = case (x,y) of
- ( Insert x, Insert y ) -> [ Insert (x ++ y) ]
- ( Delete a, Delete b ) -> [ Delete ( a + b) ]
- ( Keep a, Keep b ) -> [ Keep ( a + b ) ]
- _ -> [ x , y ]
- in top ++ ys
-
-test = compress $ edit "haskell" "hackathon"
@@ -1,56 +0,0 @@
-{-# language DisambiguateRecordFields #-}
-
-module EclipseFP.Haskell.Core.Refactor.Rename where
-
-import EclipseFP.Haskell.Core.Marshal
-
-import EclipseFP.Haskell.Core.Refactor.RenameInfo as I
-import EclipseFP.Haskell.Core.Refactor.ReplaceEdit
-
-import Network
-import System.IO
-
-import Prelude hiding (length )
-
-
--- We must import Cohatoe.API and implement resource so that this code
--- can be dynamically loaded as plugin.
-import Cohatoe.API
-
-resource = plugin {
- pluginMain = performRename
-}
-
-
--- TODO: Here's what we actually do when someone calls us.
-performRename :: [String] -> IO [String]
-performRename input = do
- let ri = unmarshal input
- re <- refactor ri
- return $ concat $ map marshal re
-
-refactor :: RenameInfo -> IO [ ReplaceEdit ]
-refactor ri = do
- clientCmd [ "new", I.file ri ]
- return $ return $ ReplaceEdit
- { file = I.file ri
- , offset = 5
- , length = 2
- , replacement = "bar"
- }
-
--- from HaRe/pfe_client
-clientCmd :: [String] -> IO ()
-clientCmd args = withSocketsDo $ do
- h <- connectTo "localhost" $ PortNumber 9000
- hSetBuffering h LineBuffering
- hPutStrLn stderr $ "(stderr) CLIENT SEND: "++unwords args
- putStrLn $ "(stdout) CLIENT SEND: "++unwords args
- hPutStrLn h $ unwords args
- hGetLine h -- wait for acknowledgement
- return ()
-
-
-
-
-
@@ -1,32 +0,0 @@
--- FIXME: this should be ... Refactor.Rename.Info
-
-module EclipseFP.Haskell.Core.Refactor.RenameInfo where
-
-import EclipseFP.Haskell.Core.Marshal
-import EclipseFP.Haskell.Core.SrcLoc
-
-data RenameInfo =
- RenameInfo { file :: FilePath
- , position :: SrcLoc
- , replacement :: String
- }
- deriving Show
-
-instance Marshal RenameInfo where
- marshal i = marshal ( file i )
- ++ marshal ( position i )
- ++ marshal ( replacement i )
-
-instance UnMarshal RenameInfo where
- unmarshal_partial xs0 =
- let ( f, xs1 ) = unmarshal_partial xs0
- ( p, xs2 ) = unmarshal_partial xs1
- ( r, xs3 ) = unmarshal_partial xs2
- in ( RenameInfo { file = f
- , position = p
- , replacement = r
- }
- , xs3
- )
-
-
@@ -1,32 +0,0 @@
-
-{-# language OverlappingInstances #-}
-
-module EclipseFP.Haskell.Core.Refactor.ReplaceEdit where
-
-import EclipseFP.Haskell.Core.Marshal
-
-import Prelude hiding ( length )
-import qualified Prelude
-
-data ReplaceEdit = ReplaceEdit
- { file :: FilePath
- , offset :: Int
- , length :: Int
- , replacement :: String
- }
- deriving Show
-
-instance Marshal ReplaceEdit where
- marshal r = marshal ( file r )
- ++ marshal ( offset r )
- ++ marshal ( length r )
- ++ marshal ( replacement r )
-
-instance UnMarshal ReplaceEdit where
- unmarshal_partial xs0 =
- let ( f, xs1 ) = unmarshal_partial xs0
- ( o, xs2 ) = unmarshal_partial xs1
- ( l, xs3 ) = unmarshal_partial xs2
- ( r, xs4 ) = unmarshal_partial xs3
- in ( ReplaceEdit { file = f, offset = o, length = l, replacement = r }, xs4 )
-
@@ -1,19 +0,0 @@
-module EclipseFP.Haskell.Core.SrcLoc where
-
-import EclipseFP.Haskell.Core.Marshal
-
-data SrcLoc = SrcLoc
- { line :: Int
- , column :: Int
- }
- deriving Show
-
-instance Marshal SrcLoc where
- marshal s = marshal ( line s ) ++ marshal ( column s )
-
-instance UnMarshal SrcLoc where
- unmarshal_partial xs0 =
- let ( l, xs1 ) = unmarshal_partial xs0
- ( c, xs2 ) = unmarshal_partial xs1
- in ( SrcLoc { line = l, column = c } , xs2 )
-
Oops, something went wrong.

0 comments on commit e92cbaa

Please sign in to comment.