Closed kidd closed 10 years ago
How can I know if a docset is supported by helm-dash
or not? I had this issue with a few docsets and its quite annoying.
if the sqlite db has a table called searchIndex I'd say it's enough to know it's supported.
so something like '.schema' to the sqlite connection and regex match
Yesterday I was talking with @Kapeli about this. There are two types of docsets: Dash docsets and Apple ones. The apple format is more complex but we must support both.
Quite a few of the docsets that come with Dash are Apple ones. These are the docsets that were made before I decided to stop making docsets using Apple's insane format.
As I told @areina, I am currently in no position to help (my Mac is broken), but if you can wait until next week I'll have a look over your code and provide equivalent SQL queries for the Apple docsets.
If you decide to do it on your own, the equivalent of the "searchIndex" table is the "ZTOKEN" table. Not everything is inside ZTOKEN however, so you'll have to look into ZTOKENMETAINFORMATION and ZFILE (or something like that).
In terms of determining if a docset is Dash-style or Apple, you have these options:
Ok so I see that the query you run is at https://github.com/areina/helm-dash/blob/master/helm-dash.el#L205.
The equivalent query for that in an Apple docset would be:
SELECT ty.ZTYPENAME,
t.ZTOKENNAME,
f.ZPATH,
m.ZANCHOR
FROM ZTOKEN t,
ZTOKENTYPE ty,
ZFILEPATH f,
ZTOKENMETAINFORMATION m
WHERE t.ZTOKENNAME LIKE .......
AND ty.Z_PK = t.ZTOKENTYPE
AND f.Z_PK = m.ZFILE
AND m.ZTOKEN = t.Z_PK
ORDER BY LOWER(t.ZTOKENNAME)
Note the m.ZANCHOR
. Apple docsets don't store the anchor inside the path like Dash docsets, so you have to combine the two.
hey @Kapeli thank you very much!
Now, if there are 3 active docsets and 1 of them has an unsupported format (css) everything blows up.
We should just disable it, keep calm, and carry on