Skip to content

lsp-sourcekit can't get complete candidatesΒ #18

@stardiviner

Description

@stardiviner

company-mode displays error in minibuffer:

Company: An error occurred in auto-begin
Company: backend company-capf error "request cancelled" with args (candidates let)

Then I enabled lsp-mode debug with:

(setq lsp-log-io t
      lsp-print-io t)

In buffer *lsp-log: sourcekit-ls:55049*:

[Trace - 05:53:52 PM] Received response 'textDocument/codeAction - (53)' in 28ms.
Result: []


[Trace - 05:53:58 PM] Sending request 'textDocument/codeAction - (54)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
  },
  "range": {
    "start": {
      "line": 8,
      "character": 0
    },
    "end": {
      "line": 8,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 05:53:58 PM] Received response 'textDocument/codeAction - (54)' in 22ms.
Result: []


[Trace - 05:53:58 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift",
    "version": 54
  },
  "contentChanges": [
    {
      "range": {
        "start": {
          "line": 8,
          "character": 0
        },
        "end": {
          "line": 8,
          "character": 0
        }
      },
      "rangeLength": 0,
      "text": "l"
    }
  ]
}


[Trace - 05:53:58 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "version": 54,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:53:58 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "cannot find 'l' in scope",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    },
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "expressions are not allowed at the top level",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    }
  ],
  "version": 54,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:53:58 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift",
    "version": 55
  },
  "contentChanges": [
    {
      "range": {
        "start": {
          "line": 8,
          "character": 1
        },
        "end": {
          "line": 8,
          "character": 1
        }
      },
      "rangeLength": 0,
      "text": "e"
    }
  ]
}


[Trace - 05:53:58 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "cannot find 'l' in scope",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    },
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "expressions are not allowed at the top level",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    }
  ],
  "version": 55,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:53:58 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "cannot find 'le' in scope",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    },
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "expressions are not allowed at the top level",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    }
  ],
  "version": 55,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:53:58 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift",
    "version": 56
  },
  "contentChanges": [
    {
      "range": {
        "start": {
          "line": 8,
          "character": 2
        },
        "end": {
          "line": 8,
          "character": 2
        }
      },
      "rangeLength": 0,
      "text": "t"
    }
  ]
}


[Trace - 05:53:58 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "expected pattern",
      "range": {
        "end": {
          "character": 3,
          "line": 8
        },
        "start": {
          "character": 3,
          "line": 8
        }
      }
    },
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "cannot find 'le' in scope",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    },
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "expressions are not allowed at the top level",
      "range": {
        "end": {
          "character": 0,
          "line": 8
        },
        "start": {
          "character": 0,
          "line": 8
        }
      }
    }
  ],
  "version": 56,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:53:58 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "expected pattern",
      "range": {
        "end": {
          "character": 3,
          "line": 8
        },
        "start": {
          "character": 3,
          "line": 8
        }
      }
    }
  ],
  "version": 56,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:53:58 PM] Sending request 'textDocument/completion - (55)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
  },
  "position": {
    "line": 8,
    "character": 3
  },
  "context": {
    "triggerKind": 3
  }
}


[Trace - 05:53:58 PM] Received response 'textDocument/completion - (55)' in 2ms.
Result: {
  "code": -32800,
  "message": "request cancelled"
}


[Trace - 05:53:58 PM] Sending request 'textDocument/completion - (56)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
  },
  "position": {
    "line": 8,
    "character": 3
  },
  "context": {
    "triggerKind": 3
  }
}


[Trace - 05:53:58 PM] Received response 'textDocument/completion - (56)' in 42ms.
Result: {
  "code": -32800,
  "message": "request cancelled"
}


[Trace - 05:54:00 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift",
    "version": 57
  },
  "contentChanges": [
    {
      "range": {
        "start": {
          "line": 8,
          "character": 0
        },
        "end": {
          "line": 8,
          "character": 3
        }
      },
      "rangeLength": 3,
      "text": ""
    }
  ]
}


[Trace - 05:54:00 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "relatedInformation": [],
      "severity": 1,
      "source": "sourcekitd",
      "message": "expected pattern",
      "range": {
        "end": {
          "character": 3,
          "line": 8
        },
        "start": {
          "character": 3,
          "line": 8
        }
      }
    }
  ],
  "version": 57,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:54:00 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "version": 57,
  "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
}


[Trace - 05:54:00 PM] Sending notification 'textDocument/willSave'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift"
  },
  "reason": 1
}


[Trace - 05:54:00 PM] Sending notification 'textDocument/didSave'.
Params: {
  "textDocument": {
    "uri": "file:///Users/stardiviner/Documents/Programming/Swift/SwiftDemo/Sources/SwiftDemo/SwiftDemo.swift",
    "version": 57
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions