Commit Graph

2145 Commits

Author SHA1 Message Date
Nathan Hawes
3850417035 [Test][CodeCompletion] Consistently check for the 'unknown' type relation when there's no expected type.
The tests were matching the previous implementation's output, which sometimes produced 'unknown' and sometimes 'unrelated' in cases where there was no expected type from the context.
2020-09-01 13:25:37 -07:00
Nathan Hawes
03b5296f70 [test] Update code completion test with improved type relation result. 2020-08-28 22:24:24 -07:00
swift_jenkins
466b0eee6e Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-26 14:16:52 -07:00
Rintaro Ishizaki
bf5fb4d2bb [CodeCompletion] Don't update VFS content hash map after each completion
This was not needed. The list of depenencies should not be changed
during fast-completion sessions.

This was also harmful because it calls stat(2) for all the dependency
files.

rdar://problem/67773257
2020-08-26 09:56:36 -07:00
swift_jenkins
9ab003bcf9 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-14 15:14:01 -07:00
Rintaro Ishizaki
f4ae514802 Merge pull request #33475 from rintaro/ide-completion-inactiveifconfig-rdar67027408
[CodeCompletion] Parse #if block containing CC token as active
2020-08-14 15:02:09 -07:00
Rintaro Ishizaki
dd6046ba16 [CodeCompletion] Stop recording interface hash when searching CC token 2020-08-14 10:33:53 -07:00
swift-ci
670f798134 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-13 15:43:17 -07:00
Ben Barham
77c70e9fe6 [SourceKit/CodeFormat] Indent lines in multi-line strings
When the multi-line string is unterminated, the indentation of a line
will be the same as the first previous line that had contents, unless
that line is the line containing the start quotes. In that case the
indentation will be:
  - the same as the start quote indentation, if the quotes are the only
    contents on the line, or
  - an extra indentation level to the start quote line otherwise

Lines within a terminated multi-line string or lines with content will
only ever be indented if their current indentation is invalid (ie. their
indentation level is less than that of their end quotes).

This rule is to prevent any signficant (and possibly unintended)
whitespace being added to existing strings during a whole file/range
format - Xcode does not remove whitespace from whitespace-only lines by
default. This could be improved if the reformat was sent the actual
range rather than a line at a time. Different indentation could then be
chosen if the range was in fact a single line.

Resolves rdar://32181422
2020-08-13 12:35:57 +10:00
swift-ci
bab4706e94 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-30 14:03:22 -07:00
Rintaro Ishizaki
facabd8010 Merge pull request #33200 from rintaro/ide-completion-rdar66301353
[CodeCompletion] Fix issue in dependency checking for the editing file
2020-07-30 14:02:03 -07:00
Rintaro Ishizaki
2f4dcf3e2f [CodeCompletion] Fix issue in dependency checking for the editing file
'SM.getCodeCompletionBufferID()' returns the buffer ID of the previous
code completion. 'CI.getCodeCompletionFile()->getBufferID()' always
returns the original source buffer ID of the current file in the main
module. The latter is needed for excluding buffer ID for dependency checking.

rdar://problem/66301353
2020-07-30 09:27:58 -07:00
swift-ci
a76254f2ff Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-30 09:03:30 -07:00
Argyrios Kyrtzidis
324ccb576e [SourceKit] Fix issue where CompletionCheckDependencyInterval is set to 0 when the global config request is sent
Fixes rdar://66309544
2020-07-29 21:44:09 -07:00
swift-ci
c22b1f580b Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-21 16:24:01 -07:00
Nathan Hawes
f7820f5a35 Merge pull request #33031 from nathawes/dont-synthesize-extension-members-in-subclasses
[SourceKit/DocSupport] Don't synthesize extensions for inherited protocol conformances.
2020-07-21 16:09:41 -07:00
Nathan Hawes
e68ab1da8e [SourceKit/DocSupport] Don't synthesize extensions for inherited protocol conformances.
The Base class already includes them, so don't duplicate them in its
subclasses. Also stops us including members from extensions of the base class
itself.

Resolves rdar://problem/50960433
2020-07-21 11:53:06 -07:00
Nathan Hawes
9d4ed5f39c Manually merge remote-tracking branch 'upstream/master' into manually-merge-master-to-master-rebranch 2020-07-20 16:09:55 -07:00
Rintaro Ishizaki
a6b9815d07 Merge pull request #32946 from rintaro/ide-completion-rdar65692922
[CodeCompletion] Fast completion inside function builder function
2020-07-17 11:27:08 -07:00
Rintaro Ishizaki
e953e523a0 [CodeCompletion] Fast completion inside function builder function
`PreCheckFunctionBuilderRequest` applies `PreCheckExpression` to the
expressions inside the function body. Previously it used to receive only
`AnyFunctionRef` (`FunctionDecl` or `ClosureExpr`) as the parameter.
However, when fast-completion kicks-in, it replaces the body of the
function, then tries to call `PreCheckFunctionBuilderRequest` again, with
the same function decl as before. It used to return cached "Success"
result, but it didn't actually apply `PreCheckExpression`. So any
`UnresolvedDeclRefExpr` remained unresolved.

In this patch, make `PreCheckFunctionBuilderRequest` receive "body" of the
function as well, so it doesn't return the cached result for the *previous*
body.

rdar://problem/65692922
2020-07-16 23:38:49 -07:00
Ben Langmuir
209a7b3813 Revert "Merge pull request #32628 from benlangmuir/sema-repeat"
This reverts commit 35eab3e3a8, reversing
changes made to d5a549a9e4.

This caused an unexpected regression.

rdar://65554791
2020-07-14 17:00:02 -07:00
Rintaro Ishizaki
185317f722 Merge pull request #32779 from rintaro/ide-completion-closureplaceholder-rdar63607976
[PlaceholderExpansion] Omit return type in closure signature
2020-07-09 21:20:25 -07:00
Rintaro Ishizaki
17be66c3d6 [PlaceholderExpansion] Omit return type in closure signature
Return type in the closure signature is often redundant when expanding
placeholders, because the type of the clossures are usually inferred
from the context (i.e. calling function), users don't need to write the
return type explicitly.

They are not only redundant, but also sometimes harmful when the return
type is a generic parameter or its requirement. Actually, there is no
correct spelling in such cases.

So omit the return type and the parentheses around the parameter clause.

rdar://problem/63607976
2020-07-09 14:37:17 -07:00
Nathan Hawes
9bcb54910e [AST] Prefer the 'macOS' spelling over 'OSX' when printing the platform kind.
This affects module interfaces, interface generation in sourcekitd, and
diagnostics. Also fixes a fixit that was assuming the 'OSX' spelling when
computing the source range to replace.

Resolves rdar://problem/64667960
2020-07-08 13:51:25 -07:00
Daniel Duan
942893d7a6 ClangImporter: Preserve CChar type (#32692)
Addresses SR-466.
2020-07-08 10:18:58 -07:00
Mishal Shah
92ca9fc924 [Apple Silicon] Generalize tests for other macOS architectures
Most of the changes fall into a few categories:
* Replace explicit "x86_64" with %target-cpu in lit tests
* Cope with architecture differences in IR/asm/etc. macOS-specific tests
2020-07-02 16:27:46 -07:00
swift_jenkins
dbb35a30a5 Merge remote-tracking branch 'origin/master' into master-next 2020-07-01 09:58:42 -07:00
Ben Langmuir
35eab3e3a8 Merge pull request #32628 from benlangmuir/sema-repeat
[sourcekit] Retain semantic annotations across queries
2020-07-01 09:54:53 -07:00
Ben Langmuir
223b5ed4e3 [test] use %diff to fix Windows test 2020-06-30 16:08:32 -07:00
Ben Langmuir
a86eaccdf2 [sourcekit] Retain semantic annotations across queries
Do not remove semantic annotations, so that if a client sends multiple
magic replacetext 0, 0, "" requests they will all return the same
result. This makes sourcekitd more robust around providing semantic
highlighting if the editor may make multiple queries for document
update.

rdar://64904029
2020-06-30 13:47:48 -07:00
swift_jenkins
a429ec15ec Merge remote-tracking branch 'origin/master' into master-next 2020-06-30 09:39:23 -07:00
Rintaro Ishizaki
30ccb52948 Merge pull request #32572 from rintaro/sourcekit-fast-completionlikereq-rdar64782333
[SourceKit] Enable ASTContext caching in other completion-like requests
2020-06-30 09:21:17 -07:00
swift_jenkins
fdff439917 Merge remote-tracking branch 'origin/master' into master-next 2020-06-30 07:58:30 -07:00
Saleem Abdulrasool
1d09970c08 Merge pull request #32573 from compnerd/aspirational-quotes
test: attempt to quote python interpreter path
2020-06-30 07:47:44 -07:00
Rintaro Ishizaki
33336dfb45 [SouceKit] Make "ASTContext reusing" optional
for 'ConformingMethodList' and 'TypeContextInfo'
2020-06-29 15:09:42 -07:00
swift_jenkins
91414522a3 Merge remote-tracking branch 'origin/master' into master-next 2020-06-29 11:39:04 -07:00
Saleem Abdulrasool
6d63d957d8 test: attempt to quote python interpreter path
Attempt to properly quote the python interpreter path in the lit
configuration. This was quoted in some places but not others. This
attempts to homogenise the path quoting.
2020-06-29 17:36:46 +00:00
Rintaro Ishizaki
8307c6a95c [SourceKit] Report 'key.reusingastcontext' in completion like requests
'TypeContextInfo' and 'ConformingMethodList'
2020-06-29 10:21:32 -07:00
Nathan Hawes
a1f0155525 [SourceKit/CursorInfo] Still print implicit decls in cursorinfo to handle compiler synthesized decls
We weren't printing memberwise inits, shorthand arguments (e.g. $0, $1), and
other implicit decls, so cursor info would give empty annotated decl and fully
annotated decl fields for them.

Resolves rdar://problem/58929991
2020-06-26 11:12:10 -07:00
swift_jenkins
488bc14ef3 Merge remote-tracking branch 'origin/master' into master-next 2020-06-18 19:38:41 -07:00
Suyash Srijan
7d082ab2bf [ASTMangler] Don't verify the USR mangling for invalid storage decls (#32459) 2020-06-19 03:29:45 +01:00
swift_jenkins
2b1bf9ffd3 Merge remote-tracking branch 'origin/master' into master-next 2020-06-15 14:39:00 -07:00
Nathan Hawes
47554c186f Merge pull request #31942 from rockbruno/allelementsmatter
[SourceKit][SR-12837] Add effective access level of references
2020-06-15 14:24:32 -07:00
swift_jenkins
18f376f3a5 Merge remote-tracking branch 'origin/master' into master-next 2020-06-10 17:58:48 -07:00
Nathan Hawes
f89e213bec Merge pull request #32281 from nathawes/handle-filelists-in-sourcekit-driver-args
[Driver/SourceKit] Handle filelist driver args in getSingleFrontendInvocationFromDriverArguments
2020-06-10 17:39:52 -07:00
swift_jenkins
341070e163 Merge remote-tracking branch 'origin/master' into master-next 2020-06-10 14:58:36 -07:00
Nathan Hawes
41758c047c Merge pull request #32148 from nathawes/doc-info-underscored-protocol-synthesised-extensions
[IDE][SourceKit/DocSupport] Add members of underscored protocol extensions in extensions of conforming types.
2020-06-10 14:49:18 -07:00
Nathan Hawes
50dc7d85dd [Driver/SourceKit] Handle filelist driver args in getSingleFrontendInvocationFromDriverArguments
getSingleFrontendInvocationFromDriverArguments is set up to never produce file
lists in the output frontend arguments, but since the driver accepts file lists
as input arguments, this should too.
2020-06-10 10:50:56 -07:00
Karoy Lorentey
57ea964f2c Merge commit '3eb82c183662945687f48e11c09828f551b34858' into master-next
# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
2020-06-08 16:58:37 -07:00
Karoy Lorentey
68351d2110 Revert "Merge remote-tracking branch 'origin/master-next'"
This reverts commit 1c9b0908e6, reversing
changes made to 3eb82c1836.
2020-06-08 16:48:38 -07:00