Commit Graph

570 Commits

Author SHA1 Message Date
Max Moiseev
2e67c13d15 Fixing some tests 2017-04-14 16:19:06 -07:00
swift-ci
d484795ba3 Merge remote-tracking branch 'origin/master' into master-next 2017-04-11 18:08:30 -07:00
Dave Abrahams
1f7ec57b04 Merge pull request #1527 from codestergit/master
[Stdlib] Improves Collection.sort  to accept throwing closure
2017-04-11 18:03:17 -07:00
Max Moiseev
fe4553eb80 Merge branch 'master' into new-integer-protocols 2017-04-11 17:07:11 -07:00
swift-ci
3dc82730fd Merge remote-tracking branch 'origin/master' into master-next 2017-04-10 18:28:31 -07:00
swift-ci
03edb54884 Merge pull request #8677 from nkcsgexi/report-submodule 2017-04-10 18:25:06 -07:00
Xi Ge
a6f14faca6 SourceKit/DocSupport: Report sub-module information, if any, for top-level decls imported from clang. rdar://31415030 2017-04-10 17:48:50 -07:00
Max Moiseev
a3a3351bd8 Merge branch 'master' into new-integer-protocols 2017-04-10 15:41:13 -07:00
swift-ci
0cd97afd81 Merge remote-tracking branch 'origin/master' into master-next 2017-04-10 14:29:08 -07:00
Nathan Hawes
ea36b9892b Merge pull request #8665 from nathawes/rdar31539499-cursorinfo-nested-interpolated-strings
[cursor-info] Fix invalid assertion firing for symbols referenced within nested interpolated strings
2017-04-10 14:19:10 -07:00
Nathan Hawes
50aba8539b [cursor-info] Fix invalid assertion firing for symbols referenced within nested interpolated strings 2017-04-10 13:22:09 -07:00
Bob Wilson
7b75291625 Fix Swift lit tests after LLVM r299775
LLVM's lit implementation switched to use process pools in r299775.
This exposed some pickling problems in Swift's lit files. For a function
or class to be pickle-able, it has to be in the top-level of a real
Python module.

* The SwiftTest lit format class was embedded in the lit.cfg file, so
I moved it out to a separate Python file.

* The inferSwiftBinary function was being stashed in the
config.inferSwiftBinary field and later used to find tools for SourceKit
testing. I moved the config settings for those tools into the top-level
lit.cfg file. I expect this will cause warnings about them not existing
in some cases, but that should be fairly harmless. Maybe someone can
come up with a better solution later.

* The config.substitutions for SourceKit's lit.local.cfg was storing a
reference to an embedded sed_clean function, which just returned a
constant string. I changed the function to be a string, using Python's
raw string feature to avoid the problems that likely led to it being a
function in the first place. (Just guessing.)
2017-04-10 11:07:42 -07:00
Max Moiseev
022665547b Merge branch 'master' into new-integer-protocols 2017-04-07 14:42:53 -07:00
Norio Nomura
b1b246f676 [SourceKit] Remove XFAIL: linux from tests pass by fixing https://bugs.swift.org/browse/SR-4491 2017-04-07 18:42:39 +09:00
Norio Nomura
3a3acecf19 [SourceKit] Remove XFAIL: linux from doc_swift_module*.swift 2017-04-07 16:28:02 +09:00
Nathan Hawes
534ec7ed87 Merge pull request #8569 from nathawes/rdar30248264-cursorinfo-invalid-base-type
[cursor-info] Fix crash due to invalid base type in the PrintOptions passed to the AST printer
2017-04-06 17:11:33 -07:00
Nathan Hawes
53e1bdc1e3 [cursor-info] Fix crash due to invalid base type in the PrintOptions passed to the AST printer
Resolves rdar://problem/30248264
Also added test cases for rdar://problem/30292429 (already fixed)
2017-04-06 16:04:07 -07:00
Max Moiseev
52882c47b4 Merge branch 'master' into new-integer-protocols 2017-04-05 11:26:13 -07:00
David Farler
65668c9d82 Cache Code Completion results from PCH files
- Add CompilerInvocation::getPCHHash
  This will be used when creating a unique filename for a persistent
  precompiled bridging header.

- Automatically generate and use a precompiled briding header
  When we're given both -import-objc-header and -pch-output-dir
  arguments, we will try to:
  - Validate what we think the PCH filename should be for the bridging
    header, based on the Swift PCH hash and the clang module hash.
    - If we're successful, we'll just use it.
    - If it's out of date or something else is wrong, we'll try to
      emit it.
  - This gives us a single filename which we can `stat` to check for the
    validity of our code completion cache, which is keyed off of module
    name, module filename, and module file age.

- Cache code completion results from imported modules
  If we just have a single .PCH file imported, we can use that file as
  part of the key used to cache declarations in a module.  Because
  multiple files can contribute to the __ObjC module, we've always given
  it the phony filename "<imports>", which never exists, so `stat`-ing it
  always fails and we never cache declarations in it.

  This is extremely problematic for projects with huge bridging headers.
  In the case where we have a single PCH import, this can bring warm code
  completion times down to about 500ms from over 2-3s, so it can provide a
  nice performance win for IDEs.

- Add a new test that performs two code-completion requests with a bridging header.
- Add some -pch-output-dir flags to existing SourceKit tests that import a bridging
  header.

rdar://problem/31198982
2017-04-04 20:44:33 -07:00
Roman Levenstein
1106f139f4 Merge pull request #8454 from swiftix/wip-warn-about-unused-generic-params
[type-checker] More correct way to determine if a given generic parameter of a function cannot be inferred because it is not used
2017-04-04 18:51:47 -07:00
Xi Ge
1fcbc90f5f [SourceKit] Use offset to indicate the locations of parameters' parents to facilitate subsequent cursor-info requests. 2017-04-04 17:32:30 -07:00
Xi Ge
f669afff50 [SourceKit] When reporting the cursor info for parameter decls, report the locations of the function-like entities they belong to. rdar://30702790 (#8541) 2017-04-04 15:24:36 -07:00
Roman Levenstein
75c8274fd9 Fix tests 2017-04-04 13:10:43 -07:00
Norio Nomura
0c2a4461fb [SourceKit] Mark test failing on Linux 2017-04-04 18:46:01 +09:00
Norio Nomura
c49fa3c6d2 [SourceKit] Mark some tests requires objc_interop 2017-04-04 18:45:04 +09:00
Norio Nomura
59d575120d [SourceKit] Mark tests failing with "SOURCEKITD FATAL ERROR: sourcekitd object did not resolve to a known type" on Linux 2017-04-04 18:41:38 +09:00
Norio Nomura
a19145c8e5 [SourceKit] Mark tests failing with assertion `!GlibcModuleMapPath.empty()' on Linux 2017-04-04 18:38:11 +09:00
Norio Nomura
7b4ac9e6af [SourceKit] Update mangling in expected response of test for Linux 2017-04-04 18:34:12 +09:00
codestergit
aa9e9edc8a [Stdlib] Improves sort and sorted to accept throwing clousre
This commit resolves https://bugs.swift.org/browse/SR-715
2017-04-03 16:59:02 +05:30
Norio Nomura
af8ce9c1b5 Enable SourceKit tests if build SourceKit 2017-04-02 09:16:45 +09:00
Max Moiseev
3cbcd716f5 Merge branch 'master' into new-integer-protocols 2017-03-31 10:03:20 -07:00
Slava Pestov
9a3f0fc527 Sema: Fix for SourceKit crash in inheritsSuperclassInitializers()
Two problems:

1) We were tearing down the type checker too early, before all
   relevant decls in other files had been type checked, so there
   was no LazyResolver available for use in the ASTContext.

   This might explain the crashes coming through
   diagnoseUnintendedObjCMethodOverrides().

2) When a lazy resolver was set in the ASTContext, we were not
   using it in the case where nullptr was passed in as the
   'resolver' parameter to inheritsSuperclassInitializers().

   This might fix the crashes where we were coming in from other
   code paths, but I'm less confident about this case.

Possibly fixes <rdar://problem/29043074>, <rdar://problem/30976765>,
<rdar://problem/31122590>, and <rdar://problem/31286627>, and the
many other similar-looking dupes.
2017-03-31 00:04:17 -07:00
Xi Ge
3ad7df273f [SourceKit] DocSupport: constraint extensions provide default implementation too. rdar://25692947 (#8398) 2017-03-28 15:55:39 -07:00
Xi Ge
6e3698f7e8 SourceKit: for DocSupport, report default implementations of inherited protocols in sub-protocol's extensions. rdar://25692947 (#8394)
For instance:

protocol P1 { 
  func foo() 
}
protocol P2 : P1 { 
  func bar() 
}
extension P2 { 
  func foo() {} 
}

We report the foo() in P2's extension as the default implementation of foo() declared in P1.
2017-03-28 12:10:29 -07:00
Max Moiseev
969b4814e2 Merge branch 'master' into new-integer-protocols 2017-03-27 20:40:15 -07:00
Erik Eckstein
327017a65b Mangling: support mangling of varargs even if it's not the last argument.
Example:
func a(arr: Int..., n: String)

fixes SR-1076
2017-03-25 19:07:52 -07:00
Max Moiseev
6f6c2aee8c Fixing the rest of the tests 2017-03-22 16:06:10 -07:00
Max Moiseev
b9fb3badc8 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-03-22 12:30:24 -07:00
Roman Levenstein
397d801e19 Merge pull request #7350 from swiftix/resilience-benchmarks
Add a lot of resilience-related annotations to stdlib to improve the performance of the resilient stdlib
2017-03-16 21:22:13 -07:00
Erik Eckstein
761d6512fe SourceKit: switch to new mangling in ide::printDeclTypeUSR
This was still missing.
2017-03-16 19:57:16 -07:00
Roman Levenstein
2c811b82a1 Adjust some tests to pass in non-resilient and resilient modes. 2017-03-16 19:46:11 -07:00
Erik Eckstein
2a55b26e46 Mangling: enable new mangling for symbols 2017-03-16 12:04:08 -07:00
Xi Ge
0d97dd4992 [SourceKit] Add a new request to translate markup text to its XML equivalence. rdar://30587403 (#8088)
Required fields:
- "key.request": "source.request.convert.markup.xml"
- "key.sourcetext": "markup text"

Expected response:
- "key.sourcetext": "xml text"
2017-03-14 15:13:43 -07:00
Jordan Rose
f12afd2ffa Merge pull request #8010 from KingOfBrian/bugfix/SR-1762-Remove-Final-In-Protocol-Extensions
Remove final in protocol extensions
2017-03-13 16:23:24 -07:00
Xi Ge
f76ed374a7 RangeInfo: Treat comments transparently when resolving a given range. rdar://30926193 (#8052) 2017-03-13 14:47:02 -07:00
Max Moiseev
ff81681f4f Properly naming bit count properties 2017-03-13 11:50:02 -07:00
Max Moiseev
7d73b2e1ca Arithmetic => Numeric 2017-03-13 11:50:02 -07:00
Brian King
29c1fc472b Generate an error message on protocol extensions with the final attribute. 2017-03-09 14:18:39 -05:00
Xi Ge
b5256f53b2 Sema: introduce a language option flag, DiagnosticsEditorMode. (#7982)
SourceKit always sets it positively. This may lead to more aggressive fixits however
less informative messages. We currently use the flag only for filling protocol stubs.
2017-03-08 12:46:02 -08:00
Max Moiseev
835b8809d2 Merge branch 'master' into new-integer-protocols 2017-03-07 16:18:54 -08:00