[SR-13120] SourceKit syntaxMap doesn't contain info about trailing closure initializers #55566
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Additional Detail from JIRA
md5: 19a40d4187b72eb310669862da7d3a83
Issue Description:
With this code:
If you do a `source.request.editor.open` request the last token the syntax map contains is the reference to `String`, not it's initializer that is implicit here. If you change the code to `String(foo: {})` it ends up in the syntax map.
I was testing with `{ key.request: source.request.editor.open, key.sourcefile: "/tmp/bar.swift", key.name: "/tmp/bar.swift"}` in the sourcekitd-repl.
In SwiftLint we use the tokens in the syntax map to do individual cursorinfo requests to determine which module a token is defined it, so if it doesn't appear in the syntax map, we don't check it. I'm not sure if it's expected for this to show up there or not. In the meantime, similar to operators, we can get this info from the index requests, but I wanted to flag in case this was unexpected.
The text was updated successfully, but these errors were encountered: