Open drewcrawford opened 8 years ago
Markup has been committed, have to evaluate the performance of SK though
If you're interested in how to use SK to power this, here's a braindump, while I'm thinking about it
Instrumented Xcode is making requests like this:
sourcekit: [2:sourcekitd_send_request_sync-before:1295: 1.5981] {
key.request: source.request.editor.open,
key.name: "IDEIBSwiftAnnotationProvider:/Users/drew/Code/NaOH/NaOH/crypto_box.swift",
key.sourcetext: "SourceTextGoesHere"
}
output is like
sourcekit: [2:sourcekitd_send_request_sync-after:1295:217.8741] {
key.offset: 0,
key.length: 1490,
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
key.syntaxmap: [
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 0,
key.length: 82
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 82,
key.length: 53
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 135,
key.length: 67
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 202,
key.length: 71
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 273,
key.length: 25
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 299,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 306,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 319,
key.length: 13
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 332,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 342,
key.length: 8
},
In our code:
editorOpen
that takes a sourcetext. See docInfo
for an example, but based on Xcode behavior I don't think we need the usual extraArgs
etc.So you'd send the complete source text over to SK for every key press? That doesn't sound like it would perform...
That isn't the issue. SK can parse well faster than a sourcefile every keypress.
The part I'm worried about is how fast ST will accept region updates.
FYI, I implemented an open
request in API for other reasons, so that part of the groundwork is now here.
There's been some discussion about whether this is implemented via SK or with a markup file.