Skip to content

[SourceKit] Reorganize code completion options #33811

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions include/swift/IDE/CompletionInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ makeCodeCompletionMemoryBuffer(const llvm::MemoryBuffer *origBuf,

/// Manages \c CompilerInstance for completion like operations.
class CompletionInstance {
unsigned MaxASTReuseCount = 100;
unsigned DependencyCheckIntervalSecond = 5;
struct Options {
unsigned MaxASTReuseCount = 100;
unsigned DependencyCheckIntervalSecond = 5;
} Opts;

std::mutex mtx;

Expand All @@ -59,7 +61,7 @@ class CompletionInstance {
/// argument has changed, primary file is not the same, the \c Offset is not
/// in function bodies, or the interface hash of the file has changed.
bool performCachedOperationIfPossible(
const swift::CompilerInvocation &Invocation, llvm::hash_code ArgsHash,
llvm::hash_code ArgsHash,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
DiagnosticConsumer *DiagC,
Expand All @@ -78,7 +80,9 @@ class CompletionInstance {
llvm::function_ref<void(CompilerInstance &, bool)> Callback);

public:
void setDependencyCheckIntervalSecond(unsigned Value);
CompletionInstance() {}

void setOptions(Options NewOpts);

/// Calls \p Callback with a \c CompilerInstance which is prepared for the
/// second pass. \p Callback is resposible to perform the second pass on it.
Expand All @@ -94,7 +98,7 @@ class CompletionInstance {
swift::CompilerInvocation &Invocation, llvm::ArrayRef<const char *> Args,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
bool EnableASTCaching, std::string &Error, DiagnosticConsumer *DiagC,
std::string &Error, DiagnosticConsumer *DiagC,
llvm::function_ref<void(CompilerInstance &, bool)> Callback);
};

Expand Down
49 changes: 22 additions & 27 deletions lib/IDE/CompletionInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static bool areAnyDependentFilesInvalidated(
} // namespace

bool CompletionInstance::performCachedOperationIfPossible(
const swift::CompilerInvocation &Invocation, llvm::hash_code ArgsHash,
llvm::hash_code ArgsHash,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
DiagnosticConsumer *DiagC,
Expand All @@ -285,7 +285,7 @@ bool CompletionInstance::performCachedOperationIfPossible(

if (!CachedCI)
return false;
if (CachedReuseCount >= MaxASTReuseCount)
if (CachedReuseCount >= Opts.MaxASTReuseCount)
return false;
if (CachedArgHash != ArgsHash)
return false;
Expand Down Expand Up @@ -570,20 +570,21 @@ bool CompletionInstance::shouldCheckDependencies() const {
assert(CachedCI);
using namespace std::chrono;
auto now = system_clock::now();
return DependencyCheckedTimestamp + seconds(DependencyCheckIntervalSecond) <
now;
auto threshold = DependencyCheckedTimestamp +
seconds(Opts.DependencyCheckIntervalSecond);
return threshold < now;
}

void CompletionInstance::setDependencyCheckIntervalSecond(unsigned Value) {
void CompletionInstance::setOptions(CompletionInstance::Options NewOpts) {
std::lock_guard<std::mutex> lock(mtx);
DependencyCheckIntervalSecond = Value;
Opts = NewOpts;
}

bool swift::ide::CompletionInstance::performOperation(
swift::CompilerInvocation &Invocation, llvm::ArrayRef<const char *> Args,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem,
llvm::MemoryBuffer *completionBuffer, unsigned int Offset,
bool EnableASTCaching, std::string &Error, DiagnosticConsumer *DiagC,
std::string &Error, DiagnosticConsumer *DiagC,
llvm::function_ref<void(CompilerInstance &, bool)> Callback) {

// Always disable source location resolutions from .swiftsourceinfo file
Expand All @@ -601,29 +602,23 @@ bool swift::ide::CompletionInstance::performOperation(
// We don't need token list.
Invocation.getLangOptions().CollectParsedToken = false;

if (EnableASTCaching) {
// Compute the signature of the invocation.
llvm::hash_code ArgsHash(0);
for (auto arg : Args)
ArgsHash = llvm::hash_combine(ArgsHash, StringRef(arg));
// Compute the signature of the invocation.
llvm::hash_code ArgsHash(0);
for (auto arg : Args)
ArgsHash = llvm::hash_combine(ArgsHash, StringRef(arg));

// Concurrent completions will block so that they have higher chance to use
// the cached completion instance.
std::lock_guard<std::mutex> lock(mtx);
// Concurrent completions will block so that they have higher chance to use
// the cached completion instance.
std::lock_guard<std::mutex> lock(mtx);

if (performCachedOperationIfPossible(Invocation, ArgsHash, FileSystem,
completionBuffer, Offset, DiagC,
Callback))
return true;
if (performCachedOperationIfPossible(ArgsHash, FileSystem, completionBuffer,
Offset, DiagC, Callback)) {
return true;
}

if (performNewOperation(ArgsHash, Invocation, FileSystem, completionBuffer,
Offset, Error, DiagC, Callback))
return true;
} else {
// Concurrent completions may happen in parallel when caching is disabled.
if (performNewOperation(None, Invocation, FileSystem, completionBuffer,
Offset, Error, DiagC, Callback))
return true;
if(performNewOperation(ArgsHash, Invocation, FileSystem, completionBuffer,
Offset, Error, DiagC, Callback)) {
return true;
}

assert(!Error.empty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func foo() {
// RUN: -shell -- cp -R $INPUT_DIR/ClangFW.framework_mod/* %t/Frameworks/ClangFW.framework/ == \
// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} == \

// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \
// RUN: -shell -- echo '### Checking dependencies' == \
// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} \

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func foo() {
// RUN: %target-swift-frontend -emit-module -module-name SwiftFW -o %t/Frameworks/SwiftFW.framework/Modules/SwiftFW.swiftmodule/%target-swiftmodule-name $INPUT_DIR/SwiftFW_src/Funcs.swift

// RUN: %sourcekitd-test \
// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \

// RUN: -shell -- echo "### Initial" == \
// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} == \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func foo() {
// RUN: %target-swift-frontend -emit-module -module-name SwiftFW -o %t/Frameworks/SwiftFW.framework/Modules/SwiftFW.swiftmodule/%target-swiftmodule-name $INPUT_DIR/SwiftFW_src/Funcs.swift

// RUN: %sourcekitd-test \
// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \

// RUN: -shell -- echo "### Initial" == \
// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} == \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func foo() {
// RUN: %target-swift-frontend -emit-module -module-name SwiftFW -o %t/Frameworks/SwiftFW.framework/Modules/SwiftFW.swiftmodule/%target-swiftmodule-name $INPUT_DIR/SwiftFW_src/Funcs.swift

// RUN: %sourcekitd-test \
// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \

// RUN: -shell -- echo "### Initial" == \
// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} == \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func foo(val: MyStruct) {
// RUN: cp %t/State1.swift %t/test.swift

// RUN: %sourcekitd-test \
// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \

// RUN: -shell -- echo "### Initial" == \
// RUN: -req=complete -pos=5:4 %t/test.swift -- ${COMPILER_ARGS[@]} == \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func foo() {
// RUN: %target-swift-frontend -emit-module -module-name SwiftFW -o %t/Frameworks/SwiftFW.framework/Modules/SwiftFW.swiftmodule/%target-swiftmodule-name $INPUT_DIR/SwiftFW_src/Funcs.swift

// RUN: %sourcekitd-test \
// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \

// RUN: -shell -- echo "### Initial" == \
// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} == \
Expand Down
2 changes: 1 addition & 1 deletion test/SourceKit/CodeComplete/complete_checkdeps_vfs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func foo(value: MyStruct) {
// RUN: cp %S/Inputs/checkdeps/MyProject/LibraryExt.swift %t/VFS/

// RUN: %sourcekitd-test \
// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \

// RUN: -shell -- echo "### Initial" == \
// RUN: -req=complete -pos=2:9 -pass-as-sourcetext -vfs-files=%t/VFS/Main.swift=@%s,%t/VFS/Library.swift=@%S/Inputs/checkdeps/MyProject/Library.swift %t/VFS/Main.swift -- -target %target-triple %t/VFS/Main.swift %t/VFS/LibraryExt.swift %t/VFS/Library.swift == \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func foo(value: MyStruct) {
// RUN: cp %S/Inputs/checkdeps/MyProject/LibraryExt.swift %t/VFS/

// RUN: %sourcekitd-test \
// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \
// RUN: -req=global-config -req-opts=completion_check_dependency_interval=${DEPCHECK_INTERVAL} == \

// RUN: -shell -- echo "### Initial" == \
// RUN: -req=complete.open -pos=2:9 -pass-as-sourcetext -vfs-files=%t/VFS/Main.swift=@%s,%t/VFS/Library.swift=@%S/Inputs/checkdeps/MyProject/Library.swift %t/VFS/Main.swift -- -target %target-triple %t/VFS/Main.swift %t/VFS/LibraryExt.swift %t/VFS/Library.swift == \
Expand Down
5 changes: 3 additions & 2 deletions test/SourceKit/CodeComplete/complete_sequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ func bar(arg: Bar) {

// Disabled.
// RUN: %sourcekitd-test \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=12:11 %s -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=15:11 %s -- %s > %t.response
// RUN: -req=global-config -req-opts=completion_max_astcontext_reuse_count=0 ==\
// RUN: -req=complete -pos=12:11 %s -- %s == \
// RUN: -req=complete -pos=15:11 %s -- %s > %t.response
// RUN: %FileCheck --check-prefix=RESULT_SLOW %s < %t.response

// Enabled.
Expand Down
26 changes: 14 additions & 12 deletions test/SourceKit/CodeComplete/complete_sequence_race.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@ func bar(arg: Bar) {

// ReuseASTContext disabled.
// RUN: %sourcekitd-test \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=17:1 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=17:1 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -req-opts=reuseastcontext=0 -pos=15:11 %s -async -- %s
// RUN: -req=global-config -req-opts=completion_max_astcontext_reuse_count=0 \
// RUN: -req=complete -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -pos=17:1 %s -async -- %s == \
// RUN: -req=complete -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -pos=17:1 %s -async -- %s == \
// RUN: -req=complete -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -pos=15:11 %s -async -- %s

// ReuseASTContext enabled.
// RUN: %sourcekitd-test \
// RUN: -req=global-config -req-opts=completion_max_astcontext_reuse_count=5 \
// RUN: -req=complete -pos=12:11 %s -async -- %s == \
// RUN: -req=complete -pos=15:11 %s -async -- %s == \
// RUN: -req=complete -pos=12:11 %s -async -- %s == \
Expand Down
5 changes: 3 additions & 2 deletions test/SourceKit/CodeComplete/complete_without_stdlib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ class Str {
// RUN: %empty-directory(%t/sdk)

// RUN: %sourcekitd-test \
// RUN: -req=global-config -req-opts=completion_max_astcontext_reuse_count=0 \
// RUN: -req=complete -pos=4:1 %s -- %s -resource-dir %t/rsrc -sdk %t/sdk | %FileCheck %s
// RUN: %sourcekitd-test \
// RUN: -req=complete -req-opts=reuseastcontext=1 -pos=4:1 %s -- %s -resource-dir %t/rsrc -sdk %t/sdk == \
// RUN: -req=complete -req-opts=reuseastcontext=1 -pos=4:1 %s -- %s -resource-dir %t/rsrc -sdk %t/sdk | %FileCheck %s
// RUN: -req=complete -pos=4:1 %s -- %s -resource-dir %t/rsrc -sdk %t/sdk == \
// RUN: -req=complete -pos=4:1 %s -- %s -resource-dir %t/rsrc -sdk %t/sdk | %FileCheck %s

// CHECK: key.results: [
// CHECK-NOT: key.description:
7 changes: 5 additions & 2 deletions test/SourceKit/ConformingMethods/basic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ func testing(obj: C) {
let _ = obj.
}

// RUN: %sourcekitd-test -req=conformingmethods -pos=26:14 -repeat-request=2 %s -req-opts=expectedtypes='$s8MyModule7Target2PD;$s8MyModule7Target1PD' -- -module-name MyModule %s > %t.response
// RUN: %sourcekitd-test \
// RUN: -req=conformingmethods -pos=26:14 -repeat-request=2 %s -req-opts=expectedtypes='$s8MyModule7Target2PD;$s8MyModule7Target1PD' -- -module-name MyModule %s > %t.response
// RUN: %diff -u %s.response %t.response
// RUN: %sourcekitd-test -req=conformingmethods -pos=26:14 -repeat-request=2 %s -req-opts=expectedtypes='$s8MyModule7Target2PD;$s8MyModule7Target1PD',reuseastcontext=0 -- -module-name MyModule %s | %FileCheck %s --check-prefix=DISABLED
// RUN: %sourcekitd-test \
// RUN: -req=global-config -req-opts=completion_max_astcontext_reuse_count=0 == \
// RUN: -req=conformingmethods -pos=26:14 -repeat-request=2 %s -req-opts=expectedtypes='$s8MyModule7Target2PD;$s8MyModule7Target1PD' -- -module-name MyModule %s | %FileCheck %s --check-prefix=DISABLED

// DISABLED-NOT: key.reuseastcontext
// DISABLED: key.members: [
Expand Down
4 changes: 2 additions & 2 deletions test/SourceKit/CursorInfo/use-swift-source-info.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ func bar() {
// RUN: %target-swift-frontend -enable-batch-mode -emit-module -emit-module-doc -emit-module-path %t/Foo.swiftmodule %t/Foo.swift -module-name Foo -emit-module-source-info-path %t/Foo.swiftsourceinfo -emit-module-doc-path %t/Foo.swiftdoc
//
// Test setting optimize for ide to false
// RUN: %sourcekitd-test -req=global-config -for-ide=0 == -req=cursor -pos=3:3 %s -- -I %t -target %target-triple %s | %FileCheck --check-prefixes=BOTH,WITH %s
// RUN: %sourcekitd-test -req=global-config -req-opts=optimize_for_ide=0 == -req=cursor -pos=3:3 %s -- -I %t -target %target-triple %s | %FileCheck --check-prefixes=BOTH,WITH %s
//
// Test setting optimize for ide to true
// RUN: %sourcekitd-test -req=global-config -for-ide=1 == -req=cursor -pos=3:3 %s -- -I %t -target %target-triple %s | %FileCheck --check-prefixes=BOTH,WITHOUT %s
// RUN: %sourcekitd-test -req=global-config -req-opts=optimize_for_ide=1 == -req=cursor -pos=3:3 %s -- -I %t -target %target-triple %s | %FileCheck --check-prefixes=BOTH,WITHOUT %s
//
// Test sourcekitd-test's default global configuration request (optimize for ide is true)
// RUN: %sourcekitd-test -req=cursor -pos=3:3 %s -- -I %t -target %target-triple %s | %FileCheck --check-prefixes=BOTH,WITHOUT %s
Expand Down
7 changes: 5 additions & 2 deletions test/SourceKit/TypeContextInfo/typecontext_basic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ func test(obj: C) {
let _ = obj.foo(x:
}

// RUN: %sourcekitd-test -req=typecontextinfo -repeat-request=2 -pos=25:22 %s -- %s > %t.response
// RUN: %sourcekitd-test \
// RUN: -req=typecontextinfo -repeat-request=2 -pos=25:22 %s -- %s > %t.response
// RUN: %diff -u %s.response %t.response
// RUN: %sourcekitd-test -req=typecontextinfo -repeat-request=2 -pos=25:22 %s -req-opts=reuseastcontext=0 -- %s | %FileCheck %s --check-prefix=DISABLED
// RUN: %sourcekitd-test \
// RUN: -req=global-config -req-opts=completion_max_astcontext_reuse_count=0 == \
// RUN: -req=typecontextinfo -repeat-request=2 -pos=25:22 %s -- %s | %FileCheck %s --check-prefix=DISABLED

// DISABLED-NOT: key.reuseastcontext
// DISABLED: key.results: [
Expand Down
17 changes: 12 additions & 5 deletions tools/SourceKit/include/SourceKit/Core/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ namespace SourceKit {
class GlobalConfig {
public:
struct Settings {
/// When true, the default compiler options and other configuration flags will be chosen to optimize for
/// usage from an IDE.
/// When true, the default compiler options and other configuration flags
/// will be chosen to optimize for usage from an IDE.
///
/// At the time of writing this just means ignoring .swiftsourceinfo files.
bool OptimizeForIDE = false;

/// Interval second for checking dependencies in fast code completion.
unsigned CompletionCheckDependencyInterval = 5;
struct CompletionOptions {

/// Max count of reusing ASTContext for cached code completion.
unsigned MaxASTContextReuseCount = 100;

/// Interval second for checking dependencies in cached code completion.
unsigned CheckDependencyInterval = 5;
} CompletionOpts;
};

private:
Expand All @@ -47,9 +53,10 @@ class GlobalConfig {

public:
Settings update(Optional<bool> OptimizeForIDE,
Optional<unsigned> CompletionMaxASTContextReuseCount,
Optional<unsigned> CompletionCheckDependencyInterval);
bool shouldOptimizeForIDE() const;
unsigned getCompletionCheckDependencyInterval() const;
Settings::CompletionOptions getCompletionOpts() const;
};

class Context {
Expand Down
12 changes: 9 additions & 3 deletions tools/SourceKit/lib/Core/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,28 @@ using namespace SourceKit;

GlobalConfig::Settings
GlobalConfig::update(Optional<bool> OptimizeForIDE,
Optional<unsigned> CompletionMaxASTContextReuseCount,
Optional<unsigned> CompletionCheckDependencyInterval) {
llvm::sys::ScopedLock L(Mtx);
if (OptimizeForIDE.hasValue())
State.OptimizeForIDE = *OptimizeForIDE;
if (CompletionMaxASTContextReuseCount.hasValue())
State.CompletionOpts.MaxASTContextReuseCount =
*CompletionMaxASTContextReuseCount;
if (CompletionCheckDependencyInterval.hasValue())
State.CompletionCheckDependencyInterval = *CompletionCheckDependencyInterval;
State.CompletionOpts.CheckDependencyInterval =
*CompletionCheckDependencyInterval;
return State;
};

bool GlobalConfig::shouldOptimizeForIDE() const {
llvm::sys::ScopedLock L(Mtx);
return State.OptimizeForIDE;
}
unsigned GlobalConfig::getCompletionCheckDependencyInterval() const {
GlobalConfig::Settings::CompletionOptions
GlobalConfig::getCompletionOpts() const {
llvm::sys::ScopedLock L(Mtx);
return State.CompletionCheckDependencyInterval;
return State.CompletionOpts;
}

SourceKit::Context::Context(
Expand Down
1 change: 0 additions & 1 deletion tools/SourceKit/lib/SwiftLang/CodeCompletionOrganizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct Options {
bool hideLowPriority = true;
bool hideByNameStyle = true;
bool fuzzyMatching = true;
bool reuseASTContextIfPossible = true;
bool annotatedDescription = false;
unsigned minFuzzyLength = 2;
unsigned showTopNonLiteralResults = 3;
Expand Down
Loading