Commit Graph

1494 Commits

Author SHA1 Message Date
Rintaro Ishizaki
d2b70e439f Merge pull request #33811 from rintaro/sourcekit-completion-globalconfig
[SourceKit] Reorganize code completion options
2020-09-08 11:31:19 -07:00
Slava Pestov
658d4bf813 SourceKit: Refactor walkRelatedDecls() to not use unqualified lookup
This function used to perform an unqualified lookup without a source
location, to either find top-level members or members of a type.

Since this form of unqualified lookup is no longer supported, let's
instead explicitly call lookupInModule() or lookupQualified(),
depending on whether we're looking inside a type or not.
2020-09-06 15:52:19 -04:00
Rintaro Ishizaki
77b4f75608 [SourceKit] Reorgantize code completion options
* Abolish 'reuseastcontext' per-request option
* Add 'MaxASTContextReuseCount' global configuration
2020-09-03 19:30:05 -07:00
swift_jenkins
fb946baf59 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-28 11:08:22 -07:00
Frederick Kellison-Linn
352adc3b5d Remove Argument from UnresolvedMemberExpr
Instead, an expresison like `.foo()` is represented as an `UnresolvedMemberExpr` nested inside a `CallExpr`.
2020-08-26 22:42:30 -04:00
swift_jenkins
725692fd07 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-25 15:46:37 -07:00
Ben Langmuir
0d42d7d915 [gardening] format changed code 2020-08-25 10:43:43 -07:00
Ben Langmuir
af78895c45 [gardening] Sink compiler invocation code into libIDE 2020-08-25 10:39:37 -07:00
Ben Langmuir
cf87ad805f [gardening] Move filter name printing alongside other completion methods 2020-08-25 10:39:19 -07:00
Ben Langmuir
34de805d7f [gardening] Move source text printing alongside other completion methods 2020-08-25 10:39:19 -07:00
Ben Langmuir
6480bfaad2 [gardening] Move FuzzyStringMatcher to libIDE 2020-08-25 10:39:08 -07:00
swift-ci
9c2deebbb0 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-03 09:44:00 -07:00
Ben Langmuir
2680b0ce93 Merge pull request #33236 from benlangmuir/semantic-highlight-test-race3000
[sourcekitd] Fix potential race in semantic highlighting tests
2020-08-03 09:32:00 -07:00
Ben Langmuir
756ef4063c [sourcekitd] Fix potential race in semantic highlighting tests
In order to make range-shifting for semantic highlighting testable,
disable returning semantic information during an "open" request. This
has no real value anyway, since it only happens very rarely, and it
makes testing range shifting impossible to do deterministically.

rdar://problem/66386179
2020-07-31 13:51:08 -07:00
swift-ci
627ed18e79 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-22 12:04:54 -07:00
Artem Chikin
95c8391cd7 Merge pull request #32903 from artemcm/NoImplicitWhenExplicit
[Explicit Module Builds] Prevent SerializedModuleLoader from running in Explicit Module Build mode.
2020-07-22 11:49:08 -07:00
Artem Chikin
140fd73f83 [Explicit Module Builds] Prevent SerializedModuleLoader from running in Explicit Module Build mode.
In order to avoid accidentally implicitly loading modules that are expected but were not provided as explicit inputs.

- Use either SerializedModuleLoader or ExplicitSwiftModuleLoader for loading of partial modules, depending on whether we are in Explicit Module Build or Implicit Module Build mode.
2020-07-22 09:00:40 -07:00
swift-ci
404800266f Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-21 09:24:22 -07:00
Ben Langmuir
e9c3157ef6 Merge pull request #33020 from benlangmuir/editing-fun
[sourcekitd] Fix annotation range-shifting after edit
2020-07-21 09:11:05 -07:00
Ben Langmuir
01b5cf7c6f [sourcekitd] Fix annotation range-shifting after edit
When performing an insertion (replacement length = 0) inside an existing
annotation, we were forming a closed range instead of a half-open range,
causing us to shift the effected token instead of throwing it out. There
were also no tests for this functionality, so add a bunch of annotations
tests.

One area thing that is not tested is what if there have been multiple
edits since the tokens were created. This is difficult to engineer,
because right now making an edit immediately removes the semantic tokens
and returns them. It could happen if the AST build takes longer than the
edits, but there is no way to guarantee that in the current API.

rdar://65748892
2020-07-20 16:56:49 -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
Suyash Srijan
58a84ea4c1 [NFC] Cleanup some code to use 'swift::getParameterList(ValueDecl)' to fetch parameter lists (#32979) 2020-07-20 19:50:37 +01: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
244dc4a768 [AST] Rename PlatformKind::OSX to PlatformKind::macOS
Because the names are coming from a .def file used for printing too, this
simplifies the printing logic as well.
2020-07-08 16:29:31 -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
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
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
Nathan Hawes
1c58abf6a3 Merge pull request #32575 from nathawes/fix-no-quickhelp-for-shorthand-arguments
[SourceKit/CursorInfo] Still print implicit decls in cursorinfo to handle compiler synthesized decls
2020-06-29 11:35:02 -07:00
Rintaro Ishizaki
8307c6a95c [SourceKit] Report 'key.reusingastcontext' in completion like requests
'TypeContextInfo' and 'ConformingMethodList'
2020-06-29 10:21:32 -07:00
swift_jenkins
db2e0c9b44 Merge remote-tracking branch 'origin/master' into master-next 2020-06-28 19:19:23 -07:00
Saleem Abdulrasool
2a200b2089 SourceKit: silence as -Wmisleading-indent warning (NFCI)
Undent the code that was mis-indended leading to a warning with clang.
2020-06-28 15:06:59 -07:00
Rintaro Ishizaki
bbec1ebfbf [SourceKit] Enable ASTContext caching in other completion-like requests
TypeContextInfo and ConformingMethodList

rdar://problem/64782333
2020-06-26 12:50:49 -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
75bea14185 Merge remote-tracking branch 'origin/master' into master-next 2020-06-23 10:39:14 -07:00
Robert Widmann
0da060e95e Merge pull request #32447 from martinboehme/option-set-initializer-list
Give OptionSet an initializer_list constructor
2020-06-23 10:36:57 -07:00
Martin Boehme
d806ba53f6 Give OptionSet an initializer_list constructor.
This makes it easier to specify OptionSet arguments.

Also modify appropriate uses of ModuleDecl::ImportFilter to take
advantage of the new constructor.
2020-06-22 06:57:29 +02: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
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
Bruno Rocha
346771f82a Update tools/SourceKit/lib/SwiftLang/SwiftIndexing.cpp
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>
2020-06-09 08:12:37 +02: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
Karoy Lorentey
1c9b0908e6 Merge remote-tracking branch 'origin/master-next'
# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
2020-06-08 16:43:40 -07:00