Nadav Rotem
41f0489b12
[IDE] Fix a warning.
2016-02-19 16:59:15 -08:00
Dmitri Gribenko
f39b443e24
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-19 01:16:19 -08:00
Dmitri Gribenko
0f36bec31f
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-18 16:41:35 -08:00
Ben Langmuir
9418b32b2a
[SourceKit] Don't forget to check for nullptr
...
After 7400d484 we tried to walk into enum elements, but forgot to check
for missing types (which caused an assertion in getType) or element
decls (which caused an assertion or crash inside passReference).
rdar://problem/24634223
2016-02-18 14:08:44 -08:00
Dmitri Gribenko
dd75aed67a
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-17 14:40:05 -08:00
Enrico Granata
2d42bcc58b
There is no need for the Crawler to hold on to the name of the module, as a Crawler is only invoked when there is no real backing module to search into
...
Fixes rdar://24641858
2016-02-16 16:10:16 -08:00
Xi Ge
d4f704bb2f
ASTPrinter: Add pre and post callbacks for printing synthesized extensions and call them.
...
This is necessary for jump to synthesized extensions in IDE.
2016-02-15 17:41:49 -08:00
Max Moiseev
3a3984877a
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-15 15:43:34 -08:00
Ben Langmuir
e327378b24
[SourceKit] Add annotation tags for decl names
...
This splits the printDeclNamEndLoc callback into NameEndLoc and
NameOrSignatureEndLoc variants to differentiate whether or not
signatures are included. All existing clients move to
NameOrSignatureEndLoc to maintain the current behaviour. I'm still not
completely happy with how these are named, but I dont' have any better
ideas right now.
rdar://problem/24292226
2016-02-12 15:57:28 -08:00
Xi Ge
9aa3d01101
[Serialization] Avoid serializing source orders, trust deserialized decls in preserving such order. rdar://24610992
...
Thank Jordan for suggesting this.
2016-02-11 12:24:38 -08:00
Xi Ge
c97f115219
[ModulePrinter] When printing decls in a module group, we print them according to their source order.
...
Source order preserves semantic information better than printing alphabetically.
2016-02-10 17:46:49 -08:00
Xi Ge
9ff84e145d
[CodeCompletion] For submodules, also use ASTContext to collect their visibility.
2016-02-10 13:03:17 -08:00
Xi Ge
d6fd879b01
[CodeCompletion] Query modules' accessibility from ASTContext instead of ClangImporter. NFC
2016-02-10 11:44:56 -08:00
Xi Ge
7784ba959e
ModulePrinter: allow module printer to print symbols from a specific group.
2016-02-09 11:49:16 -08:00
Jordan Rose
66189ffac9
Convert many more classes to use llvm::TrailingObjects.
...
I only intend to do SIL instructions after this; I'm leaving the runtime alone.
2016-02-09 08:57:19 -08:00
Enrico Granata
94f4dbea42
When this code was ported over from LLDB to swift, ConstString was redefined from being lldb_private::ConstString to being std::string
...
lldb's ConstString comes with a guarantee of keeping the underlying const char* storage alive for the lifetime of the process, so storing pointers from a ConstString as raw const char* is a safe operation
std::string does not come with equal guarantees, so storing such pointers as a raw const char* is actually an unsafe operation
Transform the storage into a std::string since that is safer to do
2016-02-05 19:08:20 -08:00
Ted Kremenek
2b55fc8cbb
Merge pull request #1209 from johnno1962/master
...
Fixes missing Xcode "Quick Help" for enum values as switch case patterns
2016-02-05 16:06:30 -08:00
John Holdsworth
7400d48426
Fixes missing Xcode "Quick Help" for enum values as switch case patterns
2016-02-05 11:07:27 +00:00
Max Moiseev
61c837209b
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-04 16:13:39 -08:00
Ted Kremenek
7f77733b0c
Merge pull request #1137 from ahoppen/master
...
Fixes SR-642: Code completion does not instantiate generic arguments of a type wrapped in an optional.
2016-02-04 14:27:01 -08:00
Chris Lattner
8dedfb31e3
Add support for #file/#line, etc according to SE-0028. __FILE__ and friends
...
are still accepted without deprecation warning as of this patch.
2016-02-04 14:22:22 -08:00
Xi Ge
77b7180f1a
Rename CodeCompletionTypeChecking.h to IDETypeChecking.h since it's used by more clients now. NFC
2016-02-04 11:09:21 -08:00
Ben Langmuir
a927dc8a5a
[CodeCompletion] Hide literals that don't match the type context in SourceKit
...
If there is a type context, hide literal suggesetions that don't match
it, unless they are keywords and we have filtered to their names.
Incidentally fix an output buffering issue when combining filtering with
the -raw flag in complete-test.
Part of rdar://problem/23865118
2016-02-03 10:51:07 -08:00
Ben Langmuir
9ae6846ac7
[CodeCompletion] Remove more vestiges of 0.0 literal suggestion
...
Obviously dead code.
2016-02-03 08:29:20 -08:00
Ben Langmuir
e75402e49e
[CodeCompletion] Add image literal similar to color
...
Part of rdar://problem/23865118
2016-02-03 07:55:07 -08:00
Ben Langmuir
c33f2faad2
[CodeCompletion] Tweak literal suggestion text
...
For rdar://problem/23865118
2016-02-03 07:33:50 -08:00
Ben Langmuir
838131dd2f
[CodeCompletion] Remove 0.0 suggestion
...
In practice things that are float literal convertible are also integer
literal convertible so this isn't pulling its weight.
Part of rdar://problem/23865118
2016-02-03 07:20:05 -08:00
Doug Gregor
f5cb1151c1
[Code completion] Code complete compound function names within #selector.
...
When we're code completing a postfix or dot expression inside the
subexpression of an #selector expression, prefer compound function
names. This helps us write, e.g.,
#selector(UIView.
and get completions such as "insertSubview(_:aboveSubview:)". Fixes
rdar://problem/24470075.
2016-02-02 16:06:32 -08:00
Doug Gregor
9736d54a77
[Code completion] For a Selector argument, provide #selector(<#objc method#>).
2016-02-02 16:06:32 -08:00
Xi Ge
0864b62e58
Simplify some code, NFC
2016-02-02 15:21:15 -08:00
Xi Ge
ae60159816
[ModulePrint] Add the initial implementation for printing synthesized extensions.
...
For a concrete type, members from its conforming protocols' extensions can be hard
to manually surface. In this commit, when printing Swift modules, we start to replicate these
extensions and synthesize them as if they are the concrete type's native extensions.
Credit to Doug for suggesting this practice.
2016-02-02 14:53:21 -08:00
Doug Gregor
f1aac08bda
[Code completion] Only escape var/let/inout in call argument lists.
...
Argument labels don't need to be escaped in calls, so don't escape
them in code completions for calls. Fixes <rdar://problem/24460721>.
2016-02-02 13:43:27 -08:00
Alex Hoppen
722193a5f9
[CodeCompletion] Fix SR-627 Code Completion does not resolve generics that have been assigned a concrete type
2016-02-02 12:34:35 +01:00
Alex Hoppen
6e45d6bb5b
Fix SR-642 Code completion does not instantiate concrete element type of optional Set
2016-01-30 08:24:17 +01:00
William Dillon
ab7c87e7e8
Implemented ARMv6 and fixed up ARMv7
2016-01-29 21:41:22 +00:00
Doug Gregor
37441e1b46
SE-0022: Code completion for #selector.
2016-01-28 11:23:14 -08:00
Doug Gregor
dccf3155f1
SE-0022: Implement parsing, AST, and semantic analysis for #selector.
2016-01-26 21:12:04 -08:00
practicalswift
deadb2b62a
[gardening] Fix recently introduced typo: "polymorhpic" → "polymorphic"
2016-01-26 10:03:32 +01:00
Enrico Granata
66cf479f31
Add an API that exactly mimics LLDB's GetTypeFromMangledTypename but uses ReconstructType.cpp as a node visitor
2016-01-25 15:39:07 -08:00
Enrico Granata
ae920a4108
Changes required for ReconstructType to be able to reconstruct types from qualified archetype manglings
2016-01-25 15:39:07 -08:00
Doug Gregor
8336419844
Include completion source location information compound DeclNames.
...
When one spells a compound declaration name in the source (e.g.,
insertSubview(_:aboveSubview:), keep track of the locations of the
base name, parentheses, and argument labels.
2016-01-25 14:13:13 -08:00
practicalswift
71e00fefa1
[gardening] Fix typos: "word word" (two spaces) → "word word" (one space)
2016-01-24 21:27:16 +01:00
practicalswift
638a7c9474
[gardening] Avoid "var == true" and "var == false"
2016-01-23 19:57:07 +01:00
practicalswift
8efa5f587e
[gardening] Remove "-*- C++ -*-" tag from .cpp files
...
Emacs assumes .h files are C files by default which is why the
tag "-*- C++ -*-" is needed.
.cpp files do not have this problem.
2016-01-23 12:09:32 +01:00
practicalswift
33312eac6b
[gardening] Remove unreachable/unused/redundant code
...
* Make parameter naming in forward declaration match definition
* Remove unused argument to function persistAsync(…)
* Remove unused enum ShouldHalt
* Remove unused enum class IsProtocol
* Remove unused function dumpTypeSubstitutionMap()
* Remove unused function template getFirstPairElt(…)
* Remove unused method addConstantWordInWords(…)
* Remove unused method asExistentialTI()
* Remove unused method currentTrackedState()
* Remove unused method getNumBodyParameters()
* Remove unused method getSuccIndex()
* Remove unused method getTypeOfDeclReference(…)
* Remove unused method hasStructWithAtMostOneNonTrivialField(…)
* Remove unused method initForDirectValues()
* Remove unused method nextIfNot(…)
* Remove unused method overwriteLoweredValue(…)
* Remove unused method removeColumn(…)
* Remove unused methods HasSingleDecl() and GetFirstDecl()
* Remove unused methods overwriteLoweredExplosion(…) and setLoweredSingleValue(…)
* Remove unused methods requireRetainablePointerValue(…), getMethodSelfInstanceType(…) and isSelfArchetype(…)
* Remove unused methods setAsEmptyDirect(), setAsSingleDirectUnmanagedFragileValue(…), setAsIndirectAddress(…) and getDirectValues()
* Remove unused struct CachedMemberInfo
* Remove unused struct CallEdit
* Remove unused struct ErrorImportInfo
* Remove unused synonym ConformancePair
* Remove unused variable SemaInfo
* Remove unused variable localDeclNameNode
* Remove unused variables kindToken and kindLoc
2016-01-22 09:43:24 +01:00
Xi Ge
00bff249ff
[SyntaxModel] Highlight /*: ... */, when appearing in playground, as doc comment block. rdar://24234991
2016-01-21 11:05:34 -08:00
Doug Gregor
ecfde0e71c
Start parsing names with argument labels.
...
Basic implementatation of SE-0021, naming functions with argument
labels. Handle parsing of compound function names in various
unqualified-identifier productions, updating the AST representation of
various expressions from Identifiers to DeclNames. The result doesn't
capture all of the source locations we want; more on that later.
As part of this, remove the parsing code for the "selector-style"
method names, since we now have a replacement. The feature was never
publicized and doesn't make sense in Swift, so zap it outright.
2016-01-20 17:09:01 -08:00
Max Moiseev
9a018bd77d
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-01-20 14:38:22 -08:00
Doug Gregor
7d70b704e4
Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines
2016-01-19 23:18:20 -08:00
Xi Ge
0f4e7a5ea5
[CodeCompletion] Add code completion for where clauses. rdar://24245022
...
When completing at "extension A where #^HERE^#", we suggest the generic params of A to users.
2016-01-19 14:17:15 -08:00