Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 76 lines (62 sloc) 2.802 kB
f756a13 @JPMoresmau turn off output during build
authored
1 # BW-DB
2
3 A database approach to EclipseFP and buildwrapper
4
5 ## Goals
6 - find all usages of a symbol
7 in particular project
8 in workspace
9 - open a module anywhere in the workspace
10
11 -> enables
12 - haskell sensitive searches
13 - haskell sensitive renames
14 - remove unused packages in dependencies
15
16 ## BuildWrapper
17 BuildWrapper can already provide usage info on one file
18 - load a single file and dependant in the API
19 - get AST and generate JSON
20 - stores it in .bwinfo file
21 -> but we need it at the project level since
22 - we cannot be sure every file has been opened in the editor
23 - reusing that function file by file, restarting buildwrapper and a new GHC session will be too slow
24
25 ### Project resolution
26 - for each cabal component
27 - find "start" modules
28 - Main for executables and tests
29 - All exposed modules for library
30 - load start modules in GHC API
31 - get all modules from module dependency graph
32 - for each module
33 - get AST and generate needed information
34 package, module, symbol -> all locations used
35
36 ### File resolution
37 - when a file is saved, get the info for that file and save it
38
39 ### Error handling
40 - if the project doesn't build, we won't get all modules
41 - can we still get some info?
42 - when the project finally builds, we need to get all new files info (files after the last modified file)
43 - cabal build already gives us that
44
45 So ->
46 - no info for project: get info for everything
47 - file saved: get info for file
48 - project built: get info for all built files
49
50 How do we get the info?
51 - along the bwinfo file for each file?
52 - json result?
53
54 ## Eclipse
55
56 ### Database solution
57 The database will be on the Eclipse side to not have a long running process to manage. Use an embeded database
58 - SQLLite: same as scion-browser, need native layer, probably more cumbersome
59 - do it in scion-browser (additional tables) performance? Fact that we keep references to local files problematic?
60 - Derby/HSQLDB or other pure java implementation: provide jar in plugin, less headaches
61
62 ### Info
63 need module + package to resolve duplicates?
7f8ea76 @JPMoresmau synchronize return deleted files
authored
64 versioning of packages?
65 maybe important for local projects (do we reference the project or an older version)
f756a13 @JPMoresmau turn off output during build
authored
66 file in Eclipse -> file id so that we can easily delete all info pertaining to one file
67 package + module -> unique module id + file where defined (for local modules)
68 -> get all modules from package
69 -> need to get local modules from name and then get package
70 -> can list all modules for project: module where package=cabal name and defined file exist
7f8ea76 @JPMoresmau synchronize return deleted files
authored
71 -> several Main for one project can exist!! -> need component name for main
f756a13 @JPMoresmau turn off output during build
authored
72 module id + name -> unique symbol id + definition (for local symbols)
73 symbol id -> usages (file in Eclipse format (project + path), line span)
74 module id -> usages (import)
75
Something went wrong with that request. Please try again.