Commit Graph

25 Commits

Author SHA1 Message Date
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Ben Langmuir
f72bd5453f [CodeCompletion] Fix a crash when completing typealiases for protocol conformance
The index may be at the end of the ArrayRef of chunks if the completion
ends with a simple parameter with no type annotation.  Check that the
index is in-bounds before adding text.

rdar://problem/26273906
2016-06-21 16:56:29 -07:00
Ben Langmuir
3c9c52010b [CodeCompletion] Add image and color literals to results
Surface these results in the codecomplete code path (they're already
there in the codecomplete.open code path) so we can use them from IDEs.
For now, just use ad-hoc filtering to show them when the type matches
(or there is no expected type).  Ideally we would make this filtering
configurable like we do in the codecomplete.open code path.

rdar://problem/25836544
2016-06-21 11:41:15 -07:00
Ben Langmuir
122350d450 [CodeCompletion] Apply filter rules directly to inner results
... and don't try to filter the extended results.  Once the results are
extended with the common prefix they will not match identifier filter
rules, which will create differences between completions depending on
whether they had a filter text or were a postfix expression.  Also,
allow filtering by name directly on the inner operator name for inner
operators.

rdar://problem/26312235
2016-05-25 12:07:17 -07:00
Ben Langmuir
c77af6907e [CodeCompletion] Switch filter-rules and popular api to follow SE-0021 naming
We want inputs for function names to follow SE-0021 with the exception
that a function with no arguments is spelled `foo()` instead of `foo`,
because we have no type to disambiguate with and it's not ambiguous with
a call in this context.

Internally, we use a filter name without underscores because we don't
want to introduce spurious matches to the `_` character which might be
part of identifiers.

For now, continue to accept the old names to ease the transition.

rdar://problem/24350800
2016-05-10 11:13:46 -07:00
Ben Langmuir
69967ca45c [CodeCompletion] Identify known operators and force a fixed sort order
In the new code-completion code path, force any known operators to go
through a fixed sort order. To identify operators unambiguously, add a
new BuiltinOperator code-completion kind to handle non-decl operators
(!, ., ?., and =).

rdar://problem/25994246
rdar://problem/23440367
2016-05-03 10:23:13 -07:00
Ben Langmuir
44d422e294 [SourceKit] Only call sortCompletionResults where it's needed
This sort is only for codeComplete, not for codeCompleteOpen, but we
were doing it indiscrimiately leading to ~15% performance penalty in the
latter code path.

rdar://problem/25887631
2016-04-25 08:29:36 -07:00
Xi Ge
c452f9640f [CodeCompletion] Add a field NotRecommendedReason to code completion result to indicate why an item is not recommended, NFC. rdar://25415947
As implied in rdar://24818863, striking through a module name may be an overkill to suggest the module is redundant to import. We try to
fine-grain not-recommended-reason so that proper UI cue can be adopted in the future.
2016-03-30 16:23:33 -07:00
Ben Langmuir
88c1065133 [CodeCompletion] Expose the existing option for whether to include exact matches
So we can play with it more easily.
2016-03-16 14:21:53 -07:00
Ben Langmuir
8f9299cc97 [CodeCompletion] Add assignment to experimental operator completion
When the LHS is an lvalue/assignable tuple and there is no leading
sequence of binary expressions.

It's a bit hacky right now since we don't have a good way to
differentiate general pattern completions from builtin operators.

rdar://problem/23209683
2016-03-02 18:21:37 -08:00
Ben Langmuir
ba2710e493 [CodeCompletion] Fix the mysteriously missing operators
In the experimental operator completion, we were mysteriously missing
some operators like ||.  It turns out it was all operators
alphabetically after '.', because the filtering code was very broken.

rdar://problem/23539465
2016-03-01 18:23:00 -08:00
Ben Langmuir
5da0906089 [CodeCompletion] Add optional top-N results that precede literals
Experiment with having some locals or nominal members come first, but
only a few so that the literals are still predictably near the top.

Part of rdar://problem/23865118
2016-02-03 16:31:26 -08:00
Ben Langmuir
a927dc8a5a [CodeCompletion] Hide literals that don't match the type context in SourceKit
If there is a type context, hide literal suggesetions that don't match
it, unless they are keywords and we have filtered to their names.

Incidentally fix an output buffering issue when combining filtering with
the -raw flag in complete-test.

Part of rdar://problem/23865118
2016-02-03 10:51:07 -08:00
Ben Langmuir
9ae6846ac7 [CodeCompletion] Remove more vestiges of 0.0 literal suggestion
Obviously dead code.
2016-02-03 08:29:20 -08:00
Ben Langmuir
e75402e49e [CodeCompletion] Add image literal similar to color
Part of rdar://problem/23865118
2016-02-03 07:55:07 -08:00
Ben Langmuir
d16e4b0467 [CodeCompletion] Add rudimentary support for configuring allowable completions
On a per-request basis. Allows hiding/showing at multiple granularities
* everything
* module
* API by name
* keywords (by uid or all of them)
* literals (by uid or all of them)

With more specific rules overriding less specific ones (so you can hide
everything and then selectively show certain API for example).

rdar://24170060
2016-01-25 08:45:48 -08:00
practicalswift
dfcece7960 Use consistent style for comment separators. 2016-01-04 01:41:33 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Mayur Raiturkar
e917f8537a Typo fixes 2015-12-28 16:45:40 +05:30
practicalswift
d89b4d45e1 Fix typos in code (non-comment typos). 2015-12-27 13:05:01 +01:00
Ben Langmuir
ef8338fe86 [CodeCompletion] Don't add inner results on non-declarations
We were getting some ridiculous completions that were just two
independentdcompletions concatenated together.

rdar://problem/22945376
2015-11-06 19:02:22 -08:00
Argyrios Kyrtzidis
f0f83d32c2 Fix -Wunused-function warnings. 2015-11-05 19:04:10 -08:00
Argyrios Kyrtzidis
d19e4ae026 [SourceKit] Add license notices to all the source files. 2015-11-05 12:01:14 -08:00
Argyrios Kyrtzidis
8ff6a98a99 [sourcekit] Merge SourceKit into the Swift repo.
The code goes into its own sub-tree under 'tools' but tests go under 'test',
so that running 'check-swift' will also run all the SourceKit tests.

SourceKit is disabled on non-darwin platforms.
2015-11-05 01:09:08 -08:00