Commit Graph

2145 Commits

Author SHA1 Message Date
Karoy Lorentey
1c9b0908e6 Merge remote-tracking branch 'origin/master-next'
# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
2020-06-08 16:43:40 -07:00
Ben Langmuir
fadfb6c945 Merge pull request #31874 from benlangmuir/driver-tmp-sad
[driver/sourcekit] Avoid creating temporary output files in TMPDIR
2020-06-05 13:43:23 -07:00
Rintaro Ishizaki
bdfe1b1b08 [Parse] Avoid delayed member parsing for type decl with missing brace
Cache empty member list so that 'IterableDeclContext::loadAllMembers()'
doesn't perform delayed member parsing.

Fixes: rdar://problem/63921896
2020-06-04 14:34:22 -07:00
Rintaro Ishizaki
17b681bf20 [SourceKit] Disable complete_build_session.swift test file while investigating 2020-06-03 11:11:31 -07:00
Nathan Hawes
51bace649b [IDE][SourceKit/DocSupport] Add members of underscored protocol extensions in extensions of conforming types.
We would previously hide the protocol, its extensions and members, but the '_'
prefix really just means the protocol itself isn't intended for clients, rather
than its members.

This also adds support for 'fully_annotated_decl' entries in doc-info for
extensions to be consistent with every other decl, and removes the
'fully_annotated_generic_signature' entry we supplied as a fallback.

Also fixes several bugs with the synthesized extensions mechanism:
- The type sustitutions applied to the extension's requirements were computed
  using the extension itself as the decl context rather than the extension's
  nominal. The meant the extension's requirements themselves were assumed to
  hold when determining the substitutions, so equality constraints were always
  met. Because of this extension members were incorrectly merged with the base
  nominal or its extensions despite having additional constraints.
- Types within the requirements weren't being transformed when printed (e.g.
  'Self.Element' was printed rather than 'T') both in the interface output and
  in the requirements list. We were also incorrectly printing requirements
  that were already satisfied once the base type was subsituted in.
- If both the protocol extension and 'enabling' extension of the base nominal
  that added the protocol conformance had conditional requirements, we were
  only printing the protocol extension's requirements in the synthesized
  extension.
- The USR and annotated decl output embedded in the 'key.doc.full_as_xml'
  string for synthesized members were printed to match their original context, rather than
  the synthesized one.

Resolves rdar://problem/57121937
2020-06-02 15:38:34 -07:00
Bruno Rocha
b50813a6bc Run linux only test 2020-05-29 18:59:25 +02:00
Bruno Rocha
6ebf0d554e Add a test showing local content being ignored 2020-05-29 18:59:25 +02:00
Bruno Rocha
51c0024674 Whitelist instead of blacklist 2020-05-29 18:59:25 +02:00
Bruno Rocha
9b05823c88 Remove accessors and add PW tests 2020-05-29 18:59:25 +02:00
Bruno Rocha
f000639cce Improve tests and generate the rest of the output 2020-05-29 18:59:25 +02:00
Bruno Rocha
2a48e19ff0 [SourceKit] Add Effective Scope to Index 2020-05-29 18:59:25 +02:00
swift_jenkins
e9646cfcc2 Merge remote-tracking branch 'origin/master' into master-next 2020-05-28 14:18:42 -07:00
Argyrios Kyrtzidis
4f4c90b9fe Merge pull request #32046 from nathawes/interface-gen-exposed-underscore
[SourceKit][InterfaceGen] Don't print clang decls marked with the swift_private attribute.
2020-05-28 14:01:02 -07:00
swift_jenkins
737ed15ab3 Merge remote-tracking branch 'origin/master' into master-next 2020-05-27 22:18:34 -07:00
Nathan Hawes
79247b22e2 [SourceKit][InterfaceGen] Don't print clang decls marked with the swift_private attribute.
This attribute is intended to mean there's a replacement declaration that
should be used instead in Swift code. We already filter out decls with this
attribute in code completion, but were still exposing them in generated
interfaces.

Resolves rdar://problem/62464954
2020-05-27 15:23:50 -07:00
Rintaro Ishizaki
ad51f4f1a8 [CodeCompletion] Fix non-determinisc failures in dependency check test cases
Sleep a few seconds to ensure the timestamp of the modified files are
different from the last completion.

rdar://problem/62923248
2020-05-27 08:58:14 -07:00
swift_jenkins
48e8953fe6 Merge remote-tracking branch 'origin/master' into master-next 2020-05-22 12:38:49 -07:00
Nathan Hawes
2ac1eeed3f Merge pull request #31964 from nathawes/fix-header-interface-lone-get-issue
[IDE][InterfaceGen] Always print the top-level decl in header file generated interfaces.
2020-05-22 12:37:36 -07:00
Nathan Hawes
5cb1f30994 [IDE][InterfaceGen] Always print the top-level decl in header file generated interface.
While the decls being printed for header file generated interfaces were mapped
from the top-level clang decls in that file, the Swift decls they correspond to
may not be top-level. E.g. top-level functions in the header file can be mapped
to property accessors on the Swift side, which were being printed simply as
"get" at the top level.

This updates header interface generation to map each decl to its top-level decl
before printing.

Resolves rdar://problem/63409659
2020-05-21 21:12:17 -07:00
swift_jenkins
5d16b82996 Merge remote-tracking branch 'origin/master' into master-next 2020-05-21 17:59:18 -07:00
Nathan Hawes
defac258ba Merge pull request #31941 from nathawes/pattern-binding-decl-indentation
[SourceKit/CodeFormat] Don't column-align PatternBindingDecl entries in certain cases.
2020-05-21 17:58:21 -07:00
Nathan Hawes
99edbf0e56 [SourceKit/CodeFormat] Don't column-align PatternBindingDecl entries in certain cases.
Don't column align PBD entries if any entry spans from the same line as
the var/let to another line. E.g.

```
// Previous behavior:
let foo = someItem
      .getValue(), // Column-alignment looks ok here, but...
    bar = otherItem
      .getValue()

getAThing()
  .andDoStuffWithIt()
let foo = someItem
      .getValue() // looks over-indented here, which is more common.
getOtherThing()
  .andDoStuffWithIt()

// New behavior
getAThing()
  .andDoStuffWithIt()
let foo = someItem
  .getValue() // No column alignment in this case...
doOtherThing()

let foo = someItem
   .getValue(), // Or in this case (unfortunate, but less common)...
   bar = otherItem
       .getValue()

let foo = someItem.getValue(),
    bar = otherItem.getValue() // but still column-aligned in this case.
```

Resolves rdar://problem/63309288
2020-05-21 11:49:35 -07:00
swift_jenkins
6d95937749 Merge remote-tracking branch 'origin/master' into master-next 2020-05-20 12:15:48 -07:00
Rintaro Ishizaki
c5280c80ca Merge pull request #31916 from rintaro/sourcekit-disabletest-rdar62923248
[CodeCompletion] Disable fast-completion dependecy checking test cases
2020-05-20 11:45:55 -07:00
swift_jenkins
3769c0e3e3 Merge remote-tracking branch 'origin/master' into master-next 2020-05-20 10:00:30 -07:00
Ben Langmuir
6d3a3dbe79 Merge pull request #31830 from DavidGoldman/compileopkind
[SourceKit] Include operation kind in compile notifications
2020-05-20 09:54:28 -07:00
Rintaro Ishizaki
6116f7d528 [CodeCompletion] Disable fast-completion dependecy checking test cases
while investigating.

rdar://problem/62923248
2020-05-20 09:07:00 -07:00
swift_jenkins
b4fd34bead Merge remote-tracking branch 'origin/master' into master-next 2020-05-19 12:19:26 -07:00
Dmitri Gribenko
b6d0ef5c81 Remove support for a broken std::regex in libstdc++ 4.8
Out of all operating systems ever supported by Swift, only Ubuntu 14.04
had libstdc++ 4.8, and Swift has sunset support for Ubuntu 14.04 for a
while now.
2020-05-19 17:20:55 +02:00
Ben Langmuir
ffc990f999 [driver/sourcekit] Avoid creating temporary output files in TMPDIR
When producing frontend arguments for sourcekitd, force the output mode
to -typecheck so that we do not create any temporary output files in the
driver. Previously, any sourcekitd operation that created a compiler
invocation would create 0-sized .o file inside $TMPDIR that would never
be cleaned up.

The new swift-driver project handles temporaries much better as
VirtualPath, and should not need this approach.

rdar://62366123
2020-05-18 16:52:41 -07:00
David Goldman
67a2fe494a Fix up compile operation kind
- `key.compile_operation` instead of `key.compileoperation`
- Make the operation kind optional (nothing emitted for perform sema)
2020-05-18 13:18:40 -04:00
Erik Eckstein
82a006be26 Merge remote-tracking branch 'origin/master' into master-next 2020-05-16 10:26:27 +02:00
David Goldman
40759df737 [SourceKit] Include operation kind in compile notifications
- Compile will start / did finish now includes the operation
  kind (perform sema or code complete).
- See also
  https://forums.swift.org/t/sourcekit-lsp-file-status-ux/35947
2020-05-15 17:16:30 -04:00
Rintaro Ishizaki
29398b1737 [ASTPrinter] Don't print inferred opaque result type witness
Opaque result type syntax is not usable except the declaration of
itself. In other places, users need to let them inferred. If they are
inferred associated type, they need to reffered by the name of the
associated type.

rdar://problem/59817674
2020-05-15 12:15:53 -07:00
Erik Eckstein
bdd337cd17 Merge remote-tracking branch 'origin/master' into master-next 2020-05-15 20:13:50 +02:00
Robert Widmann
43d1ba9ed9 [Gardening] Shepherd a Fix To SetAlgebra Docs 2020-05-14 11:50:35 -07:00
swift_jenkins
b63d3e68fb Merge remote-tracking branch 'origin/master' into master-next 2020-05-13 08:58:54 -07:00
Rintaro Ishizaki
14ff43e72b Merge pull request #31741 from rintaro/ide-completion-fastifconfig
[CodeCompletion] Inherit options when parsing new buffer
2020-05-13 08:51:39 -07:00
swift_jenkins
0cf8f30cd4 Merge remote-tracking branch 'origin/master' into master-next 2020-05-12 20:58:50 -07:00
Argyrios Kyrtzidis
64241a1379 Merge pull request #31742 from akyrtzi/sr-12631-print-if-let-variable-fix
[ASTPrinter] Fix issue where printing if-let variables shows their type as optional
2020-05-12 20:42:27 -07:00
Argyrios Kyrtzidis
b4baf420b4 [ASTPrinter] Fix issue where printing if-let variables shows their type as optional
Fixes
https://bugs.swift.org/browse/SR-12631
rdar://62894516
2020-05-12 16:39:09 -07:00
Rintaro Ishizaki
ec0c9484ab [CodeCompletion] Inherit options when parsing new buffer
for fast completions. Options may affect the parsing result.
Also, don't collect interface hash tokens inside inactive blocks.
2020-05-12 15:43:24 -07:00
swift_jenkins
101a3b4dce Merge remote-tracking branch 'origin/master' into master-next 2020-05-12 12:59:11 -07:00
swift_jenkins
fa28b24695 Merge remote-tracking branch 'origin/master' into master-next 2020-05-11 22:58:52 -07:00
Rintaro Ishizaki
7086ffb79f [CodeCompletion] Annotated result type
Introduced 'TypeAnnotationBegin' chunk kind for grouping the result type
name chunks.

rdar://problem/62617558
2020-05-11 22:56:22 -07:00
Rintaro Ishizaki
f80fdfca83 [CodeCompletion] Simplify a FileCheck test
Only check lines we really care about.
2020-05-11 14:48:28 -07:00
Rintaro Ishizaki
75a0c9f819 [CodeCompletion] Add 'IsSystem' flag to code completion result item
'key.is_system: 1' is added if the associated declaration is from a
system module.

rdar://problem/62617558
2020-05-11 12:24:36 -07:00
swift_jenkins
d4f39f3eaa Merge remote-tracking branch 'origin/master' into master-next 2020-05-06 19:26:08 -07:00
Owen Voorhees
70140a0170 Merge pull request #31521 from owenv/sourcekit-find-edu-notes
[SourceKit] Discover diagnostic documentation relative to sourcekitd
2020-05-06 19:54:02 -05:00
swift_jenkins
e6e25df038 Merge remote-tracking branch 'origin/master' into master-next 2020-05-06 14:35:31 -07:00