Files
swift-mirror/test/SourceKit/CodeComplete/complete_without_stdlib.swift
Alex Hoppen 63c31033fc [Frontend] Load standard libarary in CompilerInstance::setup
Instead of checking that the stdlib can be loaded in a variety of places, check it when setting up the compiler instance. This required a couple more checks to avoid loading the stdlib in cases where it’s not needed.

To be able to differentiate stdlib loading failures from other setup errors, make `CompilerInstance::setup` return an error message on failure via an inout parameter. Consume that error on the call side, replacing a previous, more generic error message, adding error handling where appropriate or ignoring the error message, depending on the context.
2021-12-13 15:32:08 +01:00

20 lines
716 B
Swift

class Str {
var value: Str
}
// rdar://problem/58663066
// Test a environment where stdlib is not found.
// Completion should return zero result.
// RUN: %empty-directory(%t/rsrc)
// RUN: %empty-directory(%t/sdk)
// RUN: not %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 2>&1 | %FileCheck %s
// RUN: not %sourcekitd-test \
// 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 2>&1 | %FileCheck %s
// CHECK: error response (Request Failed): Loading the standard library failed