packages feed

phoityne-vscode 0.0.3.0 → 0.0.4.0

raw patch · 7 files changed

+59/−182 lines, 7 files

Files

Changelog.md view
@@ -1,4 +1,10 @@ +20160601 phoityne-vscode-0.0.4.0++  * [Modify] スタックトレースの表示を番号から関数名に変更した。+  * [Modify] GHC-8.0.1のghciにおいて、:step結果の出力変更(Stopped in)に対応した。++ 20160515 phoityne-vscode-0.0.3.0    * [Add] tasks.jsonが存在しない場合は、作成するようにした。
README.md view
@@ -16,6 +16,14 @@  [![Demo Video1](https://sites.google.com/site/phoityne/doc_jp/demo01.gif)](https://sites.google.com/site/phoityne/doc_jp/demo01.gif?attredirects=0) ++## Important++* Breakpoint can be set in a .hs file which defineds "module ... where".+* Source file extension must be ".hs"+* When you start debugging for the first time, .vscode/tasks.json will be created automatically. Then you can use F6, F7, F8 shortcut key.++ ## Install  @@ -25,24 +33,19 @@       . . . . .     % --### Prepare vscode extensions--1. create folder "%USERPROFILE%\.vscode\extensions\phoityne-vscode"-2. copy "phoityne-vscode-0.0.#.0\vscode\package.json"(*) to "%USERPROFILE%\.vscode\extensions\phoityne-vscode"-3. copy "%USERPROFILE%\AppData\Roaming\local\bin\phoityne-vscode.exe" to "%USERPROFILE%\.vscode\extensions\phoityne-vscode"-4. Install "Haskell Syntax Highlighting" extension. Ctrl+p and put "ext install haskell syntax highlighting".--(*) download by stack unpack.+Add 'phoityne-vscode.exe' to PATH environment. -    % stack unpack phoityne-vscode+    % where $path:phoityne-vscode.exe+    C:\Users\phoityne\AppData\Roaming\local\bin\phoityne-vscode.exe+         %  -### Important+### Install vscode extensions -* breakpoint can be set in a .hs file which defineds "module ... where".-* source file extension must be ".hs"+1. ctrlr + p on Visual Studio Code+2. ext install haskell ... +3. select "[Haskell GHCi debug viewer Phoityne](https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode)"   ## Key Bindings@@ -52,4 +55,3 @@ * Shift + F6 : stop stack watch * F7 : stack clean & build * F8 : stack test-
app/Phoityne/Argument.hs view
@@ -13,6 +13,9 @@ import System.Console.CmdArgs import qualified Control.Exception as E +import Paths_phoityne_vscode (version)+import Data.Version (showVersion)+ -- | --  ヘルプ表示時の例外 --@@ -25,92 +28,33 @@ --  コマンドライン引数データ設定 --    モードを使用する場合のサンプル ---data ArgData = ModeA-             {-               file   :: String-             , method :: Method-             }-             | ModeB-             {-               file  :: String-             , value :: Int-             } deriving (Data, Typeable, Show, Read, Eq)+data ArgData = ModeA deriving (Data, Typeable, Show, Read, Eq)  -- | --  アノテーション設定 -- config :: ArgData-config = modes [confA, confB]+config = modes [confA]          &= summary sumMsg-         &= program "prj-tpl"+         &= program "phoityne-vscode"             where     confA = ModeA {-            file = def-             &= name "f"-             &= name "file"-             &= explicit-             &= typFile-             &= help "ini file"-          , method = enum-                   [-                     Get-                       &= name "get"-                       &= explicit-                       &= help "method type Get"-                   , Post-                       &= name "post"-                       &= explicit-                       &= help "  | type Post"-                   , Put-                       &= name "put"-                       &= explicit-                       &= help "  | type Put"-                   , Delete-                       &= name "delete"-                       &= explicit-                       &= help "  | type Delete"-                   ]+           } &= name "ModeA"             &= details mdAMsg             &= auto-    confB = ModeB {-            file = def-             &= name "f"-             &= name "file"-             &= explicit-             &= typFile-             &= help "ini file"-          , value = def-             &= name "value"-             &= explicit-             &= help "integer value"-          } &= name "ModeB"-            &= details mdBMsg      sumMsg = unlines [-             ""-           , "  ☆ サマリ説明 ☆"-           , ""-           , "     ここに簡単な説明を記載する。"-           , ""+             "phoityne-vscode-" ++ showVersion version            ]                 mdAMsg = [              ""-           , "  ★ 詳細説明 ★"-           , ""-           , "     ここにModeAの詳細な説明を記載する。"+           , "Phoityne is a ghci debug viewer for Visual Studio Code. "            , ""            ] -    mdBMsg = [-             ""-           , "  ★ 詳細説明 ★"-           , ""-           , "     ここにModeBの詳細な説明を記載する。"-           , ""-           ]  -- | --  enum値引数
app/Phoityne/IO/GUI/Control.hs view
@@ -226,30 +226,40 @@   , "  // atuomatically created by phoityne-vscode"   , "  "   , "  \"version\": \"0.1.0\","-  , "  \"command\": \"cmd\","   , "  \"isShellCommand\": true,"   , "  \"showOutput\": \"always\","   , "  \"suppressTaskName\": true,"-  , "  \"args\": [\"/c\"],"+  , "  \"windows\": {"+  , "    \"command\": \"cmd\","+  , "    \"args\": [\"/c\"]"+  , "  },"+  , "  \"linux\": {"+  , "    \"command\": \"sh\","+  , "    \"args\": [\"-c\"]"+  , "  },"+  , "  \"osx\": {"+  , "    \"command\": \"sh\","+  , "    \"args\": [\"-c\"]"+  , "  },"   , "  \"tasks\": ["   , "    {"   , "       \"taskName\": \"stack build\","-  , "       \"args\": [ \"echo START_STACK_BUILD & cd ${workspaceRoot} & stack build & echo END_STACK_BUILD \" ]"+  , "       \"args\": [ \"echo START_STACK_BUILD && cd ${workspaceRoot} && stack build && echo END_STACK_BUILD \" ]"   , "    },"   , "    { "   , "       \"isBuildCommand\": true,"   , "       \"taskName\": \"stack clean & build\","-  , "       \"args\": [ \"echo START_STACK_CLEAN_AND_BUILD & cd ${workspaceRoot} & stack clean & stack build & echo END_STACK_CLEAN_AND_BUILD \" ]"+  , "       \"args\": [ \"echo START_STACK_CLEAN_AND_BUILD && cd ${workspaceRoot} && stack clean && stack build && echo END_STACK_CLEAN_AND_BUILD \" ]"   , "    },"   , "    { "   , "       \"isTestCommand\": true,"   , "       \"taskName\": \"stack test\","-  , "       \"args\": [ \"echo START_STACK_TEST & cd ${workspaceRoot} & stack test & echo END_STACK_TEST \" ]"+  , "       \"args\": [ \"echo START_STACK_TEST && cd ${workspaceRoot} && stack test && echo END_STACK_TEST \" ]"   , "    },"   , "    { "   , "       \"isWatching\": true,"   , "       \"taskName\": \"stack watch\","-  , "       \"args\": [ \"echo START_STACK_WATCH & cd ${workspaceRoot} & stack build --file-watch & echo END_STACK_WATCH \" ]"+  , "       \"args\": [ \"echo START_STACK_WATCH && cd ${workspaceRoot} && stack build --file-watch && echo END_STACK_WATCH \" ]"   , "    }"   , "  ]"   , "}"@@ -850,7 +860,7 @@     createStackFrames (HighlightTextRangeData file sl sc _ _) = do       ctx <- readMVar mvarCtx       let cwd = workspaceDebugContext ctx-          csf = J.StackFrame 0 "0" (J.Source (Just (src2mod cwd file)) file Nothing Nothing) sl sc+          csf = J.StackFrame 0 "[BP]" (J.Source (Just (src2mod cwd file)) file Nothing Nothing) sl sc        let getResult = readDebugCommandData cmdData           history   = traceHistDebugCommandData cmdData@@ -869,13 +879,13 @@          Right dats -> foldM (convTrace2Frame cwd) [csf] dats -    convTrace2Frame cwd xs (TraceData traceId _ filePath) = case parse parseHighlightTextRange "getActivatePosFromLine" filePath of+    convTrace2Frame cwd xs (TraceData traceId funcName filePath) = case parse parseHighlightTextRange "getActivatePosFromLine" filePath of       Left err -> do         errorM _LOG_NAME $ show err         putStrLnStderr mvarCtx $ show err         return xs       Right (HighlightTextRangeData file sl sc _ _) -> return $ -        J.StackFrame (read traceId) traceId (J.Source (Just (src2mod cwd file)) file Nothing Nothing) sl sc : xs+        J.StackFrame (read traceId) funcName (J.Source (Just (src2mod cwd file)) file Nothing Nothing) sl sc : xs  -- | --@@ -1629,10 +1639,15 @@ getStoppedTextRangeData :: String -> Either ParseError HighlightTextRangeData getStoppedTextRangeData = parse parser "getStoppedTextRangeData"   where-    parser = do+    parser = try parse7 <|> try parse8+    parse7 = do       _ <- manyTill anyChar (try (string "Stopped at "))       parseHighlightTextRange +    parse8 = do+      _ <- manyTill anyChar (try (string "Stopped in "))+      _ <- manyTill anyChar (try (string ", "))+      parseHighlightTextRange  -- | --
app/Phoityne/IO/Main.hs view
@@ -59,10 +59,8 @@ --  loadIniFile :: A.ArgData          -- コマンドライン引数             -> IO C.ConfigParser  -- INI設定-loadIniFile args = do-  cp <- if null (A.file args) then return $ forceEither $ C.readstring C.emptyCP defaultIniSetting-          else forceEither <$> C.readfile C.emptyCP (A.file args)-+loadIniFile _ = do+  let cp = forceEither $ C.readstring C.emptyCP defaultIniSetting   return cp{ C.accessfunc = C.interpolatingAccess 5 }  
phoityne-vscode.cabal view
@@ -1,5 +1,5 @@ name:                phoityne-vscode-version:             0.0.3.0+version:             0.0.4.0 synopsis:            ghci debug viewer on Visual Studio Code description:         Please see README.md license:             BSD3@@ -13,7 +13,6 @@ cabal-version:       >=1.10 extra-source-files:  README.md                    , Changelog.md-data-files:          vscode/package.json  executable phoityne-vscode   ghc-options:         -threaded -rtsopts -with-rtsopts=-N -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing
− vscode/package.json
@@ -1,87 +0,0 @@-{-	"name":        "phoityne-vscode",-	"displayName": "Haskell GHCi debug viewer Phoityne",-	"version":     "0.0.1",-	"publisher":   "phoityne.hs",-	"description": "ghci debug viewer Phoityne, on Visual Studio Code.",-	"categories":  ["Debuggers"],-	"author":      {"name": "phoityne.hs"},-	"license": "BSD3",-	"private": false,-	"engines": {"vscode": "^1.0.0"},-	"dependencies": {},-	"contributes": {-		"keybindings": [-			{-				"key": "f6",-				"command": "workbench.action.tasks.runTask",-				"when": "!inDebugMode"-			},-			{-				"key": "shift+f6",-				"command": "workbench.action.tasks.terminate",-				"when": "!inDebugMode"-			},-			{-				"key": "f7",-				"command": "workbench.action.tasks.build",-				"when": "!inDebugMode"-			},-			{-				"key": "f8",-				"command": "workbench.action.tasks.test",-				"when": "!inDebugMode"-			}-		],-		"debuggers": [{-			"type": "ghc",-			"label": "ghci debug viewer Phoityne",-			"enableBreakpointsFor": { "languageIds": ["haskell"] },-			"program": "phoityne-vscode.exe",-			"configurationAttributes": {-				"launch": {-					"required": ["program"],-					"properties": {-						"workspace": {-							"type"       : "string",-							"description": "Absolute path to the workspace.",-							"default"    : "${workspaceRoot}"-						},-						"startup": {-							"type": "string",-							"description": "Absolute path to the startup program.",-							"default": "${workspaceRoot}/test/Spec.hs"-						},-						"logFile": {-							"type": "string",-							"description": "Absolute path to the log file.",-							"default": "${workspaceRoot}/.vscode/phoityne.log"-						},-						"logLevel": {-							"type": "string",-							"description": "logging level.",-							"default": "WARNING"-						},-						"ghciPrompt": {-							"type": "string",-							"description": "ghci prompt string.",-							"default": "Phoityne>>= "-						}-					}-				}-			},-			"initialConfigurations": [-				{-					"type": "ghc",-					"name": "ghci debug viewer Phoityne",-					"request": "launch",-					"workspace": "${workspaceRoot}",-					"startup": "${workspaceRoot}/test/Spec.hs",-					"logFile": "${workspaceRoot}/.vscode/phoityne.log",-					"logLevel": "WARNING",-					"ghciPrompt": "H>>= "-				}-			]-		}]-	}-}