From 3b093270859c43f2df217b7ace0b88379d09ec3a Mon Sep 17 00:00:00 2001 From: Christoffer Gustafsson Date: Wed, 8 Aug 2018 11:49:05 -0700 Subject: [PATCH 1/2] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 82678561f1bdec220d4a3f64bfe74969a4f5a542 Merge: 7d3a1800 13e6f164 Author: Christoffer Gustafsson Date: Tue Jul 3 11:52:14 2018 -0700 Merge after rebasing the service branch against development branch. commit 7d3a180005e2ea3db415618282b8fe4dba67d900 Author: Christoffer Gustafsson Date: Tue Jul 3 11:48:45 2018 -0700 Updated lsp to handle new changes in the encore project. commit 3eb01c02db6d4406ab9c23d12a222e8e706aa299 Author: Christoffer Gustafsson Date: Tue Jul 3 08:56:50 2018 -0700 Wrote a readme file for the vscode client. commit e137540c3b20237df2f1a6937735216bfead13d1 Author: Christoffer Gustafsson Date: Tue Jul 3 08:43:11 2018 -0700 Reverted commit that fixed a compile problem with gcc6 and later. commit ebfd5f111e4fe98ba7ce210496cc2db82cbb5733 Author: Christoffer Gustafsson Date: Tue Jul 3 08:17:28 2018 -0700 Added files required to make the vscode client work properly. commit ca9466f80c5cd73d51314dbe71f99fbe047d4913 Author: Christoffer Gustafsson Date: Tue Jul 3 07:36:52 2018 -0700 Added vscode client to the project. Also removed test folder. commit 1165c6cbc76382abdae9e51c68d41ec07ec0ada7 Author: Christoffer Gustafsson Date: Tue Jul 3 07:27:26 2018 -0700 Removed experimental code. commit dfbecf8ae72bf86b52019522e3a1c159147a1d1a Author: Christoffer Gustafsson Date: Wed May 16 08:37:22 2018 -0700 Commented out experimental code in program.hs. commit 24e3f7cee54e1bf1127398209189081f3f4d9ed7 Author: Christoffer Gustafsson Date: Wed May 16 02:35:50 2018 -0700 Fixed bug with binop's hover behaviour. commit e474885f2b294e3221d6b06e3a8cd63cd1d77b39 Author: Andreas Olofsson Date: Thu May 10 20:02:17 2018 +0200 Removed debug messages commit 17551d67d297a82bc28da9be84dcf9fd3e18d48e Author: Andreas Olofsson Date: Thu May 10 19:52:27 2018 +0200 Removed debug traces + added lsp safety check commit 2eb828b9436e79745d0c05248cc55aede61a9e87 Author: Christoffer Gustafsson Date: Wed May 9 07:52:28 2018 -0700 Improved hover functionallity for methodCall, functionCall and messageSend. commit a745e0a5117f20be916e05b971ac555b20d3c6a5 Author: Christoffer Gustafsson Date: Wed May 9 05:11:30 2018 -0700 Implemented more of hover feature. Also added fix for compiling with gcc 7.x commit 1b0f61fdaf82e724367ee9cf2b286472e757df71 Author: Christoffer Gustafsson Date: Tue May 8 09:50:39 2018 -0700 Better support for the LSP feature hover. commit 8424d522607448a56ec9df85508cf4f7b6cc8093 Author: Andreas Olofsson Date: Thu May 3 14:50:41 2018 +0200 Added diagnostics on 'didOpen' + ignored notifications. commit a17a64d38c73854150d2bfd620c2bf964ffd761a Author: Andreas Olofsson Date: Thu May 3 13:17:52 2018 +0200 Fixed error position bug. commit 53a8d25885d638b499abd550d1fb9a2c0e4c4be2 Author: Christoffer Gustafsson Date: Thu May 3 00:38:33 2018 -0700 Hover now works on var assignments, ex. var x = 1 will say x :: Int. commit 97d59d2e05b7b8d7d44c0573523d9960d9f04bc7 Author: Alfret Date: Wed May 2 15:35:33 2018 +0200 Fixed a really small issue in Program.hs commit 6890d114b3e9b56d2d60494412a714f5803d6907 Author: Christoffer Gustafsson Date: Thu Apr 26 20:48:36 2018 +0200 Fixed bug with ranges not being calulcated in the right way. Improved the producer to handle errors in a better way. commit a16af175c7ba160a059d4963e2a6cfaa9ccb8826 Author: Christoffer Gustafsson Date: Wed Apr 25 22:48:51 2018 +0200 Added feature to State.hs. commit 6b82815e47f1fdffdf9a1de3a651950ab6eeea01 Author: Andreas Olofsson Date: Wed Apr 25 19:02:58 2018 +0200 Added diagnostics. commit 0478f2cef5b44be9ed6eb6c44dba4b5f17f03c19 Author: Andreas Olofsson Date: Wed Apr 25 18:22:37 2018 +0200 Fixed textDocument/didClose + namespace cleanup. commit a04ce2e681635ef4a9ac4f75dbc6a71fdad1166d Author: Andreas Olofsson Date: Wed Apr 25 17:45:05 2018 +0200 Fixed side-effects in LSP. commit 5c05118f0ee1f27551d7b0caadc4c7099c976e12 Author: Andreas Olofsson Date: Wed Apr 25 16:37:52 2018 +0200 Added program compilation from LSP + hover. commit 0706f71a5066994e4a3c8c83d5c1c15602cefac1 Author: Andreas Olofsson Date: Wed Apr 25 14:29:15 2018 +0200 Added StateM type, allows lazy state with IO. commit aa7866fed662ac3225ca107d1c24fb07f32991db Author: Valter Gådin Date: Wed Apr 25 14:25:51 2018 +0200 Funkar med ändringar för Hover commit 333a3188e536216074834b55eb97c44c2ad62708 Author: Andreas Olofsson Date: Tue Apr 24 22:20:56 2018 +0200 Made LSP request handler use IO commit 2987279a1d2c5242ac9f06aa9c0e495ee9b7925c Author: Alfret Date: Tue Apr 24 18:44:05 2018 +0200 Updated ProgramInfo to contain range position commit 5a2d2a3a45bee953df1851a08f3e3cbfed3f01d6 Author: Alfret Date: Mon Apr 23 17:30:19 2018 +0200 Fixed getProgramInfo getProgramInfo is no longer in the IO monad and the results are so far correct for function calls and message sends. commit 9236ba91da98efd074e64fa0aa4a3401938091f6 Author: Alfret Date: Fri Apr 20 14:37:41 2018 +0200 Updated the program information retriever commit 58920a18ffaa91fe04da7df4d5a7d644108415a8 Author: Alfret Date: Thu Apr 19 18:41:54 2018 +0200 Program information lookup Added: functions for finding information about a location in the source document Fixed: Some problems with the producer commit 438be943205bcb97eccaf81159ce1b3e3056d87e Author: Christoffer Gustafsson Date: Thu Apr 19 17:37:18 2018 +0200 Added new encore file to aid testing. commit 05ad2167dfab08e662ac0404c7e31614ee00e5c3 Author: Christoffer Gustafsson Date: Thu Apr 19 15:14:13 2018 +0200 Implementing functions to extract data from the LSP data structure, will be used in the LSP program. commit 15741165a28282e5177c980fed98ad577c6d3f56 Author: Christoffer Gustafsson Date: Thu Apr 19 12:04:10 2018 +0200 Fixed bug with convertFromProgram where it only converted to empty programs. commit 57f56dfc03abf0539802ad44fe628ccc5840165f Author: Christoffer Gustafsson Date: Thu Apr 19 11:38:35 2018 +0200 LSP representation of the data improved. Fixed problem with encore adding ./ to the file names. commit cdbe96ccc1ffb7ef4213e4b5b93f72ab19e6ec17 Author: Christoffer Gustafsson Date: Wed Apr 18 16:04:12 2018 +0200 Made changes to enable compilation while completing the merge of ls-back and service. commit 2bacd80c03a4d3655ba2532fbe1f07eb95f78a00 Author: Christoffer Gustafsson Date: Wed Apr 18 13:40:46 2018 +0200 Continouation of merge between ls-back and service. commit 10897ab261e130864b8d96239753f681cb1fa6b3 Author: Christoffer Gustafsson Date: Tue Apr 17 20:23:06 2018 +0200 Merging two different database structures into one. Mainly adding the error data type. commit 0f568c2e1972dadb20fefccf181937ce46d173cb Author: Alfret Date: Mon Apr 16 18:24:07 2018 +0200 Minor additions and fixes to the server database commit 35aa10afbffacfc7d327892e80609b73603bf924 Author: Christoffer Gustafsson Date: Mon Apr 16 17:54:33 2018 +0200 Parsing file from stdin instead of hard coded file. commit faba2e9d551d36e57de3f98971c5f15d37455230 Author: Andreas Olofsson Date: Mon Apr 16 17:38:24 2018 +0200 Added store + support for textDocument updates commit 4bae0f61e2148a57d8369a09e8426ab7e83d0dcd Author: Alfret Date: Mon Apr 16 16:34:51 2018 +0200 Added support for errors in the LSP that supports conversion from some of the standard error types in Encore (TCError and megaparsec error). Also added position determination commit d91b08457b681040efb5b365443d95eafef5b15a Author: Alfret Date: Mon Apr 16 14:17:46 2018 +0200 Updated LSP code parsing. Errors and warnings are now collected from all compilation units and stored in the program database with the actual programs. commit 8b6eb55881f56360b9ee8dd7662d20fc5ef9d45d Author: Andreas Olofsson Date: Wed Apr 11 00:20:54 2018 +0200 Changed cmd-line options to start LSP-server + added port&host options. commit 21d020169fe685e934fe1424147740e1d345199e Author: Andreas Olofsson Date: Tue Apr 10 19:44:00 2018 +0200 Created a basic LSP server src/lsp/Base.hs Handles the HTTP-like base layer of LSP src/lsp/JSONRPC.hs Handles the JSONRPC layer src/lsp/LSP.hs Starts the LSP server and currently just sends dummy responses aeson, network & bytestring have been added to 'encore.cabal' as dependencies commit 386035585799f3fc19c972f9c5839c9d34a80b3f Author: Alfret Date: Tue Apr 10 19:22:36 2018 +0200 Added service base Added: Initial code for the compiler service Added: Copied the program-table producing code into our own file Update: Added the src/lsp directory to the cabal file commit 9341c488b2f22e50e041084e048fc3ceee3203db Author: Christoffer Gustafsson Date: Tue Jul 3 07:36:52 2018 -0700 Added vscode client to the project. Also removed test folder. commit 30284265b3ec1b0ee9f6d1d9d7f65c0630b9f402 Author: Christoffer Gustafsson Date: Tue Jul 3 07:27:26 2018 -0700 Removed experimental code. commit 28ad92f5f949c7fe933db90216629d8aeaff1570 Author: Christoffer Gustafsson Date: Wed May 16 08:37:22 2018 -0700 Commented out experimental code in program.hs. commit 6d921b0bdf83ca1078e5b8e9d8042ca91d8238fc Author: Christoffer Gustafsson Date: Wed May 16 02:35:50 2018 -0700 Fixed bug with binop's hover behaviour. commit f566773fa11568f91fd81c4c40647fbb75ea7918 Author: Andreas Olofsson Date: Thu May 10 20:02:17 2018 +0200 Removed debug messages commit b9c8be4a591d7a6ae170571e7478bb012ecb54c9 Author: Andreas Olofsson Date: Thu May 10 19:52:27 2018 +0200 Removed debug traces + added lsp safety check commit 6b93f41fb1f80d579587b130e5ec9f7c466ad25f Author: Christoffer Gustafsson Date: Wed May 9 07:52:28 2018 -0700 Improved hover functionallity for methodCall, functionCall and messageSend. commit 66cdec05693dfbce357cb51eeed1b188c5d63bde Author: Christoffer Gustafsson Date: Wed May 9 05:11:30 2018 -0700 Implemented more of hover feature. Also added fix for compiling with gcc 7.x commit 398bfaf1940a1e1ba737bc314e3dde804233dbbf Author: Christoffer Gustafsson Date: Tue May 8 09:50:39 2018 -0700 Better support for the LSP feature hover. commit c9ae5eec12787ec8478f6a06a400d778958e7d56 Author: Andreas Olofsson Date: Thu May 3 14:50:41 2018 +0200 Added diagnostics on 'didOpen' + ignored notifications. commit ca289e3ff79bff387edc61cfb15a4d25c7711345 Author: Andreas Olofsson Date: Thu May 3 13:17:52 2018 +0200 Fixed error position bug. commit 7691ecbcb64421c394a6d2e8516afe6f7d34f656 Author: Christoffer Gustafsson Date: Thu May 3 00:38:33 2018 -0700 Hover now works on var assignments, ex. var x = 1 will say x :: Int. commit e72973f5808f6ac8aa69e60831ce33196acc7e6f Author: Alfret Date: Wed May 2 15:35:33 2018 +0200 Fixed a really small issue in Program.hs commit 4048936cb2350284a2b150bafb389d69554c56f1 Author: Christoffer Gustafsson Date: Thu Apr 26 20:48:36 2018 +0200 Fixed bug with ranges not being calulcated in the right way. Improved the producer to handle errors in a better way. commit a942349094c08f5769ea60909e8bc521bb37c470 Author: Christoffer Gustafsson Date: Wed Apr 25 22:48:51 2018 +0200 Added feature to State.hs. commit bfcd75d7b9de3bd0f61c0443c7b0695c7433e27a Author: Andreas Olofsson Date: Wed Apr 25 19:02:58 2018 +0200 Added diagnostics. commit 9db404bae292ec07e5724d02187b64f253400732 Author: Andreas Olofsson Date: Wed Apr 25 18:22:37 2018 +0200 Fixed textDocument/didClose + namespace cleanup. commit 169d3b1655a47c77b8c13c296b43c01780ddbcb2 Author: Andreas Olofsson Date: Wed Apr 25 17:45:05 2018 +0200 Fixed side-effects in LSP. commit 5f962ee320c9d2c9d71a490cad6d9a5e3ef2a605 Author: Andreas Olofsson Date: Wed Apr 25 16:37:52 2018 +0200 Added program compilation from LSP + hover. commit 24a23d0e11b08df72ccfc042e911d59074c179b8 Author: Andreas Olofsson Date: Wed Apr 25 14:29:15 2018 +0200 Added StateM type, allows lazy state with IO. commit fcfab467a31bd12426da9e8915e2da2a523f6ab7 Author: Valter Gådin Date: Wed Apr 25 14:25:51 2018 +0200 Funkar med ändringar för Hover commit b3b2b3e64840f521d6fc0e5617bd1f061f381649 Author: Andreas Olofsson Date: Tue Apr 24 22:20:56 2018 +0200 Made LSP request handler use IO commit ff2b78c2c44d94cf528a1cc77302f4048fbad960 Author: Alfret Date: Tue Apr 24 18:44:05 2018 +0200 Updated ProgramInfo to contain range position commit 480d397793bf84462908e902d91e519eb630ab50 Author: Alfret Date: Mon Apr 23 17:30:19 2018 +0200 Fixed getProgramInfo getProgramInfo is no longer in the IO monad and the results are so far correct for function calls and message sends. commit a489d695c4cb1926680552edc0358fb4116de86a Author: Alfret Date: Fri Apr 20 14:37:41 2018 +0200 Updated the program information retriever commit 813a956781188a9dd023ac30c145ec372965f2b3 Author: Alfret Date: Thu Apr 19 18:41:54 2018 +0200 Program information lookup Added: functions for finding information about a location in the source document Fixed: Some problems with the producer commit 5dc025dd144d2211a6116c9f3e65a08925c2ba39 Author: Christoffer Gustafsson Date: Thu Apr 19 17:37:18 2018 +0200 Added new encore file to aid testing. commit 1a10f05f5d5b59fea55b6e58fdf6696e06c6737c Author: Christoffer Gustafsson Date: Thu Apr 19 15:14:13 2018 +0200 Implementing functions to extract data from the LSP data structure, will be used in the LSP program. commit ea455cf5bb8f575a251828a50a9cd91a602d0d43 Author: Christoffer Gustafsson Date: Thu Apr 19 12:04:10 2018 +0200 Fixed bug with convertFromProgram where it only converted to empty programs. commit ba35b2ca5bb08db9fa3fa5646b77fd806b1b5d20 Author: Christoffer Gustafsson Date: Thu Apr 19 11:38:35 2018 +0200 LSP representation of the data improved. Fixed problem with encore adding ./ to the file names. commit 9073d9504b4ef7170217bc3fb286103633112012 Author: Christoffer Gustafsson Date: Wed Apr 18 16:04:12 2018 +0200 Made changes to enable compilation while completing the merge of ls-back and service. commit 1e1c0df1c7b896d7d6c55e4d34fcc351f1547510 Author: Christoffer Gustafsson Date: Wed Apr 18 13:40:46 2018 +0200 Continouation of merge between ls-back and service. commit 15feac76d8b924a7a1e8e914c1c40338d5e1d377 Author: Christoffer Gustafsson Date: Tue Apr 17 20:23:06 2018 +0200 Merging two different database structures into one. Mainly adding the error data type. commit ccfd16b0987fce119384336dde5c6dea55d1a9db Author: Alfret Date: Mon Apr 16 18:24:07 2018 +0200 Minor additions and fixes to the server database commit 0372421fec196e8c79727f63cf68cc06560167b7 Author: Christoffer Gustafsson Date: Mon Apr 16 17:54:33 2018 +0200 Parsing file from stdin instead of hard coded file. commit 35c40b2c83191281bf952b3a3836951fc0a2ecf6 Author: Andreas Olofsson Date: Mon Apr 16 17:38:24 2018 +0200 Added store + support for textDocument updates commit daeef735b52f17f9de49f8f3ef1db1ae394898d8 Author: Alfret Date: Mon Apr 16 16:34:51 2018 +0200 Added support for errors in the LSP that supports conversion from some of the standard error types in Encore (TCError and megaparsec error). Also added position determination commit 5c9936fe0c9e765e4c1b6da595e7bb5b2b1e7963 Author: Alfret Date: Mon Apr 16 14:17:46 2018 +0200 Updated LSP code parsing. Errors and warnings are now collected from all compilation units and stored in the program database with the actual programs. commit 5d5c752f7f972b30b68aa04b7eead3dd8a0629c2 Author: Andreas Olofsson Date: Wed Apr 11 00:20:54 2018 +0200 Changed cmd-line options to start LSP-server + added port&host options. commit af51aef02cc982a8bdfaacf1b623cf187df9f803 Author: Andreas Olofsson Date: Tue Apr 10 19:44:00 2018 +0200 Created a basic LSP server src/lsp/Base.hs Handles the HTTP-like base layer of LSP src/lsp/JSONRPC.hs Handles the JSONRPC layer src/lsp/LSP.hs Starts the LSP server and currently just sends dummy responses aeson, network & bytestring have been added to 'encore.cabal' as dependencies commit 8dd9d987f1b6d3607c40cf82f7a2893ed6653ff4 Author: Alfret Date: Tue Apr 10 19:22:36 2018 +0200 Added service base Added: Initial code for the compiler service Added: Copied the program-table producing code into our own file Update: Added the src/lsp directory to the cabal file commit 13e6f16430a3d2f0111a4dc160f03565da797b24 Author: Christoffer Gustafsson Date: Tue Jul 3 08:56:50 2018 -0700 Wrote a readme file for the vscode client. commit 17f020579f2693c05f004d1f66d9c3c6b5843024 Author: Christoffer Gustafsson Date: Tue Jul 3 08:43:11 2018 -0700 Reverted commit that fixed a compile problem with gcc6 and later. commit a8c88e2d291a2c2cefd59650b8a127f496461c83 Merge: ca5884a5 3d1f9bc1 Author: Christoffer Gustafsson Date: Tue Jul 3 08:25:06 2018 -0700 Rebased project against development branch. commit ca5884a53691dc8d1816d3ff8bbfa59f467c0b3f Author: Christoffer Gustafsson Date: Tue Jul 3 08:17:28 2018 -0700 Added files required to make the vscode client work properly. commit ca9ba0ce39b24973c13c685096a84f894746ab84 Author: Christoffer Gustafsson Date: Tue Jul 3 07:36:52 2018 -0700 Added vscode client to the project. Also removed test folder. commit a919ffeab2b1c112ef11fdc076419cf16a1d1502 Author: Christoffer Gustafsson Date: Tue Jul 3 07:27:26 2018 -0700 Removed experimental code. commit 3cf433ab1a492eed02c222069da778c3471c2657 Author: Christoffer Gustafsson Date: Wed May 16 08:37:22 2018 -0700 Commented out experimental code in program.hs. commit 78c6325295391aba6accd4da5976459ea3e0b897 Author: Christoffer Gustafsson Date: Wed May 16 02:35:50 2018 -0700 Fixed bug with binop's hover behaviour. commit 303e3cad2a29699125480eb5a3d684b7a1eac096 Author: Andreas Olofsson Date: Thu May 10 20:02:17 2018 +0200 Removed debug messages commit ab5d61764505b0cbae8699ac093ea00bdade9f4c Author: Andreas Olofsson Date: Thu May 10 19:52:27 2018 +0200 Removed debug traces + added lsp safety check commit b7a9177adf26c0d02c7338bd4e28e16caf7f556f Author: Christoffer Gustafsson Date: Wed May 9 07:52:28 2018 -0700 Improved hover functionallity for methodCall, functionCall and messageSend. commit cf68db28f11c45e24640f9564892568fb940e69f Author: Christoffer Gustafsson Date: Wed May 9 05:11:30 2018 -0700 Implemented more of hover feature. Also added fix for compiling with gcc 7.x commit 2d520088cf10569efe9a0133c9855779f3859c93 Author: Christoffer Gustafsson Date: Tue May 8 09:50:39 2018 -0700 Better support for the LSP feature hover. commit b6a5141b9803794c5ad9f8619ff543d60f740a5f Author: Andreas Olofsson Date: Thu May 3 14:50:41 2018 +0200 Added diagnostics on 'didOpen' + ignored notifications. commit f79520a5e24bfbf15354f39d6be7dd5c08554e2e Author: Andreas Olofsson Date: Thu May 3 13:17:52 2018 +0200 Fixed error position bug. commit 1c2e988cb27529a3e941223b80870d83be3ec3c9 Author: Christoffer Gustafsson Date: Thu May 3 00:38:33 2018 -0700 Hover now works on var assignments, ex. var x = 1 will say x :: Int. commit b89183bcd126eecda01fc35b0d6f06ddd48cc632 Author: Alfret Date: Wed May 2 15:35:33 2018 +0200 Fixed a really small issue in Program.hs commit 06e0d1a473abd174a91fe5b957ed1f11b538bd54 Author: Christoffer Gustafsson Date: Thu Apr 26 20:48:36 2018 +0200 Fixed bug with ranges not being calulcated in the right way. Improved the producer to handle errors in a better way. commit 2fc16c2dea00676282f27ead9939b0c40e874085 Author: Christoffer Gustafsson Date: Wed Apr 25 22:48:51 2018 +0200 Added feature to State.hs. commit 1416c125a5c448fe5c662a42442b0570d6b9f889 Author: Andreas Olofsson Date: Wed Apr 25 19:02:58 2018 +0200 Added diagnostics. commit 7d00ee62701a8e63752effc2135e1f407f9f7b44 Author: Andreas Olofsson Date: Wed Apr 25 18:22:37 2018 +0200 Fixed textDocument/didClose + namespace cleanup. commit a794de1af46daea64cac7f54465935b34316dc80 Author: Andreas Olofsson Date: Wed Apr 25 17:45:05 2018 +0200 Fixed side-effects in LSP. commit 6dd36975b6dd562963f42f89a35aa58038dbf7a6 Author: Andreas Olofsson Date: Wed Apr 25 16:37:52 2018 +0200 Added program compilation from LSP + hover. commit 7bffe84cb5b447363f9abfea34cbdcbbed0cc1c9 Author: Andreas Olofsson Date: Wed Apr 25 14:29:15 2018 +0200 Added StateM type, allows lazy state with IO. commit 84de04304844dedfbdea01fc8e8fc5f622f5f0a5 Author: Valter Gådin Date: Wed Apr 25 14:25:51 2018 +0200 Funkar med ändringar för Hover commit 7dc5503c296784210b28f92e8822052bbffcd792 Author: Andreas Olofsson Date: Tue Apr 24 22:20:56 2018 +0200 Made LSP request handler use IO commit 95c21222606e9156d28b20a52f4ab764fd5a0533 Author: Alfret Date: Tue Apr 24 18:44:05 2018 +0200 Updated ProgramInfo to contain range position commit 091872071adbd3456ef28a2e25fd58452479b594 Author: Alfret Date: Mon Apr 23 17:30:19 2018 +0200 Fixed getProgramInfo getProgramInfo is no longer in the IO monad and the results are so far correct for function calls and message sends. commit 5270ed66ec6829aa3366ace9fd8118d6279c1d1b Author: Alfret Date: Fri Apr 20 14:37:41 2018 +0200 Updated the program information retriever commit 24906c7d594e8f749ba1039f2eedc7f3b3f685bd Author: Alfret Date: Thu Apr 19 18:41:54 2018 +0200 Program information lookup Added: functions for finding information about a location in the source document Fixed: Some problems with the producer commit f499f46344d2c24afedf416a390c4351c33de2e5 Author: Christoffer Gustafsson Date: Thu Apr 19 17:37:18 2018 +0200 Added new encore file to aid testing. commit 2e6a2a875557bcc1f04e4502acb32db1198c12a2 Author: Christoffer Gustafsson Date: Thu Apr 19 15:14:13 2018 +0200 Implementing functions to extract data from the LSP data structure, will be used in the LSP program. commit 827b632737a246523ae8e29fb2ba1039ac91ef2f Author: Christoffer Gustafsson Date: Thu Apr 19 12:04:10 2018 +0200 Fixed bug with convertFromProgram where it only converted to empty programs. commit 0c120c666685fb9a959128a51d9bba7e6c315154 Author: Christoffer Gustafsson Date: Thu Apr 19 11:38:35 2018 +0200 LSP representation of the data improved. Fixed problem with encore adding ./ to the file names. commit 112b1c6accff52a0e01035cfd40f5eb4a91983b2 Author: Christoffer Gustafsson Date: Wed Apr 18 16:04:12 2018 +0200 Made changes to enable compilation while completing the merge of ls-back and service. commit 2b140e27baccd7ddcd5e69152593bbc9d8f7ec7d Author: Christoffer Gustafsson Date: Wed Apr 18 13:40:46 2018 +0200 Continouation of merge between ls-back and service. commit 889843399fc9bbc2f99b0f75a10a37789b503a64 Author: Christoffer Gustafsson Date: Tue Apr 17 20:23:06 2018 +0200 Merging two different database structures into one. Mainly adding the error data type. commit 9506141a661b052cf3471c9b2fbb8a6d8d2d48dc Author: Alfret Date: Mon Apr 16 18:24:07 2018 +0200 Minor additions and fixes to the server database commit 70e1b018cbe8afbb7536f8f335061dbbc6c5e6a1 Author: Christoffer Gustafsson Date: Mon Apr 16 17:54:33 2018 +0200 Parsing file from stdin instead of hard coded file. commit f17de239fd4724d4d70bf9c9e1df9342b997b132 Author: Andreas Olofsson Date: Mon Apr 16 17:38:24 2018 +0200 Added store + support for textDocument updates commit 4843ad7ae35d364569dc61d554cfd0925af94d29 Author: Alfret Date: Mon Apr 16 16:34:51 2018 +0200 Added support for errors in the LSP that supports conversion from some of the standard error types in Encore (TCError and megaparsec error). Also added position determination commit 0ac89fcf76fb06a4ef6bddfe9732630fb5767e33 Author: Alfret Date: Mon Apr 16 14:17:46 2018 +0200 Updated LSP code parsing. Errors and warnings are now collected from all compilation units and stored in the program database with the actual programs. commit 56339d24d47770a704cf2d625fbcaeb269788c5a Author: Andreas Olofsson Date: Wed Apr 11 00:20:54 2018 +0200 Changed cmd-line options to start LSP-server + added port&host options. commit 485b2b9cf2583d96485aa907f46f050f8ae42ca2 Author: Andreas Olofsson Date: Tue Apr 10 19:44:00 2018 +0200 Created a basic LSP server src/lsp/Base.hs Handles the HTTP-like base layer of LSP src/lsp/JSONRPC.hs Handles the JSONRPC layer src/lsp/LSP.hs Starts the LSP server and currently just sends dummy responses aeson, network & bytestring have been added to 'encore.cabal' as dependencies commit 7b00d5fda2fd7d6c9f9b11481839b41fa7857e21 Author: Alfret Date: Tue Apr 10 19:22:36 2018 +0200 Added service base Added: Initial code for the compiler service Added: Copied the program-table producing code into our own file Update: Added the src/lsp directory to the cabal file commit 3d1f9bc176958b22f8e13f8d61c87c544ba7a63b Author: Christoffer Gustafsson Date: Tue Jul 3 07:36:52 2018 -0700 Added vscode client to the project. Also removed test folder. commit 1bbe9a7b44e86cc5efe1efbc6da2b6360665b431 Author: Christoffer Gustafsson Date: Tue Jul 3 07:27:26 2018 -0700 Removed experimental code. commit beb6d9f87eda3bce0bcf8eaa15721e5c4c95993a Author: Christoffer Gustafsson Date: Wed May 16 08:37:22 2018 -0700 Commented out experimental code in program.hs. commit 459307dd88a6f54840870a797c996905c2489d9d Merge: 7ae70dd6 fca0fa7f Author: Christoffer Gustafsson Date: Wed May 16 03:02:00 2018 -0700 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into service commit 7ae70dd6a0d3bc061bce518e5986c9a89f1778a6 Author: Christoffer Gustafsson Date: Wed May 16 02:35:50 2018 -0700 Fixed bug with binop's hover behaviour. commit fca0fa7fb779fc3e5ddb7dc150a308f2987e2cdc Merge: 71f727b4 c36f1afa Author: Andreas Olofsson Date: Thu May 10 20:04:14 2018 +0200 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into service commit 71f727b4783fb730063eee276fef76ba8113e605 Author: Andreas Olofsson Date: Thu May 10 20:02:17 2018 +0200 Removed debug messages commit c36f1afa0d99b869532965ac1f90ea388fd9c289 Merge: 6f9b7d1d 7b0ee5cd Author: Andreas Olofsson Date: Thu May 10 19:53:48 2018 +0200 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into service commit 6f9b7d1d982c9f3b9ef55cfa8193c640a29b5619 Author: Andreas Olofsson Date: Thu May 10 19:52:27 2018 +0200 Removed debug traces + added lsp safety check commit 7b0ee5cd2f3b8a430f526ec64ffe48f765861a55 Author: Christoffer Gustafsson Date: Wed May 9 07:52:28 2018 -0700 Improved hover functionallity for methodCall, functionCall and messageSend. commit 1dcc1ae88b358ecd31a856785a3ec1d7472bf5cd Author: Christoffer Gustafsson Date: Wed May 9 05:11:30 2018 -0700 Implemented more of hover feature. Also added fix for compiling with gcc 7.x commit d6a876f7b77880f424ffc49673f77a8ecf185934 Merge: 1977b2e5 4095ac58 Author: Christoffer Gustafsson Date: Tue May 8 09:54:19 2018 -0700 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into service commit 1977b2e56e23ab84d3c0a0901f3625f7663e328c Author: Christoffer Gustafsson Date: Tue May 8 09:50:39 2018 -0700 Better support for the LSP feature hover. commit 4095ac580a2e000cdd21fdc53537aef6249b699e Author: Andreas Olofsson Date: Thu May 3 14:50:41 2018 +0200 Added diagnostics on 'didOpen' + ignored notifications. commit 897287ad82e9e550ad9c976a68d0852ca0881eed Merge: c01115c7 cc8993e0 Author: Andreas Olofsson Date: Thu May 3 13:18:44 2018 +0200 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into service commit c01115c7b00df7aebcfb56416435dc49aedf7bf3 Author: Andreas Olofsson Date: Thu May 3 13:17:52 2018 +0200 Fixed error position bug. commit cc8993e0e8e72c08f51d38222a68005bc76c720d Author: Christoffer Gustafsson Date: Thu May 3 00:38:33 2018 -0700 Hover now works on var assignments, ex. var x = 1 will say x :: Int. commit d0927d2d0807c03a384164ae94f0022d87cf1991 Author: Alfret Date: Wed May 2 15:35:33 2018 +0200 Fixed a really small issue in Program.hs commit 2f58fd49fee390da83c19ec6521ed30691955c65 Author: Christoffer Gustafsson Date: Thu Apr 26 20:48:36 2018 +0200 Fixed bug with ranges not being calulcated in the right way. Improved the producer to handle errors in a better way. commit a1089b35da22c001e1098698411356ae98d3c1b6 Merge: 520b6283 470ae37d Author: Christoffer Gustafsson Date: Wed Apr 25 22:49:01 2018 +0200 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into service commit 520b6283a1ea5ba9802b976be26706ca2c5cfe47 Author: Christoffer Gustafsson Date: Wed Apr 25 22:48:51 2018 +0200 Added feature to State.hs. commit 470ae37de3cd819670a0d4e040883d81dfac2f2d Author: Andreas Olofsson Date: Wed Apr 25 19:02:58 2018 +0200 Added diagnostics. commit 872a09c53607426c724de5356658e23b95ac1579 Author: Andreas Olofsson Date: Wed Apr 25 18:22:37 2018 +0200 Fixed textDocument/didClose + namespace cleanup. commit 048687df0f3c356265881b0008c3c2476d3ea055 Author: Andreas Olofsson Date: Wed Apr 25 17:45:05 2018 +0200 Fixed side-effects in LSP. commit 26eb06715e32413af02b75a5071f3a2aaecb3ac8 Author: Andreas Olofsson Date: Wed Apr 25 16:37:52 2018 +0200 Added program compilation from LSP + hover. commit 04abdfd46cf1b5230782f256a616bf7edd5cf5a8 Merge: ba180fe5 c28b93fa Author: Andreas Olofsson Date: Wed Apr 25 14:34:19 2018 +0200 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into service commit ba180fe52f616bd4ed33cb23eeba63f06a030203 Author: Andreas Olofsson Date: Wed Apr 25 14:29:15 2018 +0200 Added StateM type, allows lazy state with IO. commit c28b93fa815aef62d73c7aab860d640ab2f77d57 Author: Valter Gådin Date: Wed Apr 25 14:25:51 2018 +0200 Funkar med ändringar för Hover commit 5c70aa8ca03f3f230a90733678e6c7dca8e3fc15 Author: Andreas Olofsson Date: Tue Apr 24 22:20:56 2018 +0200 Made LSP request handler use IO commit 4ff449e21484767db140e51e11aa278ffd6c0128 Author: Alfret Date: Tue Apr 24 18:44:05 2018 +0200 Updated ProgramInfo to contain range position commit 88744bca6d6a6d040c1559f60851e35e66d0ad2b Author: Alfret Date: Mon Apr 23 17:30:19 2018 +0200 Fixed getProgramInfo getProgramInfo is no longer in the IO monad and the results are so far correct for function calls and message sends. commit 7e471769174fe2121edb2ce0829b7513d1054317 Author: Alfret Date: Fri Apr 20 14:37:41 2018 +0200 Updated the program information retriever commit 006646bfe92ef72d04692418c5b42def6f3696b0 Author: Alfret Date: Thu Apr 19 18:41:54 2018 +0200 Program information lookup Added: functions for finding information about a location in the source document Fixed: Some problems with the producer commit 87a56220a03f4d1bfb2d6bddfc85e30ffbf8927c Author: Christoffer Gustafsson Date: Thu Apr 19 17:37:18 2018 +0200 Added new encore file to aid testing. commit 22db6421464a5dc300f109891a58710303cd346b Author: Christoffer Gustafsson Date: Thu Apr 19 15:14:13 2018 +0200 Implementing functions to extract data from the LSP data structure, will be used in the LSP program. commit fae830fae27627db801a1bd5019ea953d8241e61 Author: Christoffer Gustafsson Date: Thu Apr 19 12:04:10 2018 +0200 Fixed bug with convertFromProgram where it only converted to empty programs. commit 98dd90c0769122af39c69b956fee8d669d5a5bc3 Author: Christoffer Gustafsson Date: Thu Apr 19 11:38:35 2018 +0200 LSP representation of the data improved. Fixed problem with encore adding ./ to the file names. commit d2f66a81f6c6e0951f2fd7dd6a6c027df164c2fb Author: Christoffer Gustafsson Date: Wed Apr 18 16:04:12 2018 +0200 Made changes to enable compilation while completing the merge of ls-back and service. commit 59438141059dfc1a4dac318ee4036c697efa2ef3 Author: Christoffer Gustafsson Date: Wed Apr 18 13:40:46 2018 +0200 Continouation of merge between ls-back and service. commit 8a554d908ac7f82dffc645752799beaf9053fc13 Author: Christoffer Gustafsson Date: Tue Apr 17 20:23:06 2018 +0200 Merging two different database structures into one. Mainly adding the error data type. commit cc27a1bc24157fbc0c3f3b2e86c18fd626ea0c84 Merge: da3f7f0a 0db2f8dd Author: Christoffer Gustafsson Date: Tue Apr 17 17:20:23 2018 +0200 Merge branch 'service' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into ls-back commit da3f7f0aad9eb384ba4ff7d8862ac8b874d66256 Merge: 457e9c81 5ee58b4c Author: Alfret Date: Mon Apr 16 18:24:14 2018 +0200 Merge branch 'ls-back' of https://github.com/IT-independent-project-UU/G14-Encore_LSP into ls-back commit 457e9c81c585e0bcdaee7858e39a6333b643686a Author: Alfret Date: Mon Apr 16 18:24:07 2018 +0200 Minor additions and fixes to the server database commit 5ee58b4c8d5b8ee08792af490df4738b239000ca Author: Christoffer Gustafsson Date: Mon Apr 16 17:54:33 2018 +0200 Parsing file from stdin instead of hard coded file. commit 0db2f8dd36e3f264655991dd1daf342ae65ca23d Author: Andreas Olofsson Date: Mon Apr 16 17:38:24 2018 +0200 Added store + support for textDocument updates commit 4ca9d50cdef79e32463ee0792d87946b78a7cc70 Author: Alfret Date: Mon Apr 16 16:34:51 2018 +0200 Added support for errors in the LSP that supports conversion from some of the standard error types in Encore (TCError and megaparsec error). Also added position determination commit 47e4d8b4ac81a67a34fe5df45f866a8f37b1baff Author: Alfret Date: Mon Apr 16 14:17:46 2018 +0200 Updated LSP code parsing. Errors and warnings are now collected from all compilation units and stored in the program database with the actual programs. commit 0b2d5a07e5577c5583f231f844e873b1435d7994 Author: Andreas Olofsson Date: Wed Apr 11 00:20:54 2018 +0200 Changed cmd-line options to start LSP-server + added port&host options. commit 6884fe07b5106913367be0f8ed080821a04948df Author: Andreas Olofsson Date: Tue Apr 10 19:44:00 2018 +0200 Created a basic LSP server src/lsp/Base.hs Handles the HTTP-like base layer of LSP src/lsp/JSONRPC.hs Handles the JSONRPC layer src/lsp/LSP.hs Starts the LSP server and currently just sends dummy responses aeson, network & bytestring have been added to 'encore.cabal' as dependencies commit 67847b5ac7c8329851653db3348d88258fa79ba5 Author: Alfret Date: Tue Apr 10 19:22:36 2018 +0200 Added service base Added: Initial code for the compiler service Added: Copied the program-table producing code into our own file Update: Added the src/lsp directory to the cabal file --- clients/vscode/.vscode/launch.json | 27 + clients/vscode/.vscode/settings.json | 9 + clients/vscode/.vscode/tasks.json | 17 + clients/vscode/.vscodeignore | 3 + clients/vscode/README.md | 8 + clients/vscode/package-lock.json | 3023 +++++++++++++++++ clients/vscode/package.json | 64 + clients/vscode/src/extension.ts | 52 + .../vscode/syntaxes/encore.tmLanguage.json | 152 + clients/vscode/tsconfig.json | 16 + encore.cabal | 5 +- src/front/TopLevel.hs | 57 +- src/ir/AST/Meta.hs | 8 +- src/lsp/LSP/Base.hs | 125 + src/lsp/LSP/Data/DataMap.hs | 32 + src/lsp/LSP/Data/Diagnostic.hs | 76 + src/lsp/LSP/Data/Error.hs | 103 + src/lsp/LSP/Data/Hover.hs | 55 + src/lsp/LSP/Data/Position.hs | 85 + src/lsp/LSP/Data/Program.hs | 645 ++++ src/lsp/LSP/Data/State.hs | 75 + src/lsp/LSP/Data/TextDocument.hs | 191 ++ src/lsp/LSP/JSONRPC.hs | 110 + src/lsp/LSP/LSP.hs | 223 ++ src/lsp/LSP/Producer.hs | 232 ++ src/lsp/LSP/ServerTest.hs | 93 + src/lsp/LSP/Service.hs | 70 + src/types/Types.hs | 11 + 28 files changed, 5561 insertions(+), 6 deletions(-) create mode 100644 clients/vscode/.vscode/launch.json create mode 100644 clients/vscode/.vscode/settings.json create mode 100644 clients/vscode/.vscode/tasks.json create mode 100644 clients/vscode/.vscodeignore create mode 100644 clients/vscode/README.md create mode 100644 clients/vscode/package-lock.json create mode 100644 clients/vscode/package.json create mode 100644 clients/vscode/src/extension.ts create mode 100644 clients/vscode/syntaxes/encore.tmLanguage.json create mode 100644 clients/vscode/tsconfig.json create mode 100644 src/lsp/LSP/Base.hs create mode 100644 src/lsp/LSP/Data/DataMap.hs create mode 100644 src/lsp/LSP/Data/Diagnostic.hs create mode 100644 src/lsp/LSP/Data/Error.hs create mode 100644 src/lsp/LSP/Data/Hover.hs create mode 100644 src/lsp/LSP/Data/Position.hs create mode 100644 src/lsp/LSP/Data/Program.hs create mode 100644 src/lsp/LSP/Data/State.hs create mode 100644 src/lsp/LSP/Data/TextDocument.hs create mode 100644 src/lsp/LSP/JSONRPC.hs create mode 100644 src/lsp/LSP/LSP.hs create mode 100644 src/lsp/LSP/Producer.hs create mode 100644 src/lsp/LSP/ServerTest.hs create mode 100644 src/lsp/LSP/Service.hs diff --git a/clients/vscode/.vscode/launch.json b/clients/vscode/.vscode/launch.json new file mode 100644 index 000000000..8742323d5 --- /dev/null +++ b/clients/vscode/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + "version": "0.1.0", + "configurations": [ + { + "name": "Launch Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": [ "${workspaceRoot}/out/src/**/*.js" ], + "preLaunchTask": "npm" + }, + { + "name": "Launch Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ], + "stopOnEntry": false, + "sourceMaps": true, + "outFiles": [ "${workspaceRoot}/out/test/**/*.js" ], + "preLaunchTask": "npm" + } + ] +} diff --git a/clients/vscode/.vscode/settings.json b/clients/vscode/.vscode/settings.json new file mode 100644 index 000000000..f2465fea0 --- /dev/null +++ b/clients/vscode/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "files.exclude": { + "out": false + }, + "search.exclude": { + "out": true + }, + "typescript.tsdk": "./node_modules/typescript/lib" +} \ No newline at end of file diff --git a/clients/vscode/.vscode/tasks.json b/clients/vscode/.vscode/tasks.json new file mode 100644 index 000000000..f70b67cf3 --- /dev/null +++ b/clients/vscode/.vscode/tasks.json @@ -0,0 +1,17 @@ +// Available variables which can be used inside of strings. +// ${workspaceRoot}: the root folder of the team +// ${file}: the current opened file +// ${fileBasename}: the current opened file's basename +// ${fileDirname}: the current opened file's dirname +// ${fileExtname}: the current opened file's extension +// ${cwd}: the current working directory of the spawned process + +{ + "version": "0.1.0", + "command": "npm", + "isShellCommand": true, + "showOutput": "silent", + "args": ["run", "compile", "--loglevel", "silent"], + "isBackground": true, + "problemMatcher": "$tsc-watch" +} \ No newline at end of file diff --git a/clients/vscode/.vscodeignore b/clients/vscode/.vscodeignore new file mode 100644 index 000000000..43e4e83fe --- /dev/null +++ b/clients/vscode/.vscodeignore @@ -0,0 +1,3 @@ +.vscode/** +.vscode-test/** +.gitignore \ No newline at end of file diff --git a/clients/vscode/README.md b/clients/vscode/README.md new file mode 100644 index 000000000..7297e000a --- /dev/null +++ b/clients/vscode/README.md @@ -0,0 +1,8 @@ +# Visual Studio Code Client +This is an LSP client implementation for Visual Studio Core, for use with the Encore LSP server. + +## Installation +`npm install` + +## Usage +To debug the vscode extension run vscode from this folder. Start a debug session and open a .enc file. diff --git a/clients/vscode/package-lock.json b/clients/vscode/package-lock.json new file mode 100644 index 000000000..59e2bc2c4 --- /dev/null +++ b/clients/vscode/package-lock.json @@ -0,0 +1,3023 @@ +{ + "name": "vscode-encore-lsp", + "version": "0.0.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/mocha": { + "version": "2.2.48", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", + "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", + "dev": true + }, + "@types/node": { + "version": "8.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.1.tgz", + "integrity": "sha512-X/pIUOcgpX7xxKsmdPCMKeDBefsGH/4D/IuJ1gIHbqgWI0qEy/yMKeqaN/sT+rzV9UpAXAfd0kLOVExRmZrXIg==", + "dev": true + }, + "ansi-cyan": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", + "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-red": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", + "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", + "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0", + "array-slice": "0.2.3" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "beeper": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", + "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", + "dev": true + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "child_process": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/child_process/-/child_process-1.0.2.tgz", + "integrity": "sha1-sffn/HPSXn/R1FWtyU4UODAYK1o=" + }, + "clone": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", + "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", + "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", + "dev": true, + "requires": { + "inherits": "2.0.1", + "process-nextick-args": "2.0.0", + "readable-stream": "2.3.5" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-assign": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/deep-assign/-/deep-assign-1.0.0.tgz", + "integrity": "sha1-sJJ0O+hCfcYh6gBnzex+cN0Z83s=", + "dev": true, + "requires": { + "is-obj": "1.0.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "dev": true, + "requires": { + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "duplexify": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", + "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "inherits": "2.0.1", + "readable-stream": "2.3.5", + "stream-shift": "1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "1.4.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-stream": { + "version": "3.3.4", + "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "dev": true, + "requires": { + "duplexer": "0.1.1", + "from": "0.1.7", + "map-stream": "0.1.0", + "pause-stream": "0.0.11", + "split": "0.3.3", + "stream-combiner": "0.0.4", + "through": "2.3.8" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extend-shallow": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", + "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", + "dev": true, + "requires": { + "kind-of": "1.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fancy-log": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", + "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", + "dev": true, + "requires": { + "ansi-gray": "0.1.1", + "color-support": "1.1.3", + "time-stamp": "1.1.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fd-slicer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "dev": true, + "requires": { + "pend": "1.2.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "first-chunk-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", + "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.1", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "1.0.2" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + } + }, + "glob-stream": { + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-5.3.5.tgz", + "integrity": "sha1-pVZlqajM3EGRWofHAeMtTgFvrSI=", + "dev": true, + "requires": { + "extend": "3.0.1", + "glob": "5.0.15", + "glob-parent": "3.1.0", + "micromatch": "2.3.11", + "ordered-read-streams": "0.3.0", + "through2": "0.6.5", + "to-absolute-glob": "0.1.1", + "unique-stream": "2.2.1" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + } + } + }, + "glogg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", + "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", + "dev": true + }, + "gulp-chmod": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/gulp-chmod/-/gulp-chmod-2.0.0.tgz", + "integrity": "sha1-AMOQuSigeZslGsz2MaoJ4BzGKZw=", + "dev": true, + "requires": { + "deep-assign": "1.0.0", + "stat-mode": "0.2.2", + "through2": "2.0.3" + } + }, + "gulp-filter": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.1.0.tgz", + "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM=", + "dev": true, + "requires": { + "multimatch": "2.1.0", + "plugin-error": "0.1.2", + "streamfilter": "1.0.7" + } + }, + "gulp-gunzip": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulp-gunzip/-/gulp-gunzip-1.0.0.tgz", + "integrity": "sha1-FbdBFF6Dqcb1CIYkG1fMWHHxUak=", + "dev": true, + "requires": { + "through2": "0.6.5", + "vinyl": "0.4.6" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.1", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + } + } + }, + "gulp-remote-src": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/gulp-remote-src/-/gulp-remote-src-0.4.3.tgz", + "integrity": "sha1-VyjP1kNDPdSEXd7wlp8PlxoqtKE=", + "dev": true, + "requires": { + "event-stream": "3.3.4", + "node.extend": "1.1.6", + "request": "2.79.0", + "through2": "2.0.3", + "vinyl": "2.0.2" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.11.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "qs": "6.3.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.4.3", + "uuid": "3.2.1" + }, + "dependencies": { + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "qs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "dev": true + } + } + }, + "vinyl": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.0.2.tgz", + "integrity": "sha1-CjcT2NTpIhxY8QyhbAEWyeJe2nw=", + "dev": true, + "requires": { + "clone": "1.0.4", + "clone-buffer": "1.0.0", + "clone-stats": "1.0.0", + "cloneable-readable": "1.1.2", + "is-stream": "1.1.0", + "remove-trailing-separator": "1.1.0", + "replace-ext": "1.0.0" + }, + "dependencies": { + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + } + } + } + } + }, + "gulp-sourcemaps": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", + "integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=", + "dev": true, + "requires": { + "convert-source-map": "1.5.1", + "graceful-fs": "4.1.11", + "strip-bom": "2.0.0", + "through2": "2.0.3", + "vinyl": "1.2.0" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "1.0.4", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + } + } + }, + "gulp-symdest": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/gulp-symdest/-/gulp-symdest-1.1.0.tgz", + "integrity": "sha1-wWUyBzLRks5W/ZQnH/oSMjS/KuA=", + "dev": true, + "requires": { + "event-stream": "3.3.4", + "mkdirp": "0.5.1", + "queue": "3.1.0", + "vinyl-fs": "2.4.4" + } + }, + "gulp-untar": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/gulp-untar/-/gulp-untar-0.0.6.tgz", + "integrity": "sha1-1r3v3n6ajgVMnxYjhaB4LEvnQAA=", + "dev": true, + "requires": { + "event-stream": "3.3.4", + "gulp-util": "3.0.8", + "streamifier": "0.1.1", + "tar": "2.2.1", + "through2": "2.0.3" + } + }, + "gulp-util": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", + "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-uniq": "1.0.3", + "beeper": "1.1.1", + "chalk": "1.1.3", + "dateformat": "2.2.0", + "fancy-log": "1.3.2", + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash._reescape": "3.0.0", + "lodash._reevaluate": "3.0.0", + "lodash._reinterpolate": "3.0.0", + "lodash.template": "3.6.2", + "minimist": "1.2.0", + "multipipe": "0.1.2", + "object-assign": "3.0.0", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl": "0.5.3" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + }, + "vinyl": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", + "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "dev": true, + "requires": { + "clone": "1.0.4", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + } + } + }, + "gulp-vinyl-zip": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.0.tgz", + "integrity": "sha1-JOQGhdwFtxSZlSRQmeBZAmO+ja0=", + "dev": true, + "requires": { + "event-stream": "3.3.4", + "queue": "4.4.2", + "through2": "2.0.3", + "vinyl": "2.1.0", + "vinyl-fs": "2.4.4", + "yauzl": "2.9.1", + "yazl": "2.4.3" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "queue": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-4.4.2.tgz", + "integrity": "sha512-fSMRXbwhMwipcDZ08enW2vl+YDmAmhcNcr43sCJL8DIg+CFOsoRLG23ctxA+fwNk1w55SePSiS7oqQQSgQoVJQ==", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "dev": true, + "requires": { + "clone": "2.1.2", + "clone-buffer": "1.0.0", + "clone-stats": "1.0.0", + "cloneable-readable": "1.1.2", + "remove-trailing-separator": "1.1.0", + "replace-ext": "1.0.0" + }, + "dependencies": { + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + } + } + } + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "1.0.1" + } + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "commander": "2.15.1", + "is-my-json-valid": "2.17.2", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "dev": true, + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.1", + "sntp": "2.1.0" + }, + "dependencies": { + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "dev": true, + "requires": { + "hoek": "4.2.1" + } + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "dev": true, + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "dev": true, + "requires": { + "hoek": "4.2.1" + } + } + } + }, + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "dev": true, + "requires": { + "hoek": "4.2.1" + } + } + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.14.1" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + }, + "is": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", + "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, + "is-my-json-valid": { + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", + "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", + "dev": true, + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "is-my-ip-valid": "1.0.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", + "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "kind-of": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", + "dev": true + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "2.3.5" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basetostring": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", + "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", + "dev": true + }, + "lodash._basevalues": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", + "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash._reescape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", + "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", + "dev": true + }, + "lodash._reevaluate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", + "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", + "dev": true + }, + "lodash.escape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", + "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", + "dev": true, + "requires": { + "lodash._root": "3.0.1" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "dev": true + }, + "lodash.template": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", + "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash._basetostring": "3.0.1", + "lodash._basevalues": "3.0.0", + "lodash._isiterateecall": "3.0.9", + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0", + "lodash.keys": "3.1.2", + "lodash.restparam": "3.6.1", + "lodash.templatesettings": "3.1.1" + } + }, + "lodash.templatesettings": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", + "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0" + } + }, + "map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", + "dev": true + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "2.3.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", + "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, + "dependencies": { + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-union": "1.0.2", + "arrify": "1.0.1", + "minimatch": "3.0.4" + } + }, + "multipipe": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "dev": true, + "requires": { + "duplexer2": "0.0.2" + } + }, + "node.extend": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.6.tgz", + "integrity": "sha1-p7iCyC1sk6SGOlUEvV3o7IYli5Y=", + "dev": true, + "requires": { + "is": "3.2.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "ordered-read-streams": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz", + "integrity": "sha1-cTfmmzKYuzQiR6G77jiByA4v14s=", + "dev": true, + "requires": { + "is-stream": "1.1.0", + "readable-stream": "2.3.5" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "requires": { + "process": "0.11.10", + "util": "0.10.3" + } + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "plugin-error": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", + "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", + "dev": true, + "requires": { + "ansi-cyan": "0.1.1", + "ansi-red": "0.1.1", + "arr-diff": "1.1.0", + "arr-union": "2.1.0", + "extend-shallow": "1.1.4" + } + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + }, + "querystringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz", + "integrity": "sha1-YoYkIRLFtxL6ZU5SZlK/ahP/Bcs=", + "dev": true + }, + "queue": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/queue/-/queue-3.1.0.tgz", + "integrity": "sha1-bEnQHwCeIlZ4h4nyv/rGuLmZBYU=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "readable-stream": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", + "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "request": { + "version": "2.85.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", + "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "dev": true, + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.4", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "dev": true, + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.14.1" + } + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", + "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz", + "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==", + "dev": true, + "requires": { + "source-map": "0.6.1" + } + }, + "sparkles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", + "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", + "dev": true + }, + "split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "dev": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "stat-mode": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", + "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", + "dev": true + }, + "stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "dev": true, + "requires": { + "duplexer": "0.1.1" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "streamfilter": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-1.0.7.tgz", + "integrity": "sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ==", + "dev": true, + "requires": { + "readable-stream": "2.3.5" + } + }, + "streamifier": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/streamifier/-/streamifier-0.1.1.tgz", + "integrity": "sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8=", + "dev": true + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-bom-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz", + "integrity": "sha1-5xRDmFd9Uaa+0PoZlPoF9D/ZiO4=", + "dev": true, + "requires": { + "first-chunk-stream": "1.0.0", + "strip-bom": "2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.1" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.5", + "xtend": "4.0.1" + } + }, + "through2-filter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", + "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", + "dev": true, + "requires": { + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "to-absolute-glob": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", + "integrity": "sha1-HN+kcqnvUMI57maZm2YsoOs5k38=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "dev": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tslib": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", + "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", + "dev": true + }, + "tslint": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.9.1.tgz", + "integrity": "sha1-ElX4ej/1frCw4fDmEKi0dIBGya4=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.3.2", + "commander": "2.15.1", + "diff": "3.5.0", + "glob": "7.1.2", + "js-yaml": "3.11.0", + "minimatch": "3.0.4", + "resolve": "1.6.0", + "semver": "5.5.0", + "tslib": "1.9.0", + "tsutils": "2.25.0" + } + }, + "tsutils": { + "version": "2.25.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.25.0.tgz", + "integrity": "sha512-SPgUlOAUAe6fCyPi0QR4U0jRuDsHHKvzIR6/hHd0YR0bb8MzeLJgCagkPSmZeJjWImnpJ0xq6XHa9goTvMBBCQ==", + "dev": true, + "requires": { + "tslib": "1.9.0" + } + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "typescript": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.1.tgz", + "integrity": "sha512-Ao/f6d/4EPLq0YwzsQz8iXflezpTkQzqAyenTiw4kCUGr1uPiFLC3+fZ+gMZz6eeI/qdRUqvC+HxIJzUAzEFdg==", + "dev": true + }, + "unique-stream": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", + "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", + "dev": true, + "requires": { + "json-stable-stringify": "1.0.1", + "through2-filter": "2.0.0" + } + }, + "url-parse": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.2.0.tgz", + "integrity": "sha512-DT1XbYAfmQP65M/mE6OALxmXzZ/z1+e5zk2TcSKe/KiYbNGZxgtttzC0mR/sjopbpOXcbniq7eIKmocJnUWlEw==", + "dev": true, + "requires": { + "querystringify": "1.0.0", + "requires-port": "1.0.0" + } + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "requires": { + "inherits": "2.0.1" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", + "dev": true + }, + "vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "vinyl": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", + "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", + "dev": true, + "requires": { + "clone": "0.2.0", + "clone-stats": "0.0.1" + } + }, + "vinyl-fs": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-2.4.4.tgz", + "integrity": "sha1-vm/zJwy1Xf19MGNkDegfJddTIjk=", + "dev": true, + "requires": { + "duplexify": "3.5.4", + "glob-stream": "5.3.5", + "graceful-fs": "4.1.11", + "gulp-sourcemaps": "1.6.0", + "is-valid-glob": "0.3.0", + "lazystream": "1.0.0", + "lodash.isequal": "4.5.0", + "merge-stream": "1.0.1", + "mkdirp": "0.5.1", + "object-assign": "4.1.1", + "readable-stream": "2.3.5", + "strip-bom": "2.0.0", + "strip-bom-stream": "1.0.0", + "through2": "2.0.3", + "through2-filter": "2.0.0", + "vali-date": "1.0.0", + "vinyl": "1.2.0" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "1.0.4", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + } + } + }, + "vinyl-source-stream": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-1.1.2.tgz", + "integrity": "sha1-YrU6E1YQqJbpjKlr7jqH8Aio54A=", + "dev": true, + "requires": { + "through2": "2.0.3", + "vinyl": "0.4.6" + } + }, + "vscode": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.14.tgz", + "integrity": "sha512-acfn3fzGtTm7UjChAN7/YjsC0qIyJeuSrJwvm6qb7tLN6Geq1FmCz1JnBOc3kaY+HCLjQBAfwG/CsgnasOdXMw==", + "dev": true, + "requires": { + "glob": "7.1.2", + "gulp-chmod": "2.0.0", + "gulp-filter": "5.1.0", + "gulp-gunzip": "1.0.0", + "gulp-remote-src": "0.4.3", + "gulp-symdest": "1.1.0", + "gulp-untar": "0.0.6", + "gulp-vinyl-zip": "2.1.0", + "mocha": "4.1.0", + "request": "2.85.0", + "semver": "5.5.0", + "source-map-support": "0.5.4", + "url-parse": "1.2.0", + "vinyl-source-stream": "1.1.2" + } + }, + "vscode-jsonrpc": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz", + "integrity": "sha1-hyOdnhZrLXNSJFuKgTWXgEwdY6o=" + }, + "vscode-languageclient": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.5.1.tgz", + "integrity": "sha512-GTQ+hSq/o4c/y6GYmyP9XNrVoIu0NFZ67KltSkqN+tO0eUNDIlrVNX+3DJzzyLhSsrctuGzuYWm3t87mNAcBmQ==", + "requires": { + "vscode-languageserver-protocol": "3.5.1" + } + }, + "vscode-languageserver-protocol": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.1.tgz", + "integrity": "sha512-1fPDIwsAv1difCV+8daOrJEGunClNJWqnUHq/ncWrjhitKWXgGmRCjlwZ3gDUTt54yRcvXz1PXJDaRNvNH6pYA==", + "requires": { + "vscode-jsonrpc": "3.5.0", + "vscode-languageserver-types": "3.5.0" + } + }, + "vscode-languageserver-types": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz", + "integrity": "sha1-5I15li8LjgLelV4/UkkI4rGcA3Q=" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yauzl": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.9.1.tgz", + "integrity": "sha1-qBmB6nCleUYTOIPwKcWCGok1mn8=", + "dev": true, + "requires": { + "buffer-crc32": "0.2.13", + "fd-slicer": "1.0.1" + } + }, + "yazl": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.4.3.tgz", + "integrity": "sha1-7CblzIfVYBud+EMtvdPNLlFzoHE=", + "dev": true, + "requires": { + "buffer-crc32": "0.2.13" + } + } + } +} diff --git a/clients/vscode/package.json b/clients/vscode/package.json new file mode 100644 index 000000000..35382e48b --- /dev/null +++ b/clients/vscode/package.json @@ -0,0 +1,64 @@ +{ + "name": "vscode-encore-lsp", + "displayName": "Encore LSP Client", + "description": "Encore support for VSCode via LSP.", + "publisher": "Andreas Olofsson", + "version": "0.0.1", + "engines": { + "vscode": "^1.19.0" + }, + "categories": [ + "Programming Languages", + "Linters", + "Other" + ], + "keywords": [ + "Encore" + ], + "repository": { + "type": "git", + "url": "https://bitbucket.org/AndreasOlofsson/vscode-encore-lsp/" + }, + "bugs": { + "url": "https://bitbucket.org/AndreasOlofsson/vscode-encore-lsp/issues" + }, + "activationEvents": [ + "onLanguage:encore" + ], + "contributes": { + "languages": [ + { + "id": "encore", + "extensions": [ + ".enc" + ] + } + ], + "grammars": [ + { + "language": "encore", + "scopeName": "source.enc", + "path": "./syntaxes/encore.tmLanguage.json" + } + ] + }, + "main": "./out/src/extension", + "scripts": { + "vscode:prepublish": "tsc -p ./", + "compile": "tsc -watch -p ./", + "postinstall": "node ./node_modules/vscode/bin/install", + "test": "node ./node_modules/vscode/bin/test" + }, + "devDependencies": { + "@types/mocha": "^2.2.32", + "@types/node": "^8.0.31", + "typescript": "^2.6.1", + "vscode": "^1.1.10", + "tslint": "^5.9.1" + }, + "dependencies": { + "path": "^0.12.7", + "child_process": "^1.0.2", + "vscode-languageclient": "^3.5.0" + } +} diff --git a/clients/vscode/src/extension.ts b/clients/vscode/src/extension.ts new file mode 100644 index 000000000..e764f25d6 --- /dev/null +++ b/clients/vscode/src/extension.ts @@ -0,0 +1,52 @@ +'use strict'; + +import * as path from 'path'; + +import { workspace, ExtensionContext, window } from 'vscode'; +import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient'; +import { Socket, createServer } from 'net'; +const cp = require("child_process"); + +export function activate(context: ExtensionContext) { + console.log('encore LSP activated'); + + const serverOptions: ServerOptions = function () { + return new Promise((resolve, reject) => { + let childProcess + + const server = createServer(socket => { + server.close() + resolve({ reader: socket, writer: socket }) + }) + + server.listen(0, '127.0.0.1', () => { + let port = server.address().port + childProcess = cp.spawn("encorec", ["--server", "tcp-client", "--host", "localhost", "--port", `${port}`]) + + childProcess.stderr.on('data', (chunk: Buffer) => { + console.error(chunk + ''); + }); + childProcess.stdout.on('data', (chunk: Buffer) => { + console.log(chunk + ''); + }); + + return childProcess + }) + }) + } + + let clientOptions: LanguageClientOptions = { + documentSelector: [{scheme: 'file', language: 'encore'}], + synchronize: { + configurationSection: 'encorelangsvr', + fileEvents: workspace.createFileSystemWatcher('**/*.enc') + } + } + + let languageClient = new LanguageClient('encorelangsvr', 'Language Server Encore', serverOptions, clientOptions); + let disposable = languageClient.start(); + + context.subscriptions.push(disposable); +} + +export let config = workspace.getConfiguration("encore"); diff --git a/clients/vscode/syntaxes/encore.tmLanguage.json b/clients/vscode/syntaxes/encore.tmLanguage.json new file mode 100644 index 000000000..15007c6d9 --- /dev/null +++ b/clients/vscode/syntaxes/encore.tmLanguage.json @@ -0,0 +1,152 @@ +{ + "name": "encore", + "scopeName": "source.enc", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#keyword" + }, + { + "include": "#name" + }, + { + "include": "#type" + }, + { + "include": "#constant" + } + ], + "repository": { + "keyword": { + "patterns": [ + { + "match": "\\b(active|class|val|var|def|fun|if|while|do|if|else|then|let|in|match|with|case|where|new|end)\\b", + "captures": { + "0": { + "name": "keyword.other.enc" + } + } + } + ] + }, + "name": { + "patterns": [ + { + "match": "(?x)(?<=class|def|fun)\\s+([_$a-zA-Z][_$a-zA-Z0-9]*)", + "captures": { + "1": { + "name": "entity.name.function.enc" + } + } + } + ] + }, + "type": { + "patterns": [ + { + "match": "(?x)(?<=:)\\s*([_$a-zA-Z][_$a-zA-Z0-9]*)", + "captures": { + "1": { + "name": "entity.name.type.enc" + } + } + } + ] + }, + "constant": { + "patterns": [ + { + "include": "#string" + }, + { + "match": "\\b(true|false)\\b", + "captures": { + "1": { + "name": "constant.language.enc" + } + } + }, + { + "match": "\\b([0-9]+)\\b", + "captures": { + "1": { + "name": "constant.numeric.enc" + } + } + } + ] + }, + "string": { + "patterns": [ + { + "name": "string.quoted.double.enc", + "begin": "\"", + "end": "\"", + "captures": "string.quoted.double.enc", + "patterns": [ + { + "match": "\\\\\"" + } + ] + }, + { + "name": "string.quoted.single.enc", + "begin": "'", + "end": "'", + "captures": "string.quoted.single.enc", + "patterns": [ + { + "match": "\\\\'" + } + ] + } + ] + }, + "comment": { + "patterns": [ + { + "name": "comment.block.enc", + "begin": "{-", + "end": "-}", + "captures": { + "0": { + "name": "punctuation.definition.comment.enc" + } + }, + "patterns": [ + { + "match": "(?:TODO|FIXME|XXX):?", + "captures": { + "0": { + "name": "keyword.other.todo" + } + } + } + ] + }, + { + "name": "comment.line.enc", + "begin": "--", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.enc" + } + }, + "end": "$", + "patterns": [ + { + "match": "(?:TODO|FIXME|XXX):?", + "captures": { + "0": { + "name": "keyword.other.todo" + } + } + } + ] + } + ] + } + } +} diff --git a/clients/vscode/tsconfig.json b/clients/vscode/tsconfig.json new file mode 100644 index 000000000..11282c9ad --- /dev/null +++ b/clients/vscode/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "out", + "lib": [ + "es6" + ], + "sourceMap": true, + "rootDir": "." + }, + "exclude": [ + "node_modules", + ".vscode-test" + ] +} \ No newline at end of file diff --git a/encore.cabal b/encore.cabal index 67bf183af..532355ea2 100644 --- a/encore.cabal +++ b/encore.cabal @@ -47,7 +47,10 @@ executable encorec , unordered-containers , boxes , filepath - hs-source-dirs: src/back src/front src/ir src/opt src/parser src/types + , aeson + , network + , bytestring + hs-source-dirs: src/back src/front src/ir src/opt src/parser src/types src/lsp ghc-options: -Werror -fmax-pmcheck-iterations=10000000 default-language: Haskell2010 other-modules: AST.AST diff --git a/src/front/TopLevel.hs b/src/front/TopLevel.hs index c7a3d9971..33757e0fd 100644 --- a/src/front/TopLevel.hs +++ b/src/front/TopLevel.hs @@ -25,6 +25,7 @@ import qualified Data.Map.Strict as Map import SystemUtils import Language.Haskell.TH -- for Template Haskell hackery import Text.Printf +import Text.Read import qualified Text.PrettyPrint.Boxes as Box import System.FilePath (splitPath, joinPath) import Text.Megaparsec.Error(errorPos, parseErrorTextPretty) @@ -50,6 +51,8 @@ import CodeGen.Header import CCode.PrettyCCode import Identifiers +import LSP.Service + -- the following line of code resolves the standard path at compile time using Template Haskell standardLibLocation = $(stringE . init =<< runIO (System.Environment.getEnv "ENCORE_MODULES" )) @@ -72,6 +75,9 @@ data Option = | Verbose | Literate | NoGC + | Server String + | Host String + | Port String | Help | Undefined String | Malformed String @@ -93,7 +99,7 @@ optionMappings = map makeMapping [ (Arg (Imports . split ":"), "-I", "--import", "[dirs]", - "colon separated list of directories in which to look for modules."), + "colon separated list of directories in which to look for modules."), (Arg Output, "-o", "--out-file", "[file]", "Specify output file."), (Arg CustomFlags, "-F", "--custom-flags", "[flags]", @@ -122,6 +128,12 @@ optionMappings = "Compile and run the program, but do not produce executable file."), (NoArg NoGC, "", "--no-gc", "", "DEBUG: disable GC and use C-malloc for allocation."), + (Arg Server, "-s", "--server", "[server-mode]", + "Start the compiler as a language server. Valid server modes are \"stdio\", \"tcp-client\" and \"tcp-server\"."), + (Arg Host, "-h", "--host", "[host]", + "Specify what host to connect to when running as a language server in \"tcp-client\" mode."), + (Arg Port, "-p", "--port", "[port]", + "Specify what port to use when running as a language server in \"tcp-client\" or \"tcp-server\" mode."), (NoArg Help, "", "--help", "", "Display this information.") ] @@ -287,12 +299,51 @@ compileProgram prog sourcePath options = getDefine NoGC = "NO_GC" getDefine _ = "" +isServerOption :: Option -> Bool +isServerOption (Server _) = True +isServerOption _ = False + +getPortOption :: [Option] -> IO Integer +getPortOption [] = exit "Port number must be specified using --port." +getPortOption ((Port port):bs) + = case readMaybe port of + Just port -> return port + Nothing -> exit "Port specified using --port must be a number." +getPortOption (a:bs) = getPortOption bs + +getHostOption :: [Option] -> IO String +getHostOption [] = exit "Host must be specified using --host." +getHostOption ((Host host):_) = return host +getHostOption (a:bs) = getHostOption bs + +serverParams :: String -> [Option] -> IO ConnectionParams +serverParams "stdio" options = return STDIO +serverParams "tcp-server" options = do + port <- getPortOption options + return $ TCPServer port +serverParams "tcp-client" options = do + port <- getPortOption options + host <- getHostOption options + return $ TCPClient host port +serverParams _ _ = fail "Language server mode must be one of \"stdio\", \"tcp-server\" or \"tcp-client\"." + main = - do args <- getArgs + do + -- Parse arguments + args <- getArgs (programs, importDirs, options) <- parseArguments args checkForUndefined options when (Help `elem` options) (exit helpMessage) + + -- Run language server if mode is specified + case find isServerOption options of + Just (Server mode) -> do params <- serverParams mode options + startServer params + exitSuccess + Nothing -> return () + + -- Check that files were specified when (null programs) (abort ("No program specified! Aborting.\n\n" <> usage <> "\n" <> @@ -428,4 +479,4 @@ main = optionBox = longBox Box.<+> shortBox Box.<+> descBox flags = intercalate "\n" $ map ((" " ++) . strip) . lines $ - Box.render optionBox \ No newline at end of file + Box.render optionBox diff --git a/src/ir/AST/Meta.hs b/src/ir/AST/Meta.hs index 13e48fe90..edc978b2a 100644 --- a/src/ir/AST/Meta.hs +++ b/src/ir/AST/Meta.hs @@ -21,8 +21,12 @@ data Position = SingletonPos {startPos :: SourcePos} deriving (Eq) instance Show Position where - -- TODO: If we ever want to print ranges, this should be updated - show = showSourcePos . startPos + show (SingletonPos s) = showSourcePos s + show (RangePos s e) = + sourceName s ++ " " ++ + show (unPos $ sourceLine s, unPos $ sourceColumn s) ++ " to " ++ + show (unPos $ sourceLine e, unPos $ sourceColumn e) + --(showSourcePos s) ++ " to " ++ (showSourcePos e) newPos :: SourcePos -> Position newPos = SingletonPos diff --git a/src/lsp/LSP/Base.hs b/src/lsp/LSP/Base.hs new file mode 100644 index 000000000..59d5b1e4a --- /dev/null +++ b/src/lsp/LSP/Base.hs @@ -0,0 +1,125 @@ +{- | +MODULE : LSP.Base +DESCRIPTION : Implements the HTTP-like base layer of LSP +-} + +module LSP.Base ( + encodeMessage, + parsePackets, parsePacket, + LSPPacket (..), LSPHeaderField (..) +) where + +import Control.Monad +import Control.Concurrent +import Data.Aeson +import Data.Maybe +import Network.Socket +import qualified Network.Socket.ByteString.Lazy as SocketLazy (getContents) +import Data.ByteString.Lazy.Char8 (ByteString) +import qualified Data.ByteString.Lazy.Char8 as BS +import Text.Read (readMaybe) + +data LSPPacket = LSPPacket { + header :: [LSPHeaderField], + content :: String +} deriving (Show) + +data LSPHeaderField = LSPHeaderField { + key :: String, + value :: String +} deriving (Show) + +encodeMessage :: LSPPacket -> String +encodeMessage (LSPPacket header content) = + headerString (headerWithContentLength) ++ content + where + headerWithContentLength = + (LSPHeaderField "Content-Length" $ show $ length content): + filter (\field -> key field /= "Content-Length") header + headerString [] = "\r\n" + headerString ((LSPHeaderField key value):bs) = key ++ (':':' ':value) ++ "\r\n" ++ headerString bs + +{- | +parsePackets + Parses the input into a list of packets. + +Returns +the packets along with a possible error +that occurred while reading a packet. +-} +parsePackets :: String -> ([LSPPacket], Maybe String) +parsePackets input = + case parsePacket input of + Left e -> ([], Just e) + Right (request, rest) -> let (requests, e) = parsePackets rest + in (request:requests, e) + +{- | +parsePacket + Reads a single request. + +Returns +an error description +or a packet along with any remaining text in the input string +after the end of the packet. +-} +parsePacket :: String -> Either String (LSPPacket, String) +parsePacket input = + case readHeader input of + Left error -> Left error + Right (fields, input) -> + case map (readMaybe . value) $ filter ((== "Content-Length") . key) fields of + [Just length] -> Right (LSPPacket fields $ take length input, drop length input) + otherwise -> Left "Missing Content-Length" + +readHeader :: String -> Either String ([LSPHeaderField], String) +readHeader input = + readHeader' input True + where + readHeader' input first = + case (readHeaderField input, first) of + (Left error, _) -> Left error + (Right (Nothing, rest), True) -> readHeader' rest True + (Right (Nothing, rest), False) -> Right ([], rest) + (Right (Just field, rest), _) -> + case readHeader' rest False of + Left error -> Left error + Right (fields, rest) -> Right (field:fields, rest) + + +readHeaderField :: String -> Either String (Maybe LSPHeaderField, String) +readHeaderField input = + case readLine input of + Nothing -> Left "End of input" + Just ("", rest) -> Right (Nothing, rest) + Just (line, rest) -> + case parseHeaderField line of + Nothing -> Left "Invalid header field" + Just (key, value) -> Right (Just $ LSPHeaderField key value, rest) + where + parseHeaderField :: String -> Maybe (String, String) + parseHeaderField "" = Nothing + parseHeaderField (':':' ':value) = Just ("", value) + parseHeaderField (a:bs) = + case parseHeaderField bs of + Nothing -> Nothing + Just (key, value) -> Just (a:key, value) + +{- | +readLine + Reads a single line of text terminated by + "\r\n", "\n" or the end of the input. + +Returns +Nothing or a pair containing +the line of text and any remaining text +in the input string after the end of the line. +-} +readLine :: String -> Maybe (String, String) +readLine "" = Nothing +readLine ('\r':'\n':rest) = Just ("", rest) +readLine ('\n':rest) = Just ("", rest) +readLine (a:rest) = + case readLine rest of + Nothing -> Just ([a], rest) + Just (line, rest) -> Just (a:line, rest) diff --git a/src/lsp/LSP/Data/DataMap.hs b/src/lsp/LSP/Data/DataMap.hs new file mode 100644 index 000000000..e78f7ea56 --- /dev/null +++ b/src/lsp/LSP/Data/DataMap.hs @@ -0,0 +1,32 @@ +module LSP.Data.DataMap( + LSPData, + DataMap, + hasErrorInDataMap + ) +where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Standard +import Data.Map as Map hiding (foldr) + +-- LSP +import LSP.Data.Program +import LSP.Data.TextDocument + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +type LSPData = (Program, TextDocument) + +type DataMap = Map String LSPData + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +hasErrorInDataMap :: DataMap -> Bool +hasErrorInDataMap dataMap = Map.foldl (\acc (prog, _) -> acc || (length (errors prog)) > 0) False dataMap diff --git a/src/lsp/LSP/Data/Diagnostic.hs b/src/lsp/LSP/Data/Diagnostic.hs new file mode 100644 index 000000000..3a0f8a97c --- /dev/null +++ b/src/lsp/LSP/Data/Diagnostic.hs @@ -0,0 +1,76 @@ +{-# LANGUAGE OverloadedStrings #-} + +module LSP.Data.Diagnostic ( + PublishDiagnosticsParams(..), + Diagnostic(..), + DiagnosticSeverity(..), + errorToDiagnostic +) where + +import Data.Aeson + +import LSP.Data.Position +import LSP.Data.Error + +data PublishDiagnosticsParams = PublishDiagnosticsParams { + pdpUri :: String, + pdpDiagnostics :: [Diagnostic] +} deriving (Show) + +data Diagnostic = Diagnostic { + dRange :: Range, + dSeverity :: DiagnosticSeverity, + dCode :: String, + dSource :: String, + dMessage :: String +} deriving (Show) + +data DiagnosticSeverity + = DError + | DWarning + | DInformation + | DHint + deriving (Show, Enum) + +errorToDiagnostic :: Error -> Diagnostic +errorToDiagnostic error = + Diagnostic { + dRange = position error, + dCode = "-- error --", + dSource = "Encore", + dMessage = message error, + dSeverity = case errorType error of + TError -> DError + TWarning -> DWarning + THint -> DHint + } + +{-instance Enum DiagnosticSeverity where + toEnum = fromIntegral . (-1) + fromEnum = (+1) . fromInteger-} + +instance ToJSON PublishDiagnosticsParams where + toJSON pdp = + object [ + "uri" .= pdpUri pdp, + "diagnostics" .= pdpDiagnostics pdp + ] + +instance ToJSON Diagnostic where + toJSON diagnostic = + object [ + "range" .= object [ + "start" .= object [ + "line" .= (fst $ fst $ dRange diagnostic), + "character" .= (snd $ fst $ dRange diagnostic) + ], + "end" .= object [ + "line" .= (fst $ snd $ dRange diagnostic), + "character" .= (snd $ snd $ dRange diagnostic) + ] + ], + "severity" .= (1 + (fromEnum $ dSeverity diagnostic)), + "code" .= dCode diagnostic, + "source" .= dSource diagnostic, + "message" .= dMessage diagnostic + ] \ No newline at end of file diff --git a/src/lsp/LSP/Data/Error.hs b/src/lsp/LSP/Data/Error.hs new file mode 100644 index 000000000..09758499f --- /dev/null +++ b/src/lsp/LSP/Data/Error.hs @@ -0,0 +1,103 @@ +module LSP.Data.Error ( + Error(..), + ErrorType(..), + fromTCError, + fromTCErrors, + fromTCWarning, + fromTCWarnings, + fromParsecError, + fromErrorMessage +) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Library +import Text.Megaparsec + +-- Standard +import qualified Data.Map.Strict as Map +import qualified Data.List.NonEmpty as NE(head) +import Data.List +import Control.Monad + +-- Encore imports +import Typechecker.TypeError hiding (Error) +import AST.AST +import qualified AST.Meta as ASTMeta(Position(SingletonPos, RangePos)) + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +{- Position tuple -} +type Position = ((Int, Int), (Int, Int)) + +data ErrorType = TError | TWarning | THint + +instance Show ErrorType where + show (TError) = "Error" + show (TWarning) = "Warning" + show (THint) = "Hint" + +{- Error datastructure. Can represent a variety of different error types -} +data Error = Error{ + message :: String, -- Error message string + position :: Position, -- Start and end position + errorType :: ErrorType +} deriving (Show) + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +extractTCErrorPosition :: TCError -> Position +extractTCErrorPosition error@(TCError errorType []) = ((0, 0), (0, 0)) +extractTCErrorPosition error@(TCError errorType backtrace) = + case fst (head backtrace) of + (ASTMeta.SingletonPos startPos) -> + ((getPosLine startPos - 1, getPosCol startPos - 1), + (getPosLine startPos - 1, getPosCol startPos - 1)) + (ASTMeta.RangePos startPos endPos) -> + ((getPosLine startPos - 1, getPosCol startPos - 1), + (getPosLine endPos - 1, getPosCol endPos - 1)) + where getPosLine = fromIntegral . unPos . sourceLine + getPosCol = fromIntegral . unPos . sourceColumn + +extractTCWarningPosition :: TCWarning -> Position +extractTCWarningPosition warning = ((0,0), (0,0)) + +fromTCError :: TCError -> Error +fromTCError error = + Error{message = show error, position = extractTCErrorPosition error, errorType = TError} + +fromTCErrors :: [TCError] -> [Error] +fromTCErrors errors = fmap (fromTCError) errors + +fromTCWarning :: TCWarning -> Error +fromTCWarning warning = + Error{message = show warning, position = extractTCWarningPosition warning, errorType = TWarning} + +fromTCWarnings :: [TCWarning] -> [Error] +fromTCWarnings warnings = fmap (fromTCWarning) warnings + +fromParsecError :: (ParseError Char Text.Megaparsec.Dec) -> Error +fromParsecError error = + Error{ + message = show error, + position = ((fromIntegral(unPos $ sourceLine $ NE.head $ errorPos error), fromIntegral(unPos $ sourceColumn $ NE.head $ errorPos error)), + (fromIntegral(unPos $ sourceLine $ NE.head $ errorPos error), fromIntegral(unPos $ sourceColumn $ NE.head $ errorPos error))), + errorType = TError + } + +{- Construct a Error from a message, position and whether it is actually a + warning + + Param: Error message + Param: Position (row, column) + Param: Whether or not the error is actually a warning +-} +fromErrorMessage :: String -> Position -> ErrorType -> Error +fromErrorMessage _message _position _errorType = + Error{message = _message, position = _position, errorType = _errorType} diff --git a/src/lsp/LSP/Data/Hover.hs b/src/lsp/LSP/Data/Hover.hs new file mode 100644 index 000000000..b0382c377 --- /dev/null +++ b/src/lsp/LSP/Data/Hover.hs @@ -0,0 +1,55 @@ +{-# LANGUAGE OverloadedStrings #-} + +module LSP.Data.Hover where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- +import LSP.Data.Position +import Data.Aeson + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- +data TextDocumentPositionParams = TextDocumentPositionParams { + uri :: String, + position :: Position +} + +data Hover = Hover { + contents :: String, + range :: Range +} + +-- ###################################################################### -- +-- Section: Type Classes +-- ###################################################################### -- + +instance FromJSON TextDocumentPositionParams where + parseJSON = withObject "params" $ \o -> do + textDocument <- o .: "textDocument" + uri <- textDocument .: "uri" + position <- o .: "position" + line <- position .: "line" + character <- position .: "character" + + return TextDocumentPositionParams { + uri = uri, + position = (line + 1, character + 1) + } + +instance ToJSON Hover where + toJSON hover = + object [ + "contents" .= contents hover, + "range" .= object [ + "start" .= object [ + "line" .= ((fst $ fst $ range hover) - 1), + "character" .= ((snd $ fst $ range hover) - 1) + ], + "end" .= object [ + "line" .= ((fst $ snd $ range hover) - 1), + "character" .= ((snd $ snd $ range hover) - 1) + ] + ] + ] diff --git a/src/lsp/LSP/Data/Position.hs b/src/lsp/LSP/Data/Position.hs new file mode 100644 index 000000000..d39db08f6 --- /dev/null +++ b/src/lsp/LSP/Data/Position.hs @@ -0,0 +1,85 @@ +module LSP.Data.Position ( + Position, + Range, + inRange, + fromSourcePos, + fromSourcePosRange, + rangeCompliment, + widestRange +) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Library +import Text.Megaparsec(SourcePos,unPos,sourceLine,sourceColumn) +import Data.List as List + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +{- -} +type Position = (Int, Int) + +{- -} +type Range = (Position, Position) + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +{- -} +inRange :: Position -> Range -> Bool +inRange pos (start, end) + | fst pos > fst start && fst pos < fst end = True + | fst pos == fst start && fst pos < fst end && snd pos >= snd start = True + | fst pos > fst start && fst pos == fst end && snd pos < snd end = True + | fst pos == fst start && fst pos == fst end && snd pos >= snd start && snd pos < snd end = True + | True = False -- sorry, had to do it (otherwise == True) + +{- -} +fromSourcePos :: SourcePos -> Position +fromSourcePos pos = (fromIntegral (unPos (sourceLine pos)), fromIntegral (unPos (sourceColumn pos))) + +{- -} +fromSourcePosRange :: SourcePos -> SourcePos -> Range +fromSourcePosRange from to = (fromSourcePos from, fromSourcePos to) + +posLess :: Position -> Position -> Bool +posLess a b + | fst a < fst b = True + | fst a == fst b && snd a < snd b = True + | otherwise = False + +posGreater :: Position -> Position -> Bool +posGreater a b + | fst a > fst b = True + | fst a == fst b && snd a > snd b = True + | otherwise = False + +rangeCompliment :: Range -> Range -> Range +rangeCompliment a b + | posLess (fst a) (fst b) = (fst a, fst b) + | posGreater (snd a) (snd b) = (snd b, snd a) + | otherwise = a + +minPosition :: [Position] -> Position +minPosition [] = (0, 0) +minPosition (x:[]) = x +minPosition (x:y:xs) + | posLess x y = minPosition (x:xs) + | otherwise = minPosition (y:xs) + +maxPosition :: [Position] -> Position +maxPosition [] = (0, 0) +maxPosition (x:[]) = x +maxPosition (x:y:xs) + | posGreater x y = maxPosition (x:xs) + | otherwise = maxPosition (y:xs) + +widestRange :: Range -> [Range] -> Range +widestRange firstRange ranges = do + let wholeRange = (firstRange:ranges) + (minPosition (fmap fst wholeRange), maxPosition (fmap snd wholeRange)) diff --git a/src/lsp/LSP/Data/Program.hs b/src/lsp/LSP/Data/Program.hs new file mode 100644 index 000000000..55bf6b681 --- /dev/null +++ b/src/lsp/LSP/Data/Program.hs @@ -0,0 +1,645 @@ +module LSP.Data.Program ( + Program(..), + ProgramInfo(..), + makeBlankProgram, + makeBlankAST, + getProgramInfoDescription, + getProgramInfoRange, + getProgramInfoForPos, + + dumpProgramErrors + ) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Standard +import System.Exit +import Debug.Trace as Debug +import Data.List as List + +-- Encore +import qualified AST.AST as AST +import qualified AST.Meta as ASTMeta +import qualified Typechecker.Util as TypeUtil +import qualified Types + +-- LSP +import LSP.Data.Error +import qualified LSP.Data.Position as LSP + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +{- Data that holds information about a single program (compilation unit). This + can later be used to lookup information. + + The error and warning-list will contain all the errors and warnings, +respectively, that was generated during the compilation that generated the + AST. If the program compiled correctly the list of errors will be empty. + Even during successfull compilation the warnings list may contain items. +-} +data Program = Program { + ast :: AST.Program, -- The "AST" of the program + errors :: [Error], -- List of all errors + warnings :: [Error] -- List of warnings. +} deriving (Show) + +{- Data that holds information about the result of a lookup in a program. This + is a String containing the description of the error as well as the + range-position in the source file that the info describes. + + The range position is used by LSP to know in what range it the client does + not need to request new information during, for example, hovering the cursor + over the source. +-} +data ProgramInfo = ProgramInfo { + pDesc :: String, -- Description of looked-up info. + pRange :: LSP.Range, -- Range of the info in source. + pDebug :: Bool -- Debug message, will be ignored in release. +} + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +{- Make a blank program data. The makeBlankAST will be used to create an empty + AST and the error and warning lists will be set to empty +-} +makeBlankProgram :: FilePath -> Program +makeBlankProgram path = Program { + ast = makeBlankAST path, + errors = [], + warnings = [] +} + +{- Make a blank AST. -} +makeBlankAST :: FilePath -> AST.Program +makeBlankAST path = AST.Program { + AST.source = path, + AST.moduledecl = AST.NoModule, + AST.etl = [], + AST.imports = [], + AST.typedefs = [], + AST.functions = [], + AST.traits = [], + AST.classes = [], + AST.adts = [], + AST.adtCons = [] +} + +{- Make a program info data from the description of the info as well as the + position range in the source that will yield the same info + + Param: Description of the information. + Param: Range position in source that yields same info. +-} +makeProgramInfo :: String -> LSP.Range -> ProgramInfo +makeProgramInfo desc range = ProgramInfo{pDesc = desc, pRange = range, pDebug = False} + +makeProgramInfoDebug :: String -> LSP.Range -> ProgramInfo +makeProgramInfoDebug desc range = ProgramInfo{pDesc = desc, pRange = range, pDebug = True} + +{- Returns the description of a ProgramInfo data. + + Param: Program info. + Return: Description of program info. +-} +getProgramInfoDescription :: ProgramInfo -> String +getProgramInfoDescription info = (pDesc info) + +{- Returns the range position from a ProgramInfo data. + + Param: Program info + Return: Range position of program info. +-} +getProgramInfoRange :: ProgramInfo -> LSP.Range +getProgramInfoRange info = (pRange info) + +{- Utility function that can be used when a SingletonPos is encountered in the + AST. It will print a message that warns about the SingletonPos. This is used + because there should not exists any SingletonPos in the AST. + + Return: Always returns Nothing but also prints error to output. +-} +handleSingletonPos :: (Maybe ProgramInfo) +handleSingletonPos = (trace "#Error: cannot handle singleton pos" Nothing) + +{- Retrieve information from the cursor position in the specified program. This + will traverse the AST until it finds the most specific information about the + position that is specified. The function may also fail to find any + information if an error occurs or if the cursor position is on a whitespace. + + Param: Cursor position to look at. + Param: Program to search in. + Return: Program information for position or "Nothing" +-} +getProgramInfoForPos :: LSP.Position -> Program -> Maybe ProgramInfo +getProgramInfoForPos pos program = do + -- Try to get function info + let functionInfo = (getProgramInfoFunction program pos (AST.functions $ ast program)) + case functionInfo of + Just info -> Just info + Nothing -> do + -- Try to get class info + let classInfo = (getProgramInfoClass program pos (AST.classes $ ast program)) + case classInfo of + Just info -> Just info + Nothing -> Nothing + +{- + + +-} +getProgramInfoFunction :: Program -> LSP.Position -> [AST.Function] -> Maybe ProgramInfo +getProgramInfoFunction _ _ [] = Nothing +getProgramInfoFunction program pos (x:xs) = + -- Check if singleton or range pos + case (ASTMeta.getPos (AST.funmeta x)) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + -- Check if pos is in function + case LSP.inRange pos (LSP.fromSourcePosRange start end) of + False -> getProgramInfoFunction program pos xs + True -> do + -- Check if pos is on paramDecl + let paramDeclInfo = getProgramInfoParamDecl program pos (AST.hparams $ AST.funheader x) + case paramDeclInfo of + Just info -> Just info + Nothing -> do + -- Check if pos is in body + let bodyInfo = getProgramInfoExpr program pos False (AST.funbody x) + case bodyInfo of + Just info -> Just info + Nothing -> do + -- Check if pos is in local function + let functionInfo = getProgramInfoFunction program pos (AST.funlocals x) + case functionInfo of + Just info -> Just info + Nothing -> Nothing + +{- -} +getProgramInfoClass :: Program -> LSP.Position -> [AST.ClassDecl] -> Maybe ProgramInfo +getProgramInfoClass _ _ [] = Nothing +getProgramInfoClass program pos (x:xs) = do + -- Check if pos is singleton or range pos + case (ASTMeta.getPos (AST.cmeta x)) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + -- Check if pos is in class + case LSP.inRange pos (LSP.fromSourcePosRange start end) of + False -> getProgramInfoClass program pos xs + True -> do + -- Check if pos is in field decl + let fieldInfo = getProgramInfoFieldDecl program pos (AST.cfields x) + case fieldInfo of + Just info -> Just info + Nothing -> do + -- Check if pos is in method decl + let methodInfo = getProgramInfoMethodDecl program pos (AST.cmethods x) + case methodInfo of + Just info -> Just info + Nothing -> Nothing + +{- -} +getProgramInfoFieldDecl :: Program -> LSP.Position -> [AST.FieldDecl] -> (Maybe ProgramInfo) +getProgramInfoFieldDecl _ _ [] = Nothing +getProgramInfoFieldDecl program pos (x:xs) = Nothing + +{- -} +getProgramInfoMethodDecl :: Program -> LSP.Position -> [AST.MethodDecl] -> (Maybe ProgramInfo) +getProgramInfoMethodDecl _ _ [] = Nothing +getProgramInfoMethodDecl program pos (x:xs) = do + case AST.isImplicitMethod x of + True -> getProgramInfoMethodDecl program pos xs + False -> do + -- Check if pos is singleton or range pos + case (ASTMeta.getPos (AST.mmeta x)) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + -- Check if pos is in method + case LSP.inRange pos (LSP.fromSourcePosRange start end) of + False -> getProgramInfoMethodDecl program pos xs + True -> do + -- Check if pos is on paramDecl + let paramDeclInfo = getProgramInfoParamDecl program pos (AST.hparams $ AST.mheader x) + case paramDeclInfo of + Just info -> Just info + Nothing -> do + -- Check if pos is in body + let bodyInfo = getProgramInfoExpr program pos False (AST.mbody x) + case bodyInfo of + Just info -> Just info + Nothing -> do + -- Check if pos is in local function + let localFunInfo = getProgramInfoFunction program pos (AST.mlocals x) + case localFunInfo of + Just info -> Just info + Nothing -> Nothing + +getProgramInfoParamDecl :: Program -> LSP.Position -> [AST.ParamDecl] -> (Maybe ProgramInfo) +getProgramInfoParamDecl _ _ [] = Nothing +getProgramInfoParamDecl program pos (x:xs) = + -- Check if singleton or range pos + case (ASTMeta.getPos (AST.pmeta x)) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + -- Check if pos is on parameter + case LSP.inRange pos (LSP.fromSourcePosRange start end) of + False -> getProgramInfoParamDecl program pos xs + True -> do + let desc = "(parameter) " ++ (show (AST.pname x)) ++ ": " ++ (show (AST.ptype x)) + let range = (LSP.fromSourcePosRange start end) + Just $ makeProgramInfo desc range + +{- +@param range Contains range information about the entire declaration +-} +getProgramInfoDecls :: Program -> LSP.Position -> LSP.Range -> [([AST.VarDecl], AST.Expr)] -> (Maybe ProgramInfo) +getProgramInfoDecls _ _ _ [] = Nothing +getProgramInfoDecls program pos range (_decl:[]) = do + let expr = snd _decl + case ASTMeta.getPos (AST.emeta expr) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + let exprInfo = getProgramInfoExpr program pos False expr + case exprInfo of + Just info -> do + let exprRange = getProgramInfoRange info + case LSP.inRange pos exprRange of + True -> exprInfo + False -> do + let complimentRange = LSP.rangeCompliment range (getProgramInfoRange info) + Just $ makeProgramInfo (getProgramInfoDecl program pos _decl) complimentRange + Nothing -> do + let complimentRange = LSP.rangeCompliment range (LSP.fromSourcePosRange start end) + Just $ makeProgramInfo (getProgramInfoDecl program pos _decl) complimentRange +getProgramInfoDecls program pos _ _decls = getProgramInfoDeclsInner program pos _decls + +getProgramInfoDeclsInner :: Program -> LSP.Position -> [([AST.VarDecl], AST.Expr)] -> (Maybe ProgramInfo) +getProgramInfoDeclsInner _ _ [] = Nothing +getProgramInfoDeclsInner program pos (_decl:_decls) = do + let expr = snd _decl + case ASTMeta.getPos (AST.emeta expr) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + case LSP.inRange pos (LSP.fromSourcePosRange start end) of + False -> getProgramInfoDeclsInner program pos _decls + True -> getProgramInfoExpr program pos False expr + +getProgramInfoDecl :: Program -> LSP.Position -> ([AST.VarDecl], AST.Expr) -> String +getProgramInfoDecl _ pos _decl@(varDecls, expr) = do + (List.intercalate ", " (fmap (\x -> show (AST.varName x)) varDecls)) ++ ": " ++ (show (AST.getType expr)) + +getProgramInfoCall :: Program -> LSP.Position -> Bool -> [AST.Expr] -> String -> AST.Expr -> LSP.Range -> Types.Type -> (Maybe ProgramInfo) +getProgramInfoCall program pos isMsg args name target exprRange exprType = + case (ASTMeta.getPos (AST.getMeta target)) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos tstart tend -> do + let targetRange = LSP.fromSourcePosRange tstart tend + case LSP.inRange pos targetRange of + True -> getProgramInfoExpr program pos False target + False -> do + case LSP.inRange pos exprRange of + False -> Nothing + True -> + case getProgramInfoExprs program pos args of + Nothing -> do + let complimentRange = LSP.rangeCompliment exprRange targetRange + let desc = buildSignature name isMsg args exprType + Just $ makeProgramInfo desc complimentRange + Just argsInfo -> Just argsInfo + +getProgramInfoExpr :: Program -> LSP.Position -> Bool -> AST.Expr -> (Maybe ProgramInfo) +getProgramInfoExpr program pos ignorePos expr = do + -- Check if singleton or range pos + case (ASTMeta.getPos (AST.getMeta expr)) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + case expr of + AST.Skip meta + -> Nothing --Just $ makeProgramInfo "Skip" (LSP.fromSourcePosRange start end) + AST.Break meta + -> Just $ makeProgramInfoDebug "Break" (LSP.fromSourcePosRange start end) + AST.Continue meta + -> Just $ makeProgramInfoDebug "Continue" (LSP.fromSourcePosRange start end) + AST.TypedExpr meta body ty + -> Just $ makeProgramInfoDebug "TypedExpr" (LSP.fromSourcePosRange start end) + + AST.MethodCall meta tyArgs target name args + -> getProgramInfoCall program pos False args (show name) target (LSP.fromSourcePosRange start end) (AST.getType expr) + + AST.MessageSend meta tyArgs target name args + -> getProgramInfoCall program pos True args (show name) target (LSP.fromSourcePosRange start end) (AST.getType expr) + + AST.Optional meta optTag + -> Just $ makeProgramInfoDebug "Optional" (LSP.fromSourcePosRange start end) + AST.ExtractorPattern meta ty name arg + -> Just $ makeProgramInfoDebug "Extractorp attern" (LSP.fromSourcePosRange start end) + + AST.FunctionCall meta tyArgs name args + -> do + let exprRange = (LSP.fromSourcePosRange start end) + case LSP.inRange pos exprRange of + False -> Nothing + True -> + case getProgramInfoExprs program pos args of + Just argsInfo -> Just argsInfo + Nothing -> do + let desc = buildSignature (show name) False args (AST.getType expr) + Just $ makeProgramInfo desc exprRange + + AST.FunctionAsValue meta tyArgs name + -> Just $ makeProgramInfoDebug "Function as value" (LSP.fromSourcePosRange start end) + AST.Closure meta params maybeType body + -> Just $ makeProgramInfoDebug "Closure" (LSP.fromSourcePosRange start end) + AST.PartySeq meta par seqFun + -> Just $ makeProgramInfoDebug "PartySeq" (LSP.fromSourcePosRange start end) + AST.PartyPar meta parl parr + -> Just $ makeProgramInfoDebug "PartyPar" (LSP.fromSourcePosRange start end) + AST.PartyReduce meta seqFun init par runassoc + -> Just $ makeProgramInfoDebug "PartyReduce" (LSP.fromSourcePosRange start end) + AST.Async meta body + -> Just $ makeProgramInfoDebug "Async" (LSP.fromSourcePosRange start end) + AST.Return meta value + -> Just $ makeProgramInfoDebug "Return" (LSP.fromSourcePosRange start end) + AST.MaybeValue meta container + -> Just $ makeProgramInfoDebug "Maybe value" (LSP.fromSourcePosRange start end) + AST.Tuple meta args + -> Just $ makeProgramInfoDebug "Tuple" (LSP.fromSourcePosRange start end) + + AST.Let meta mutability _decls _body + -> do + -- Check if pos is in message send + let range = (LSP.fromSourcePosRange start end) + case LSP.inRange pos range of + False -> getProgramInfoExpr program pos False _body + True -> do + let declInfo = getProgramInfoDecls program pos range _decls + case declInfo of + Nothing -> getProgramInfoExpr program pos False _body + Just programInfo -> Just programInfo + + AST.MiniLet meta mutability decl + -> Just $ makeProgramInfoDebug "MiniLet" (LSP.fromSourcePosRange start end) + + AST.Seq meta eseq + -> do + -- Get body info + let innerInfo = getProgramInfoExprs program pos eseq + case {- Debug.trace ("SEQ - INNER INFO: " ++ show innerInfo ++ ", expr count: " ++ show (length eseq)) -} innerInfo of + Just info -> Just info + Nothing -> Nothing + + AST.IfThenElse meta cond thn els + -> Just $ makeProgramInfoDebug "IfThenElse" (LSP.fromSourcePosRange start end) + AST.IfThen meta cond thn + -> Just $ makeProgramInfoDebug "IfThen" (LSP.fromSourcePosRange start end) + AST.Unless meta cond thn + -> Just $ makeProgramInfoDebug "Unless" (LSP.fromSourcePosRange start end) + AST.While meta cond body + -> Just $ makeProgramInfoDebug "While" (LSP.fromSourcePosRange start end) + AST.DoWhile meta cond body + -> Just $ makeProgramInfoDebug "DoWhile" (LSP.fromSourcePosRange start end) + AST.Repeat meta name times body + -> Just $ makeProgramInfoDebug "Repeat" (LSP.fromSourcePosRange start end) + AST.For meta name step src body + -> Just $ makeProgramInfoDebug "For" (LSP.fromSourcePosRange start end) + AST.Match meta arg clauses + -> Just $ makeProgramInfoDebug "Match" (LSP.fromSourcePosRange start end) + AST.Borrow meta target name body + -> Just $ makeProgramInfoDebug "Borrow" (LSP.fromSourcePosRange start end) + AST.Get meta value + -> Just $ makeProgramInfoDebug "Get" (LSP.fromSourcePosRange start end) + AST.Forward meta forwardExpr + -> Just $ makeProgramInfoDebug "Forward" (LSP.fromSourcePosRange start end) + AST.Yield meta value + -> Just $ makeProgramInfoDebug "Yield" (LSP.fromSourcePosRange start end) + AST.Eos meta + -> Just $ makeProgramInfoDebug "EOS" (LSP.fromSourcePosRange start end) + AST.IsEos meta target + -> Just $ makeProgramInfoDebug "IsEOS" (LSP.fromSourcePosRange start end) + AST.StreamNext meta target + -> Just $ makeProgramInfoDebug "StreamNext" (LSP.fromSourcePosRange start end) + AST.Await meta value + -> Just $ makeProgramInfoDebug "Await" (LSP.fromSourcePosRange start end) + AST.Suspend meta + -> Just $ makeProgramInfoDebug "Suspend" (LSP.fromSourcePosRange start end) + AST.FutureChain meta future chain + -> Just $ makeProgramInfoDebug "FutureChain" (LSP.fromSourcePosRange start end) + AST.FieldAccess meta target name + -> Just $ makeProgramInfoDebug "FieldAccess" (LSP.fromSourcePosRange start end) + AST.ArrayAccess meta target name + -> Just $ makeProgramInfoDebug "ArrayAccess" (LSP.fromSourcePosRange start end) + AST.ArraySize meta target + -> Just $ makeProgramInfoDebug "ArraySize" (LSP.fromSourcePosRange start end) + AST.ArrayNew meta ty size + -> Just $ makeProgramInfoDebug "ArrayNew" (LSP.fromSourcePosRange start end) + AST.ArrayLiteral meta args + -> Just $ makeProgramInfoDebug "ArrayLiteral" (LSP.fromSourcePosRange start end) + AST.Assign emeta rhs lhs + -> Just $ makeProgramInfoDebug "Assign" (LSP.fromSourcePosRange start end) + + AST.VarAccess meta qname + -> do + -- Check if pos is in var access + let ty = (AST.getType expr) + case (LSP.inRange pos (LSP.fromSourcePosRange start end)) || ignorePos of + False -> Nothing + True -> do + let desc = (getTypeInfo ty) + let range = (LSP.fromSourcePosRange start end) + Just $ makeProgramInfo desc range + + AST.TupleAccess meta target compartment + -> Just $ makeProgramInfoDebug "TupleAccess" (LSP.fromSourcePosRange start end) + AST.Consume meta target + -> Just $ makeProgramInfoDebug "Consume" (LSP.fromSourcePosRange start end) + AST.Null meta + -> Just $ makeProgramInfoDebug "Null" (LSP.fromSourcePosRange start end) + AST.BTrue meta + -> Just $ makeProgramInfoDebug "True" (LSP.fromSourcePosRange start end) + AST.BFalse meta + -> Just $ makeProgramInfoDebug "False" (LSP.fromSourcePosRange start end) + + AST.NewWithInit meta ty args + -> do + let argsInfo = getProgramInfoExprs program pos args + case argsInfo of + Just _ -> argsInfo + Nothing -> do + case getConstructorFromType program ty of + Just methodInfo -> do + let constructorName = show $ AST.hname (AST.mheader methodInfo) + let signature = buildSignature constructorName False args ty + Just $ makeProgramInfo signature (LSP.fromSourcePosRange start end) + Nothing -> + -- will never happen cause there is always a default constructor + Just $ makeProgramInfoDebug "NewWithInit" (LSP.fromSourcePosRange start end) + + AST.New meta ty + -> Just $ makeProgramInfoDebug "New" (LSP.fromSourcePosRange start end) + AST.Print meta file args + -> do + let ty = (AST.getType expr) + case (LSP.inRange pos (LSP.fromSourcePosRange start end)) || ignorePos of + False -> Nothing + True -> do + let desc = "Print" --(getTypeInfo ty) + let range = (LSP.fromSourcePosRange start end) + Just $ makeProgramInfo desc range + + AST.Exit meta args + -> Just $ makeProgramInfoDebug "Exit" (LSP.fromSourcePosRange start end) + AST.Abort meta args + -> Just $ makeProgramInfoDebug "Abort" (LSP.fromSourcePosRange start end) + AST.StringLiteral meta literal + -> Just $ makeProgramInfoDebug "StringLiteral" (LSP.fromSourcePosRange start end) + AST.CharLiteral meta literal + -> Just $ makeProgramInfoDebug "CharLiteral" (LSP.fromSourcePosRange start end) + AST.RangeLiteral meta rstart rstop step + -> Just $ makeProgramInfoDebug "RangeLiteral" (LSP.fromSourcePosRange start end) + + AST.IntLiteral meta literal + -> do + case ASTMeta.getPos meta of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + let range = LSP.fromSourcePosRange start end + case LSP.inRange pos range of + True -> Just $ makeProgramInfoDebug "IntLiteral" (LSP.fromSourcePosRange start end) + False -> Nothing + + AST.UIntLiteral meta literal + -> Just $ makeProgramInfoDebug "UIntLiteral" (LSP.fromSourcePosRange start end) + AST.RealLiteral meta literal + -> Just $ makeProgramInfoDebug "RealLiteral" (LSP.fromSourcePosRange start end) + AST.Embed meta ty embedded + -> Just $ makeProgramInfoDebug "Embed" (LSP.fromSourcePosRange start end) + AST.Unary meta op operand + -> Just $ makeProgramInfoDebug "Unary op" (LSP.fromSourcePosRange start end) + + AST.Binop meta op loper roper + -> do + case ASTMeta.getPos (AST.getMeta loper) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos lstart lend -> do + -- are we in loper? + let lrange = LSP.fromSourcePosRange lstart lend + case LSP.inRange pos lrange of + True -> getProgramInfoExpr program pos False loper + False -> + case ASTMeta.getPos (AST.getMeta roper) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos rstart rend -> do + -- are we in roper? + let rrange = LSP.fromSourcePosRange rstart rend + case LSP.inRange pos rrange of + True -> getProgramInfoExpr program pos False roper + False -> do + let binopRange = LSP.fromSourcePosRange start end + let wholeRange = LSP.widestRange binopRange [lrange, rrange] + -- are we in the binop at all? + case LSP.inRange pos wholeRange of + False -> Nothing + True -> Just $ makeProgramInfoDebug "Binary op" wholeRange + +{- -} +getProgramInfoExprs :: Program -> LSP.Position -> [AST.Expr] -> (Maybe ProgramInfo) +getProgramInfoExprs _ _ [] = Nothing +getProgramInfoExprs program pos (x:xs) = + -- Check if singleton or range pos + case (ASTMeta.getPos (AST.getMeta x)) of + ASTMeta.SingletonPos _ -> handleSingletonPos + ASTMeta.RangePos start end -> do + let exprInfo = getProgramInfoExpr program pos False x + case {- Debug.trace ("BODY - EXPR INFO: " ++ show exprInfo ++ show (LSP.fromSourcePosRange start end)) -} exprInfo of + Just info -> Just info + Nothing -> getProgramInfoExprs program pos xs + +-- ###################################################################### -- +-- Section: Info Extracting +-- ###################################################################### -- + +getConstructorFromType :: Program -> Types.Type -> (Maybe AST.MethodDecl) +getConstructorFromType program ty = do + let classes = AST.classes (ast program) + case List.find (\x -> (show ty) == (show (AST.cname x))) classes of + Nothing -> Nothing + Just _classDecl -> do + let methods = AST.cmethods _classDecl + case List.find AST.isConstructor methods of + Nothing -> Nothing + Just _constructor -> Just _constructor + + +-- ###################################################################### -- +-- Section: Type functions +-- ###################################################################### -- + +{- -} +getTypeInfo :: Types.Type -> String +getTypeInfo ty = + -- Pattern-match the inner type + case Types.getInnerType ty of + Types.Unresolved refInfo -> + "Unresolved type" + Types.ClassType refInfo _ _ -> + case (Types.getRefInfoMode refInfo) of + Nothing -> "class" ++ (Types.getId ty) + Just m -> (show m) ++ " class " ++ (Types.getId ty) + _ -> + show ty ++ " (default)" + +{- -} +buildSignatureParamType :: AST.Expr -> String +buildSignatureParamType expr = show (AST.getType expr) + +{- -} +buildSignatureParamList :: [AST.Expr] -> String +buildSignatureParamList [] = "" +buildSignatureParamList (x:[]) = (buildSignatureParamType x) +buildSignatureParamList (x:xs) = + (buildSignatureParamType x) ++ ", " ++ (buildSignatureParamList xs) + +{- -} +buildSignatureReturnType :: Bool -> Types.Type -> String +buildSignatureReturnType isMsg ret = + -- Check if message or standard call + case isMsg of + False -> show ret + True -> do + -- Get the type contained in future + case Types.getInnerType ret of + Types.FutureType resType -> show resType + _ -> "[INVALID MESSAGE RESULT]" + +{- -} +buildSignature :: String -> Bool -> [AST.Expr] -> Types.Type -> String +buildSignature name isMsg argTypes ret = + name ++ "(" ++ (buildSignatureParamList argTypes) ++ "): " ++ (buildSignatureReturnType isMsg ret) + +-- ###################################################################### -- +-- Section: Debug functions +-- ###################################################################### -- + +{- -} +dumpProgramErrors :: Program -> IO () +dumpProgramErrors program = do + case (length $ errors program) > 0 || (length $ warnings program) > 0 of + True -> do + putStrLn $ "Errors and warnings for " ++ (AST.source (ast program)) + mapM_ (\x -> putStrLn $ show x) (errors program) + mapM_ (\x -> putStrLn $ show x) (warnings program) + putStrLn "" + False -> return () + +-- ###################################################################### -- +-- Section: Debug functions +-- ###################################################################### -- + +instance Show ProgramInfo where + show (ProgramInfo pDesc pRange False) = pDesc ++ (show pRange) + show (ProgramInfo pDesc pRange True) = pDesc ++ (show pRange) ++ " (debug)" diff --git a/src/lsp/LSP/Data/State.hs b/src/lsp/LSP/Data/State.hs new file mode 100644 index 000000000..3c95fefd4 --- /dev/null +++ b/src/lsp/LSP/Data/State.hs @@ -0,0 +1,75 @@ +module LSP.Data.State ( + LSPState(..), + initial, + lookupTextDocument, + addTextDocument, + closeTextDocument, + changeTextDocument, + produceTextDocument, + compileDocument, + getProgram +) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Standard +import Data.Map as Map hiding (foldr) + +-- LSP +import LSP.Data.TextDocument +import LSP.Data.Program +import LSP.Data.DataMap +import LSP.Producer + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +data LSPState = LSPState { + programs :: DataMap +} deriving (Show) + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +initial :: LSPState +initial = LSPState { + programs = Map.empty +} + +lookupTextDocument :: String -> LSPState -> Maybe (TextDocument) +lookupTextDocument uri state = + case Map.lookup uri (programs state) of + Just res -> Just $ snd res + Nothing -> Nothing + +addTextDocument :: TextDocument -> LSPState -> LSPState +addTextDocument newDocument (LSPState programs) = + LSPState (Map.insert (uri newDocument) (makeBlankProgram (uri newDocument), newDocument) programs) + +closeTextDocument :: TextDocumentIdent -> LSPState -> LSPState +closeTextDocument ident = LSPState . Map.delete (uri ident) . programs + +changeTextDocument :: TextDocumentChange -> LSPState -> LSPState +changeTextDocument documentChange state@(LSPState programs) = + case Map.lookup (uri documentChange) programs of + Nothing -> state + Just (program, textDocument) -> + LSPState $ Map.insert (uri documentChange) + (program, applyTextDocumentChange documentChange textDocument) + programs + +produceTextDocument :: TextDocument -> LSPState -> IO (LSPState) +produceTextDocument textDocument state = do + let path = uri textDocument + dataMap <- produceAndUpdateState path (programs state) + return (LSPState {programs = dataMap}) + +compileDocument :: String -> LSPState -> IO LSPState +compileDocument path = fmap LSPState . produceAndUpdateState path . programs + +getProgram :: String -> LSPState -> Maybe Program +getProgram path = fmap fst . Map.lookup path . programs diff --git a/src/lsp/LSP/Data/TextDocument.hs b/src/lsp/LSP/Data/TextDocument.hs new file mode 100644 index 000000000..7050e38ed --- /dev/null +++ b/src/lsp/LSP/Data/TextDocument.hs @@ -0,0 +1,191 @@ +{-# LANGUAGE OverloadedStrings #-} + +module LSP.Data.TextDocument ( + TextDocument(..), + TextDocumentClose(..), + TextDocumentChange(..), + TextDocumentIdent(..), + uri, + version, + applyTextDocumentChange, + makeBlankTextDocument +) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Standard +import Data.Aeson +import Data.String.Utils (split, join) + +-- LSP +import LSP.Data.Position + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +data TextDocument = TextDocument { + tdUri :: String, + tdVersion :: Int, + tdLanguageId :: String, + tdContents :: String +} deriving (Show) + +data TextDocumentClose = TextDocumentClose { + tdclIdentifier :: TextDocumentIdent +} deriving (Show) + +data TextDocumentChange = TextDocumentChange { + tdcIdentifier :: TextDocumentIdentVersion, + tdcChanges :: [TextDocumentContentChange] +} deriving (Show) + +data TextDocumentIdent = TextDocumentIdent { + tdiUri :: String +} deriving (Show) + +data TextDocumentIdentVersion = TextDocumentIdentVersion { + tdivUri :: String, + tdivVersion :: Int +} deriving (Show) + +data TextDocumentContentChange = TextDocumentContentChange { + tdccRange :: Range, + tdccRangeLength :: Int, + tdccText :: String +} deriving (Show) + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +applyTextDocumentChange :: TextDocumentChange -> TextDocument -> TextDocument +applyTextDocumentChange textDocumentChange textDocument = + foldr (\change textDocument -> + TextDocument { + tdUri = tdUri textDocument, + tdVersion = tdivVersion $ tdcIdentifier textDocumentChange, + tdLanguageId = tdLanguageId textDocument, + tdContents = applyTextChange (tdccRange change) + (tdccText change) + (tdContents textDocument) + } + ) textDocument $ tdcChanges textDocumentChange + +applyTextChange :: Range -> String -> String -> String +applyTextChange _ replacement "" = replacement +applyTextChange a@((startLine, startChar), (endLine, endChar)) + replacement + text + = let textLines = split "\n" text + clamp = max 0 . min (length textLines - 1) + boundedStartLine = clamp startLine + boundedEndLine = clamp endLine + startSegment = join "\n" $ take startLine textLines ++ + [take startChar $ textLines !! boundedStartLine] + endSegment = join "\n" $ (drop endChar $ textLines !! boundedEndLine) : + drop (endLine+1) textLines + in startSegment ++ replacement ++ endSegment + +makeBlankTextDocument :: String -> TextDocument +makeBlankTextDocument name = TextDocument{ + tdUri = name, + tdVersion = 1, + tdLanguageId = "encore", + tdContents = "" +} + +-- ###################################################################### -- +-- Section: Type Classes +-- ###################################################################### -- + +class TextDocumentURI a where + uri :: a -> String +class TextDocumentVersion a where + version :: a -> Int + +instance TextDocumentURI TextDocument where + uri = tdUri +instance TextDocumentVersion TextDocument where + version = tdVersion + +instance TextDocumentURI TextDocumentChange where + uri = uri . tdcIdentifier +instance TextDocumentVersion TextDocumentChange where + version = version . tdcIdentifier + +instance TextDocumentURI TextDocumentIdent where + uri = tdiUri + +instance TextDocumentURI TextDocumentIdentVersion where + uri = tdivUri +instance TextDocumentVersion TextDocumentIdentVersion where + version = tdivVersion + +instance FromJSON TextDocument where + parseJSON = withObject "params" $ \o -> do + document <- o .: "textDocument" + uri <- document .: "uri" + version <- document .: "version" + id <- document .: "languageId" + text <- document .: "text" + return TextDocument { + tdUri = uri, + tdVersion = version, + tdLanguageId = id, + tdContents = text + } + +instance FromJSON TextDocumentClose where + parseJSON = withObject "params" $ \o -> do + identifier <- o .: "textDocument" + + return TextDocumentClose { + tdclIdentifier = identifier + } + +instance FromJSON TextDocumentChange where + parseJSON = withObject "params" $ \o -> do + identifier <- o .: "textDocument" + changes <- o .: "contentChanges" + + return TextDocumentChange { + tdcIdentifier = identifier, + tdcChanges = changes + } + +instance FromJSON TextDocumentContentChange where + parseJSON = withObject "TextDocumentChange" $ \o -> do + range <- o .: "range" + rangeStart <- range .: "start" + startLine <- rangeStart .: "line" + startChar <- rangeStart .: "character" + rangeEnd <- range .: "end" + endLine <- rangeEnd .: "line" + endChar <- rangeEnd .: "character" + rangeLength <- o .: "rangeLength" + text <- o .: "text" + + return TextDocumentContentChange { + tdccRange = ((startLine, startChar), (endLine, endChar)), + tdccRangeLength = rangeLength, + tdccText = text + } + +instance FromJSON TextDocumentIdent where + parseJSON = withObject "textDocumentIdentifier" $ \o -> do + uri <- o .: "uri" + return TextDocumentIdent { + tdiUri = uri + } + +instance FromJSON TextDocumentIdentVersion where + parseJSON = withObject "textDocumentIdentifier" $ \o -> do + uri <- o .: "uri" + version <- o .: "version" + return TextDocumentIdentVersion { + tdivUri = uri, + tdivVersion = version + } diff --git a/src/lsp/LSP/JSONRPC.hs b/src/lsp/LSP/JSONRPC.hs new file mode 100644 index 000000000..d69c14a83 --- /dev/null +++ b/src/lsp/LSP/JSONRPC.hs @@ -0,0 +1,110 @@ +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE FlexibleInstances #-} + +{- | +Module : LSP.JSONRPC +-} + +module LSP.JSONRPC ( + ClientMessage(..), + ServerMessage(..), + Error(..), + + parseMessage, encodeMessage, + + parseError, invalidRequest, methodNotFound, invalidParams, internalError +) where + +import Data.Aeson hiding (Error) +import qualified Data.ByteString.Lazy.Char8 as BS +import GHC.Generics + +data ClientMessage + = Request { + crMsgID :: Value, + crMethod :: String, + crParams :: Maybe Value + } + | ClientNotification { + cnMethod :: String, + cnParams :: Maybe Value + } deriving (Generic, Show) + +data ServerMessage + = Response { + srMsgID :: Value, + srResult :: Value + } + | ErrorResponse { + seMsgID :: Maybe Value, + seError :: Error + } + | ServerNotification { + snMethod :: String, + snParams :: Maybe Value + } deriving (Generic, Show) + +data Error + = Error { + code :: Integer, + message :: String, + errData :: Maybe Value + } + deriving (Generic, Show) + +parseMessage :: String -> Either String [ClientMessage] +parseMessage input = + case (eitherDecode $ BS.pack input) :: Either String ClientMessage of + Right msg -> Right [msg] + Left e -> + case (eitherDecode $ BS.pack input) :: Either String [ClientMessage] of + Right [] -> Left e + Left _ -> Left e + Right msgs -> Right msgs + +encodeMessage :: ServerMessage -> String +encodeMessage = BS.unpack . encode + +parseError = -32700 +invalidRequest = -32600 +methodNotFound = -32601 +invalidParams = -32602 +internalError = -32603 + +instance FromJSON ClientMessage where + parseJSON = withObject "Request/Notification" $ \o -> do + jsonrpc <- o .: "jsonrpc" + msgID <- o .:? "id" + method <- o .: "method" + params <- o .:? "params" + if jsonrpc /= "2.0" + then fail $ "field \"jsonrpc\" must be \"2.0\", got \"" ++ jsonrpc ++ "\"" + else case msgID of + Just msgID -> return $ Request msgID method params + Nothing -> return $ ClientNotification method params + +instance ToJSON ServerMessage where + toJSON (Response msgID result) = + object $ [ + "jsonrpc" .= ("2.0" :: String), + "id" .= msgID, + "result" .= result] + toJSON (ErrorResponse msgID error) = + object $ [ + "jsonrpc" .= ("2.0" :: String), + "id" .= msgID, + "error" .= error] + toJSON (ServerNotification method params) = + object $ [ + "jsonrpc" .= ("2.0" :: String), + "method" .= method, + "params" .= params] + +instance ToJSON Error where + toJSON (Error code message errData) = + object $ [ + "jsonrpc" .= ("2.0" :: String), + "code" .= code, + "message" .= message, + "data" .= errData ] diff --git a/src/lsp/LSP/LSP.hs b/src/lsp/LSP/LSP.hs new file mode 100644 index 000000000..b13858043 --- /dev/null +++ b/src/lsp/LSP/LSP.hs @@ -0,0 +1,223 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module LSP.LSP ( + handleClient +) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Standard +import Data.Aeson as Aeson +import Data.Aeson.Types +import Data.Text (pack) +import System.IO +import Control.Monad.State +import Debug.Trace as Debug + +-- LSP +import qualified LSP.Base as Base +import LSP.JSONRPC as JSONRPC +import LSP.Data.State as State +import LSP.Data.TextDocument as TextDocument +import LSP.Data.Hover (Hover(..)) +import qualified LSP.Data.Hover as Hover +import LSP.Data.Diagnostic as Diagnostic +import LSP.Data.Program as Program +import LSP.Producer (produceAndUpdateState) + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +decodeMessageStream :: String -> ([Either String JSONRPC.ClientMessage], Maybe String) +decodeMessageStream input = + let (message, e) = Base.parsePackets input + requestBatches = map (JSONRPC.parseMessage . Base.content) message + requests = concat $ map (either ((:[]) .Left) (map Right)) requestBatches + in (requests, e) + +encodeMessageStream :: [JSONRPC.ServerMessage] -> String +encodeMessageStream responses = + let responseMessages = map (Base.LSPPacket [] . JSONRPC.encodeMessage) responses + in concat $ map Base.encodeMessage responseMessages + +handleClient :: Handle -> Handle -> IO () +handleClient input output = + do inputStream <- hGetContents input + let (requests, e) = decodeMessageStream inputStream + sendResponses output State.initial $ map handleRequest requests + return () + +sendResponses :: Handle -> LSPState -> [StateT LSPState IO [ServerMessage]] -> IO () +sendResponses _ _ [] = return () +sendResponses output state (a:bs) = + do (responses, nextState) <- runStateT a state + hPutStr output $ encodeMessageStream responses + sendResponses output nextState bs + +modifyM :: (Monad m, MonadTrans t, MonadState s (t m)) => (s -> m s) -> t m () +modifyM f = do s <- get + s <- lift $ f s + put s + +{- Uses the regular handleRequest but prints the request and response messages as well. -} +debugHandleRequest :: Either String JSONRPC.ClientMessage -> + StateT LSPState IO [ServerMessage] +debugHandleRequest request = + do lift $ putStrLn $ "got request: " ++ show request + state <- get + (responses, newState) <- lift $ runStateT (handleRequest request) state + put newState + lift $ putStrLn $ "sending responses: " ++ show responses + return responses + +handleRequest :: Either String JSONRPC.ClientMessage -> + StateT LSPState IO [ServerMessage] +handleRequest (Left e) + = return [ + JSONRPC.ErrorResponse { + seMsgID = Nothing, + seError = JSONRPC.Error JSONRPC.parseError e Nothing + } + ] + +handleRequest (Right (Request msgID "initialize" params)) + = (lift $ putStrLn "init") >> return [ + ServerNotification { + snMethod = "window/showMessage", + snParams = Just $ object [ + ("type", Number 3), -- info + ("message", "LSP - Hello world!") + ] + }, + Response { + srMsgID = msgID, + srResult = object [ + ("capabilities", object [ + ("textDocumentSync", Number 2), -- Incremental + ("hoverProvider", Bool True) + ]) + ] + } + ] + +handleRequest (Right (ClientNotification "textDocument/didOpen" params)) + = case fmap fromJSON params of + Just (Success document) -> + do modify $ State.addTextDocument document + modifyM $ State.compileDocument (uri document) + + program <- fmap (getProgram $ uri document) get + case program of + Just p -> + return [ + ServerNotification { + snMethod = "textDocument/publishDiagnostics", + snParams = Just $ toJSON $ PublishDiagnosticsParams { + pdpUri = uri document, + pdpDiagnostics = map errorToDiagnostic $ errors p + } + } + ] + Nothing -> return [] + Just (Aeson.Error err) -> return [] + Nothing -> return [] + +handleRequest (Right (ClientNotification "textDocument/didClose" params)) + = case fmap fromJSON params of + Just (Success documentIdent) -> + do lift $ putStrLn $ "close " ++ (show documentIdent) + modify $ State.closeTextDocument (tdclIdentifier documentIdent) + return [] + Just (Aeson.Error err) -> return [] + Nothing -> return [] + +handleRequest (Right (ClientNotification "textDocument/didChange" params)) + = case fmap fromJSON params of + Just (Success documentChange) -> + do modify $ State.changeTextDocument documentChange + modifyM $ State.compileDocument (uri documentChange) + + program <- fmap (getProgram $ uri documentChange) get + case program of + Just p -> + return [ + ServerNotification { + snMethod = "textDocument/publishDiagnostics", + snParams = Just $ toJSON $ PublishDiagnosticsParams { + pdpUri = uri documentChange, + pdpDiagnostics = map errorToDiagnostic $ errors p + } + } + ] + Nothing -> return [] + Just (Aeson.Error err) -> + do lift $ putStrLn $ show err + return [] + Nothing -> return [] + +handleRequest (Right (Request msgID "textDocument/hover" params)) + = case fmap fromJSON params of + Just (Success posParams) -> + do state <- get + case State.getProgram (Hover.uri posParams) state >>= + getProgramInfoForPos ({- Debug.trace ("hover pos: " ++ show (Hover.position posParams)) -} (Hover.position posParams)) of + Nothing -> + return [ + Response { + srMsgID = {- Debug.trace "hover nothing: " -} msgID, + srResult = Null + } + ] + Just info -> + return [ + Response { + srMsgID = {- Debug.trace "hover just: " -} msgID, + srResult = toJSON $ Hover { + Hover.contents = pDesc info, + Hover.range = pRange info + } + } + ] + Just (Aeson.Error err) -> return [] + Nothing -> return [] + +{- ignored notifications -} +handleRequest (Right (ClientNotification "initialized" _)) = return [] +handleRequest (Right (ClientNotification "$/cancelRequest" _)) = return [] +handleRequest (Right (ClientNotification "textDocument/didSave" _)) = return [] +handleRequest (Right (ClientNotification "workspace/didChangeConfiguration" _)) = return [] +handleRequest (Right (ClientNotification method params)) + = return [ + showMessage MessageInfo $ "Unknown notification from client: " ++ (show method) + ] + +handleRequest (Right (Request msgID method params)) + = return [ + showMessage MessageError $ "Unknown request from client: " ++ (show method), + ErrorResponse { + seMsgID = Just msgID, + seError = JSONRPC.Error JSONRPC.methodNotFound "method not found" Nothing + } + ] + + + +data ServerMessageLevel = MessageError | + MessageWarning | + MessageInfo | + MessageLog + deriving (Enum) + +showMessage :: ServerMessageLevel -> String -> ServerMessage +showMessage level msg = + JSONRPC.ServerNotification { + snMethod = "window/showMessage", + snParams = Just $ object [ + "type" .= (1 + fromEnum level), + "message" .= msg + ] + } diff --git a/src/lsp/LSP/Producer.hs b/src/lsp/LSP/Producer.hs new file mode 100644 index 000000000..195d067cf --- /dev/null +++ b/src/lsp/LSP/Producer.hs @@ -0,0 +1,232 @@ +{-# LANGUAGE TemplateHaskell #-} + +module LSP.Producer ( + produceAndUpdateState +) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Library +import Text.Megaparsec + +-- Standard +import qualified Data.List.NonEmpty as NE(head) +import Language.Haskell.TH +import System.Environment +import System.Exit +import qualified Data.Map.Strict as Map +import Control.Monad +import Data.List +import Debug.Trace as Debug + +-- Encore +import Parser.Parser +import qualified AST.AST as AST +import AST.Desugarer +import AST.PrettyPrinter +import ModuleExpander +import Typechecker.Environment +import Typechecker.Prechecker(precheckProgram) +import Typechecker.Typechecker(typecheckProgram, checkForMainClass) +import Typechecker.Capturechecker(capturecheckProgram) +import Typechecker.TypeError +import Utils + +-- LSP +import LSP.Data.TextDocument +import LSP.Data.Error +import LSP.Data.DataMap +import LSP.Data.Program + +-- ###################################################################### -- +-- Section: Support +-- ###################################################################### -- + +-- the following line of code resolves the standard path at compile time using Template Haskell +standardLibLocation = $(stringE . init =<< runIO (System.Environment.getEnv "ENCORE_MODULES" )) + +preludePaths = + [standardLibLocation ++ "/standard", standardLibLocation ++ "/prototype"] + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +--type ProgramMap = Map FilePath Program + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +produceAndUpdateState :: FilePath -> DataMap -> IO (DataMap) +produceAndUpdateState path dataMap = do + case Map.lookup path dataMap of + Nothing -> return (dataMap) + Just (program, textDocument) -> do + let source = tdContents textDocument + -- Parse program to produce AST + (_ast, error) <- case parseEncoreProgram path $ {- Debug.trace ("source: " ++ source) -} source of + Right ast -> return (ast, Nothing) + Left error -> return ((makeBlankAST path), Just error) + + case error of + Just e -> do + --print "Failed to parse program" + let lspError = fromParsecError e + newProgram <- case Map.lookup path dataMap of + Just oldProgram -> do + return Program { + ast = {- Debug.trace "found old program" $ -} ast (fst oldProgram), + errors = [lspError], + warnings = [] + } + + Nothing -> do + return Program { + ast = {- Debug.trace "found nothing" -} _ast, + errors = [lspError], + warnings = [] + } + + let newDataMap = Map.insert path (newProgram, textDocument) dataMap + return (newDataMap) + Nothing -> do + -- Build program table from AST + programTable <- buildProgramTable preludePaths preludePaths $ {- Debug.trace "success" -} _ast + let desugaredTable = fmap desugarProgram programTable + + -- Convert the desugared table into a LSPState + let newDataMap = convertFromProgramTable path desugaredTable + + -- Precheck and typecheck the table + precheckedTable <- producerPrecheck newDataMap + newDataMap <- case hasErrorInDataMap precheckedTable of + True -> return precheckedTable + False -> do + typecheckedTable <- producerTypecheck precheckedTable + case hasErrorInDataMap typecheckedTable of + True -> return typecheckedTable + False -> producerCapturecheck typecheckedTable + + let cleanedMap = cleanDataMap newDataMap + return (magicMerger dataMap cleanedMap) + +cleanDataMap :: DataMap -> DataMap +cleanDataMap dataMap = + Map.mapKeys cleanKey dataMap + where + cleanKey :: String -> String + cleanKey key + | isPrefixOf "./" key = drop 2 key + | otherwise = key + +magicMerger :: DataMap -> DataMap -> DataMap +magicMerger old new = + Map.unionWith magicAux old new + where + magicAux :: LSPData -> LSPData -> LSPData + magicAux _old _new = + case (length (errors (fst _new))) > 0 of + False -> (fst _new, snd _old) + True -> (Program { + ast = ast (fst _old), + errors = errors (fst _new), + warnings = warnings (fst _new) + }, + snd _old) + +convertFromProgramTable :: FilePath -> ProgramTable -> DataMap +convertFromProgramTable path table = + fmap (convertFromProgram path) table + +convertFromProgram :: FilePath -> AST.Program -> LSPData +convertFromProgram path _ast = + (Program {ast = _ast, errors = [], warnings = []}, makeBlankTextDocument path) + +convertToProgramTable :: DataMap -> ProgramTable +convertToProgramTable map = + fmap convertToProgram map + +convertToProgram :: LSPData -> AST.Program +convertToProgram (_program, textDocument) = ast _program + +-- ###################################################################### -- +-- Section: Type checking +-- ###################################################################### -- + +producerPrecheckProgram :: (Map.Map FilePath LookupTable) -> LSPData -> IO (LSPData) +producerPrecheckProgram lookupTable lspData@(oldProgram, textDocument) = do + case precheckProgram lookupTable (convertToProgram lspData) of + (Right newProgram, newWarnings) -> + return (Program { + ast = newProgram, + errors = [], + warnings = fromTCWarnings newWarnings + }, textDocument) + (Left error, newWarnings)-> + return (Program { + ast = ast oldProgram, + errors = [fromTCError error], + warnings = fromTCWarnings newWarnings + }, textDocument) + +producerPrecheck :: DataMap -> IO (DataMap) +producerPrecheck programTable = do + let lookupTable = fmap buildLookupTable (convertToProgramTable programTable) + mapM (_producerPrecheck lookupTable) programTable + where + _producerPrecheck lookupTable program = do + (precheckedProgram) <- (producerPrecheckProgram lookupTable program) + return (precheckedProgram) + +producerTypecheckProgram :: (Map.Map FilePath LookupTable) -> LSPData -> IO (LSPData) +producerTypecheckProgram lookupTable lspData@(oldProgram, textDocument) = do + case typecheckProgram lookupTable (convertToProgram lspData) of + (Right (_, newProgram), newWarnings) -> + return (Program { + ast = newProgram, + errors = [], + warnings = fromTCWarnings newWarnings + }, textDocument) + (Left error, newWarnings)-> + return (Program { + ast = ast oldProgram, + errors = [fromTCError error], + warnings = fromTCWarnings newWarnings + }, textDocument) + +producerTypecheck :: DataMap -> IO (DataMap) +producerTypecheck programTable = do + let lookupTable = fmap buildLookupTable (convertToProgramTable programTable) + mapM (_producerTypecheck lookupTable) programTable + where + _producerTypecheck lookupTable program = do + (typecheckedProgram) <- (producerTypecheckProgram lookupTable program) + return (typecheckedProgram) + +producerCapturecheckProgram :: (Map.Map FilePath LookupTable) -> LSPData -> IO (LSPData) +producerCapturecheckProgram lookupTable lspData@(oldProgram, textDocument) = do + case capturecheckProgram lookupTable (convertToProgram lspData) of + (Right (_, newProgram), newWarnings) -> + return (Program { + ast = newProgram, + errors = [], + warnings = fromTCWarnings newWarnings + }, textDocument) + (Left error, newWarnings)-> + return (Program { + ast = ast oldProgram, + errors = [fromTCError error], + warnings = fromTCWarnings newWarnings + }, textDocument) + +producerCapturecheck :: DataMap -> IO (DataMap) +producerCapturecheck programTable = do + let lookupTable = fmap buildLookupTable (convertToProgramTable programTable) + mapM (_producerCapturecheck lookupTable) programTable + where + _producerCapturecheck lookupTable program = do + (capturecheckedProgram) <- (producerCapturecheckProgram lookupTable program) + return (capturecheckedProgram) diff --git a/src/lsp/LSP/ServerTest.hs b/src/lsp/LSP/ServerTest.hs new file mode 100644 index 000000000..df012e812 --- /dev/null +++ b/src/lsp/LSP/ServerTest.hs @@ -0,0 +1,93 @@ +module LSP.ServerTest (testServer) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Haskell imports +import Control.Monad (forever) +import Control.Concurrent (forkIO) +import qualified Data.Map.Strict as Map +import Data.List +import Network +import System.IO + +-- Encore imports +import ModuleExpander +import AST.AST +import AST.PrettyPrinter + +-- LSP imports +import LSP.LSP +import LSP.Producer +import LSP.Data.State +import LSP.Data.TextDocument +import LSP.Data.Program + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +getProgramFromStdioAux :: String -> IO (String) +getProgramFromStdioAux input + | input == ['\n'] = return ['\n'] + | otherwise = do + a <- getProgramFromStdio + return $ input ++ ['\n'] ++ a + +getProgramFromStdio :: IO (String) +getProgramFromStdio = do + ok <- hIsEOF stdin + if ok then do + return [] + else do + input <- getLine + getProgramFromStdioAux input + +testServer :: IO () +testServer = do + -- run like this: cat playground/main.enc | encorec -s stdio + program <- getProgramFromStdio + let textDocument = TextDocument { + tdUri = "magic", + tdVersion = 1, + tdLanguageId = "encore", + tdContents = program + } + + -- Produce program and dump errors + let lspState = addTextDocument textDocument initial + newState <- produceTextDocument textDocument lspState + mapM_ (\x -> dumpProgramErrors $ fst x) (programs newState) + + -- Do a test lookup + case Map.lookup "magic" (programs newState) of + Just prog -> do + case getProgramInfoForPos (3, 6) (fst prog) of + Just info -> do + let posInfo = ", at pos: " ++ show (getProgramInfoRange info) + print $ (getProgramInfoDescription info) ++ posInfo + Nothing -> print $ "No program info found" + --putStrLn $ show (ppProgram (ast $ fst prog)) -- putStrLn $ show (ast $ fst prog) + --putStrLn $ show (contents (snd prog)) + Nothing -> print "hey" + + + + + ------------------------- ||| ---------------------------------------- + +{- + progTable <- produceProgramFromSource ":srv:" program + + let db = updateProgramTable makeDatabase progTable + + print $ "Size: " ++ show (Map.size $ getDatabasePrograms db) + + case lookupClass db ":srv:" "Main" of + Just cd -> do + print "Found class" + Nothing -> do + print "Did not found class" +-} + return () diff --git a/src/lsp/LSP/Service.hs b/src/lsp/LSP/Service.hs new file mode 100644 index 000000000..3667f1aee --- /dev/null +++ b/src/lsp/LSP/Service.hs @@ -0,0 +1,70 @@ +module LSP.Service ( + startServer, + ConnectionParams(..) +) where + +-- ###################################################################### -- +-- Section: Imports +-- ###################################################################### -- + +-- Haskell imports +import Control.Monad (forever) +import Control.Concurrent (forkIO) +import qualified Data.Map.Strict as Map +import Data.List +import Network +import System.IO + +-- Encore imports +import ModuleExpander +import AST.AST + +-- LSP imports +import LSP.LSP +import LSP.ServerTest + +-- ###################################################################### -- +-- Section: Data +-- ###################################################################### -- + +{- +-} +data ConnectionParams + = STDIO + | TCPServer Integer + | TCPClient String Integer + deriving (Show) + +-- ###################################################################### -- +-- Section: Functions +-- ###################################################################### -- + +{- Start the Encore compiler in LSP mode. This will handle events from +a client and handle them accordingly. +Param: ConnectionParams specifying mode and possibly host and port +-} +startServer :: ConnectionParams -> IO () +startServer STDIO = do + testServer + return () + + hSetBuffering stdout NoBuffering + handleClient stdin stdout + +startServer (TCPServer port) = do + sock <- listenOn $ PortNumber $ fromInteger port + putStrLn $ "listening on " ++ (show port) + forever $ do + (client, addr, _) <- accept sock + putStrLn $ "connection from " ++ (show addr) + + forkIO $ do hSetBuffering client NoBuffering + handleClient client client + +startServer (TCPClient host port) = do + putStrLn $ "connecting to " ++ (show host) ++ " :" ++ (show port) + + sock <- connectTo host $ PortNumber $ fromInteger port + + hSetBuffering sock NoBuffering + handleClient sock sock diff --git a/src/types/Types.hs b/src/types/Types.hs index b4ab40748..7677ad86c 100644 --- a/src/types/Types.hs +++ b/src/types/Types.hs @@ -1,6 +1,8 @@ {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Types( Type + ,InnerType(..) + ,Mode(..) ,arrowType ,arrowWithTypeParam ,isArrowType @@ -139,6 +141,9 @@ module Types( ,isUnsafeSingleType ,makeStackbound ,isStackboundType + + ,getInnerType + ,getRefInfoMode ) where import Identifiers @@ -228,6 +233,9 @@ data RefInfo = RefInfo{refId :: String ,refSourceFile :: Maybe FilePath } +getRefInfoMode :: RefInfo -> Maybe Mode +getRefInfoMode info = (mode info) + -- The current modes are irrelevant for equality checks instance Eq RefInfo where ref1 == ref2 = refId ref1 == refId ref2 && @@ -347,6 +355,9 @@ data InnerType = | BottomType deriving(Eq) +getInnerType :: Type -> InnerType +getInnerType t@Type{inner} = inner + applyInner f ty@Type{inner} = ty{inner = f inner} applyInnerRefInfo f ty@Type{inner} | isRefAtomType ty || isTypeSynonym ty From d1642a5b1ed19735232dcc66059dde2057b492d0 Mon Sep 17 00:00:00 2001 From: Christoffer Gustafsson Date: Wed, 8 Aug 2018 12:54:33 -0700 Subject: [PATCH 2/2] Updated tests to match current rangepos string representation. --- src/tests/encore/forward/forwardTypeMismatch.fail | 2 +- src/tests/encore/match/missing.err | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/encore/forward/forwardTypeMismatch.fail b/src/tests/encore/forward/forwardTypeMismatch.fail index 6dc4a2c57..512bae3a5 100644 --- a/src/tests/encore/forward/forwardTypeMismatch.fail +++ b/src/tests/encore/forward/forwardTypeMismatch.fail @@ -1 +1 @@ -"forwardTypeMismatch.enc" (line 8, column 22) +forwardTypeMismatch.enc (8,22) to (8,28) diff --git a/src/tests/encore/match/missing.err b/src/tests/encore/match/missing.err index 1a661c478..555ce5589 100644 --- a/src/tests/encore/match/missing.err +++ b/src/tests/encore/match/missing.err @@ -1 +1 @@ -*** Runtime error: No matching clause was found at "missing.enc" (line 3, column 5) *** +*** Runtime error: No matching clause was found at missing.enc (3,5) to (7,8) ***