Commit Graph

28 Commits

Author SHA1 Message Date
Ben Langmuir
4d9c9f6098 Move SourceEntityWalker into libAST NFC
It fits right in among our other AST walkers and lets us use it lower in
the stack than libIDE.
2016-04-01 14:14:06 -07:00
Ben Langmuir
47d2c24078 [IDE] Factor code that looks up USRs into getDeclFromUSR 2016-03-16 15:43:02 -07:00
Ben Langmuir
d51c0f1aa7 [IDE] StringRefize the ReconstructType APIs NFC
Luckily const char* clients can work unmodified.
2016-03-11 14:24:32 -08:00
Ben Langmuir
5725d22c89 [IDE] Add an entry point to get decls out of 'ReconstructType'
For now, just tack the testing onto the existing walker that checks the
types.  It doesn't seem to work at all for local declarations yet, but
at least we get some top-level stuff.
2016-03-09 21:14:29 -08:00
Ben Langmuir
3866e74604 [IDE] Fix some 80-column violations in Utils.h NFC 2016-03-07 18:56:25 -08: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
practicalswift
a3f857ca7b [gardening] Add "-*- C++ -*-" to header files currently missing it 2016-01-23 11:53:05 +01:00
Xi Ge
5a7a4f461d Port a util "getTypeFromMangledTypename" from lldb (lldb/source/Symbol/SwiftASTContext.cpp) to IDE and add some tests against it.
This utility helps us reconstruct type from a mangled name. SourceKit needs this functionality to deliver
richer doc-info/cursor-info.

Thanks for Sean's help!
2016-01-13 13:43:15 -08:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
26b5234a80 Fix typo: currect → correct 2015-12-14 00:11:32 +01:00
Xi Ge
9beeb56a90 [TypeInterface] When printing type-specific interfaces, replace parameter and return types with instantiated types. 2015-11-17 19:12:30 -08:00
Xi Ge
a1493133a0 Refactor ArchetypeTransformer into a reusable IDE utility. NFC 2015-11-17 19:12:30 -08:00
Xi Ge
5ca83d97a5 [InterfacePrint] Enhance ASTPrinter to support type-specific interface printing.
When users try to print the interface of a specific type (most often through cursor
infor query of SourceKit), we should simplify the original decls by replacing
archetypes with instantiated types, hiding extension details, and omitting
unfulfilled extension requirements. So the users can get the straight-to-the-point
"type interface". This commit builds the testing infrastructure for this feature,
and implements the first trick that wraps extension contents into the interface body.

This commit also moves some generic testing support from SourceKit to Swift.

Swift SVN r32630
2015-10-12 19:14:58 +00:00
Doug Gregor
b8995b0aa3 Transform the Module class into ModuleDecl.
Modules occupy a weird space in the AST now: they can be treated like
types (Swift.Int), which is captured by ModuleType. They can be
treated like values for disambiguation (Swift.print), which is
captured by ModuleExpr. And we jump through hoops in various places to
store "either a module or a decl".

Start cleaning this up by transforming Module into ModuleDecl, a
TypeDecl that's implicitly created to describe a module. Subsequent
changes will start folding away the special cases (ModuleExpr ->
DeclRefExpr, name lookup results stop having a separate Module case,
etc.).

Note that the Module -> ModuleDecl typedef is there to limit the
changes needed. Much of this patch is actually dealing with the fact
that Module used to have Ctx and Name public members that now need to
be accessed via getASTContext() and getName(), respectively.

Swift SVN r28284
2015-05-07 21:10:50 +00:00
Argyrios Kyrtzidis
a586753f0f [IDE] Implement generating the Swift interface for an C/ObjC header
This translates clang arguments to swift ones, uses the bridging header
functionality to parse the provided file, and re-uses part of the module interface
printing implementation to print an interface for the header.

Part of rdar://19939192

Swift SVN r28062
2015-05-02 01:17:45 +00:00
Xi Ge
fb2c8aa103 [SDKAnalyzer] The initial commit of swift sdk digester.
This tool takes the input of two versions of the same sdk and outputs
their diff to facilicate the auto-migration of sdk clients.
In this initial commit, we take the path of one sdk and generate
a tree describing its API content. Next, we will diff trees generated
from different versions of the sdk.

In addition, this commit also refactored out part of swift-sdk-analyzer
to the common utils shared with swift-sdk-digester.

Swift SVN r26656
2015-03-28 00:05:28 +00:00
Argyrios Kyrtzidis
0c54a120a0 [IDE] Introduce ide::replacePlaceholders() which replaces Xcode editor placeholders with dollar identifiers
and returns a new memory buffer.

Swift SVN r25897
2015-03-09 23:02:56 +00:00
Argyrios Kyrtzidis
d039fb6369 [AST] Move ide::findUnderlyingClangModule() to Module::findUnderlyingClangModule() so that the ASTPrinter can use it.
Swift SVN r23691
2014-12-04 20:17:03 +00:00
Sonny Falk
8094d8d633 [IDE] Add utility function for walking overridden declarations, including
protocol conformances and clang declarations.

Swift SVN r20909
2014-08-01 19:07:15 +00:00
Argyrios Kyrtzidis
3175251bb1 [IDE] Handle annotation of clang submodule imports properly.
rdar://17780613

Swift SVN r20595
2014-07-26 20:58:19 +00:00
Argyrios Kyrtzidis
2380966931 [IDE] Enhance ide::isSourceInputComplete() function to also return indentation information.
Patch provided by GregC.

Swift SVN r16552
2014-04-18 22:12:40 +00:00
Dmitri Hrybenko
68e8fee5fc Comment parsing: put more information into the generated XML documents
This commit adds infrastructure for conversion and testing it.

The conversion is still incomplete, pending discussion about which tags should
we use in the XML documents.  I copied the RelaxNG schema from Clang, and will
edit it accordingly.


Swift SVN r16451
2014-04-17 15:42:51 +00:00
Dmitri Hrybenko
f7699f59b5 Comment parsing: generate a basic XML document from the brief comment
Swift SVN r15186
2014-03-18 11:09:53 +00:00
Dmitri Hrybenko
49754619ee Move USR generation to AST library, so that Serialization library can use it
Swift SVN r14681
2014-03-05 11:31:31 +00:00
Argyrios Kyrtzidis
bb4b57c053 [IDE] Introduce ide::printDeclUSR() which uses the mangler to provide a USR for a swift symbol.
Swift SVN r14279
2014-02-23 06:54:48 +00:00
Argyrios Kyrtzidis
d073e3026c [IDE] Add a convenient overload for ide::isSourceInputComplete that accepts a StringRef.
Swift SVN r13318
2014-02-02 06:49:59 +00:00
Argyrios Kyrtzidis
8758451a43 [Parser/IDE] Introduce ide::isSourceInputComplete() which returns true if the input source is fully formed,
or false if, for example, a closing brace is missing.

This is useful for the REPL.
rdar://15948039

Swift SVN r13313
2014-02-02 03:14:33 +00:00