Commit Graph

3980 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
9151996c9f [IDE] Don't show "import SwiftShims" in the stdlib interface.
Swift SVN r17344
2014-05-04 00:26:34 +00:00
Ted Kremenek
050fd53af7 Rename UncheckedOptional to ImplicitlyUnwrappedOptional.
Swift SVN r17232
2014-05-02 06:13:57 +00:00
Argyrios Kyrtzidis
2442d063ef [IDE] Fix syntax annotation crash with #if blocks that are missing an #endif.
rdar://16785562

Swift SVN r17231
2014-05-02 06:12:05 +00:00
Doug Gregor
3d3ff6811a Add a pile of missing #includes exposed by pruning includes in top-of-tree LLVM.
Swift SVN r17157
2014-05-01 14:26:34 +00:00
Dmitri Hrybenko
c4ef6bd032 Comment to XML conversion: adjust to upstream XML schema change
Swift SVN r17148
2014-05-01 08:51:32 +00:00
Dmitri Hrybenko
277e6a81b7 Code completion: fix a crash on invalid code
Swift SVN r17035
2014-04-29 14:31:28 +00:00
Doug Gregor
4e4173f2e6 Remove the "separated" declaration syntax <rdar://problem/16742067>.
Swift SVN r16979
2014-04-28 14:44:53 +00:00
Dmitri Hrybenko
739c495282 AST printer: use identifier escaping
rdar://16233153


Swift SVN r16933
2014-04-27 17:25:24 +00:00
Chris Lattner
0c390777ba Implement <rdar://problem/16204675> Need #elseif
This restructures IfConfigDecl/Stmt to be a list of clauses controlled
by a condition.  This makes it straight-forward to drop in #elseif support.

While I'm in here, this patch moves checking for extraneous stuff at the
end of the #if line from the lexer to the parser.  This means that you can
now put a comment on the same line as a #if/#else/#elseif/#endif.



Swift SVN r16912
2014-04-27 04:51:36 +00:00
Dmitri Hrybenko
df60e7751e Code completion for overrides: don't suggest to override members from outer
nominals in inner nominals


Swift SVN r16890
2014-04-26 20:08:11 +00:00
Dmitri Hrybenko
0cb8ddd213 Code completion for overrides: use a special chunk BraceStmtWithCursor for
braces

This allows clients to process it in a special way, for example, to indent the
resulting code.


Swift SVN r16884
2014-04-26 17:52:16 +00:00
Dmitri Hrybenko
2916aebba8 Code completion for overrides: complete constructors
Swift SVN r16882
2014-04-26 16:08:33 +00:00
Dmitri Hrybenko
164b5829ea Code completion for overrides: don't suggest to override members of the current
nominal


Swift SVN r16822
2014-04-25 14:46:58 +00:00
Dmitri Hrybenko
014d42acb0 Remove WIP that I accidentally committed
Swift SVN r16821
2014-04-25 14:45:17 +00:00
Dmitri Hrybenko
a701104732 Code completion: add a test that produces wrong results now
Swift SVN r16820
2014-04-25 14:35:44 +00:00
Dmitri Hrybenko
3ee34efee4 Code completion: complete declarations that are required for declared protocol
conformances

rdar://16539292

This is a hack in visible decl lookup.  The general solution that would also
improve type checker errors would be to make the type checker keep these broken
conformances and syntethize missing declarations to make downstream code type
check.  For that, see:

<rdar://problem/16723339> [QoI] Type checker should not be dropping protocol
conformances explicitly spelled in the source


Swift SVN r16818
2014-04-25 14:03:39 +00:00
Dmitri Hrybenko
35c587aadf Code completion: don't complete associated types on non-metatypes
Swift SVN r16817
2014-04-25 12:46:32 +00:00
Dmitri Hrybenko
f06d124ef9 Code completion: fix crash on invalid protocol conformance
rdar://16723481


Swift SVN r16815
2014-04-25 09:58:44 +00:00
Dmitri Hrybenko
b3851a79e2 REPL code completion: handle PreferredCursorPosition chunk
Swift SVN r16759
2014-04-24 18:15:55 +00:00
Dmitri Hrybenko
28c2514589 Remove unused member
Swift SVN r16756
2014-04-24 16:00:32 +00:00
Dmitri Hrybenko
e36baf4123 Code completion: add basic support for completing overriding decls
rdar://16539292


Swift SVN r16755
2014-04-24 15:59:05 +00:00
Dmitri Hrybenko
00722d4c2e Comment parsing: extract parameter name from the text in :param: field
Swift SVN r16750
2014-04-24 09:13:42 +00:00
Dmitri Hrybenko
cfb3d287de Comment to XML conversion: add pretty-printed declaration
Swift SVN r16698
2014-04-23 11:57:12 +00:00
Argyrios Kyrtzidis
9bd10774b0 [IDE/CodeCompletion] Mark a code-completion result as 'not-recommended' if the declaration
that it refers to is unavailable.

rdar://16675550

Swift SVN r16687
2014-04-23 04:26:14 +00:00
Argyrios Kyrtzidis
2db90e9105 [IDE] For the syntax node of functions, set the name range to the range of the function signature.
Swift SVN r16680
2014-04-23 00:24:11 +00:00
Dmitri Hrybenko
021b5b4561 Comment to XML conversion: pass through block markup as HTML tags, for the lack
of better markup in current XML schema

I know this XML is probably as bad as XML can get, but at least it allows
clients to render some block markup.  I expect to replace this with some real
tags soon.


Swift SVN r16657
2014-04-22 17:15:46 +00:00
Dmitri Hrybenko
2812aba59c Code completion: speed up by more than 2x
... at the cost of correctness, see test changes

This change was suggested by Argyrios.

But we still take 10 seconds to compute completion results for Cocoa.

Swift SVN r16599
2014-04-20 20:03:25 +00:00
Doug Gregor
09797f7f99 Introduce a new declaration node, ParamDecl, for function parameters.
Use this node to capture the argument name and its source location in
the AST. We're only building these in one place at the moment; the
rest will be updated soon.


Swift SVN r16581
2014-04-20 05:23:35 +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
Chris Lattner
7eb2a79d90 remove dead variable
Swift SVN r16546
2014-04-18 20:31:51 +00:00
Dmitri Hrybenko
e2e8db5f38 Migrate IB attributes to new decl attribute representation and fix a few bugs
along the way


Swift SVN r16542
2014-04-18 20:00:09 +00:00
Dmitri Hrybenko
a526517cec Module interface printing: print all sub-sub-modules when instructed to do so
<<Darwin>>->isModuleVisible(<<Darwin.*>>) returns false for some reason,
and I am not sure if this is correct or not.


Swift SVN r16520
2014-04-18 14:14:20 +00:00
Argyrios Kyrtzidis
a0b97196f1 [IDE] Provide the declaration along with the SyntaxStructureNode.
Swift SVN r16504
2014-04-18 07:07:15 +00:00
Dmitri Hrybenko
6680ed3956 Comment parsing: for now, treat classes, protocols and structs as "class-like"
things


Swift SVN r16453
2014-04-17 16:13:47 +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
Argyrios Kyrtzidis
0ccc83db54 [IDE/ModuleInterface] Print a blank line between top-level Swift declarations.
Swift SVN r16442
2014-04-17 05:10:46 +00:00
Dmitri Hrybenko
70ed107d69 Code completion: extend the hack to complete function call patterns after left
paren to work with method calls on AnyObject and curried function calls


Swift SVN r16412
2014-04-16 13:42:55 +00:00
Dmitri Hrybenko
236c581de7 Code completion: complete "?.member" on T?, and ".member" on @unchecked T?
In order for Xcode to use these completions, we complete "?.member" when the
user has typed "anOptional.", but we also say that in order to apply this
result, N bytes to the left of the cursor should be erased first.

rdar://16579657 rdar://15233283


Swift SVN r16409
2014-04-16 10:50:14 +00:00
Dmitri Hrybenko
da41b2e766 Code completion: provide results for initializers after the left paren:
class A {
    init(a: Int) {}
  }
  A(#^HERE^#

In its current state, this is a hack that I am not proud of.  There is
potential here to provide such completions for all function calls:

  class A {
    func foo(a: Int) {}
    func foo(a: Double) {}
  }
  A().foo(#^HERE^#

but this requires code completion doing its own name lookup, since the type
checker will give us an error type due to ambiguity of overloaded functions.

Type checker also sometimes gives up in cases like these:

  struct A {
    func foo() {}
  }
  A().foo

which is understandable, since we disallow partial applications of functions on
values, but returning the correct type here is useful for code completion.

rdar://16597372


Swift SVN r16367
2014-04-15 12:05:05 +00:00
Dmitri Hrybenko
0aeb095416 Code completion: change the spelling of DynamicLookupMethodCallTail chunk to "!"
This is the "!" in method calls on AnyObject:

  var a: AnyObject = get()
  a.doFoo!()

rdar://15233283


Swift SVN r16366
2014-04-15 09:36:50 +00:00
Dmitri Hrybenko
677d352ddd Remove no-op and unused code from code completion that I have no idea about
Swift SVN r16365
2014-04-15 09:07:30 +00:00
Argyrios Kyrtzidis
a9ea63a7f7 [IDE/ModuleInterface] Adjust the indentation of regular comments to match the current indentation level.
Swift SVN r16362
2014-04-15 06:27:40 +00:00
Argyrios Kyrtzidis
f931674573 [IDE/ModuleInterface] Pick up the vertical spacing/grouping that is used in the clang module header.
Swift SVN r16294
2014-04-14 03:28:08 +00:00
Argyrios Kyrtzidis
31a620f1ee [IDE/ModuleInterface] Fix erroneously printed newline between a regular comment and the declaration it is 'attached' to.
Swift SVN r16293
2014-04-14 03:28:05 +00:00
Argyrios Kyrtzidis
293d771905 [IDE] Add an option to skip printing declarations that start with '_', for the module interface.
rdar://16559411

Swift SVN r16272
2014-04-13 04:35:30 +00:00
Argyrios Kyrtzidis
ba30e56b58 [IDE] When picking regular comments from clang headers, make sure that extensions/categories
are printed in the right source location otherwise the comments will be out-of-place.

Swift SVN r16271
2014-04-13 04:35:29 +00:00
Argyrios Kyrtzidis
2da311cf1f [IDE] For the module interface, don't print submodule imports, unless they are submodules
of the module we are printing.

rdar://16530804

Swift SVN r16262
2014-04-12 19:20:08 +00:00
Argyrios Kyrtzidis
49ef6ab8cd [IDE] Use ClangNode::getLocation().
Swift SVN r16253
2014-04-12 16:33:39 +00:00
Argyrios Kyrtzidis
4c91bd074f [IDE] Print out regular comments from the clang module headers, for the module interface.
rdar://16451119

Swift SVN r16249
2014-04-12 05:21:08 +00:00
Dmitri Hrybenko
547e1b5874 Code completion: print non-inout '@unchecked' optional arguments as normal
optionals, because the difference is not important for the caller.

rdar://16576739


Swift SVN r16212
2014-04-11 10:58:07 +00:00