Skip to content

[SourceKit/swift-ide-test] Consolidate duplicated logics between completion like requests #28322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Nov 18, 2019

(based on #28282 I'll rebase this after that PR is merged)

Consolidate duplicated logics between completion like requests: code completion, type context info, and conforming method list.

  • Support VFS in typecontextinfo and conformingmethods requests too.
  • For SourceKit, implement SwiftLangSupport::setupCompilerInstanceForCodeCompletion()
  • For swift-ide-test, implement doCodeCompletionImpl()

Get source locations from '.swiftsourceinfo' is currently expensive.
Since they are not necessary for code completion, set
'IgnoreSwiftSourceInfo' to 'true'.

rdar://problem/57194358
https://bugs.swift.org/browse/SR-11767
Specifically, align with swiftTypeContextInfoImpl() and
swiftConformingMethodListImpl()
Consolidate duplicated logics between
completion/typecontextinfo/conformingmethodlist requests.

SourceKit: SwiftLangSupport::setupCompilerInstanceForCodeCompletion()
swift-ide-test: doCodeCompletionImpl()
@rintaro
Copy link
Member Author

rintaro commented Nov 18, 2019

@swift-ci Please test

@@ -295,6 +296,45 @@ SwiftLangSupport::makeCodeCompletionMemoryBuffer(
return std::unique_ptr<llvm::MemoryBuffer>(newBuffer.release());
}

bool SwiftLangSupport::setupCompilerInstanceForCodeCompletion(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this move to lib/IDE so swift-ide-test can also use it and ensure that swift-ide-test performs code-completion the same way as sourcekitd?

@rintaro
Copy link
Member Author

rintaro commented Dec 18, 2019

Superseded by #28727 . Closing

@rintaro rintaro closed this Dec 18, 2019
@rintaro rintaro deleted the sourcekit-completion-setupci branch December 18, 2019 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants