vknabel / vscode-swift-development-environment

New home of Swift Development Environment for VS Code
https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swift-development-environment
Apache License 2.0
175 stars 14 forks source link

the completion is very slow #68

Closed haifengkao closed 3 years ago

haifengkao commented 4 years ago

When I specified the build params with sourcekit-lsp backend,

"sde.swiftBuildingParams" : [
        "build",
        "-Xswiftc",
        "-sdk",
        "-Xswiftc",
        "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk",
        "-Xswiftc",
        "-target",
        "-Xswiftc",
        "arm64-apple-ios11.0"
    ]

the completion becomes very slow. I have to wait for 2~3 secs for the completion menu to popup

The problem comes from sourcekit-lsp itself. https://forums.swift.org/t/sourcekit-lsp-completion-delay-with-sublime-text/30655 sourcekit-lsp will dump all global variables in the SDK to a json file without filtering.

Thesourcekit-lsp team is working on this issue. https://github.com/apple/sourcekit-lsp/commits/master

After they are finished (if vscode-lsp supports it), the problem might be resolved.

vknabel commented 4 years ago

Thanks for the details!

haifengkao commented 4 years ago

I have implemented the server-side filtering The OS X binary and source codes can be find here https://github.com/haifengkao/fast-sourcekit-lsp/releases

vknabel commented 4 years ago

@haifengkao thanks for your work! Might try out your fork!

vknabel commented 3 years ago

As this is can only be fixed in sourcekit-lsp and as there is a workaround with https://github.com/haifengkao/fast-sourcekit-lsp/releases, I will close this issue.