Commit Graph

2340 Commits

Author SHA1 Message Date
Dmitri Gribenko
6160b4ef4d Merge pull request #766 from practicalswift/a-few-more-typos
Fix typos
2015-12-24 13:18:33 -08:00
Brian Gesiak
a45a4260d8 [python] Use PEP-0008 compliant code headers
Running the Python style guide checker
[`pep8`](https://pypi.python.org/pypi/pep8) on the Python code headers
in this repository results in the following error being emitted:

    $ pep8 utils/build-script
    utils/build-script:1:1: E265 block comment should start with '# '
    utils/build-script:3:1: E266 too many leading '#' for block comment
    utils/build-script:5:1: E266 too many leading '#' for block comment
    utils/build-script:6:1: E266 too many leading '#' for block comment
    utils/build-script:8:1: E266 too many leading '#' for block comment
    utils/build-script:9:1: E266 too many leading '#' for block comment
    utils/build-script:11:1: E265 block comment should start with '# '
    utils/build-script:11:80: E501 line too long (80 > 79 characters)

The problem is that the code header used in most Python files in the
repository:

1. Do not place a space in between `#` and the rest of the comment.
2. Contains some lines that just barely exceed the recommend length
   limit.

In addition, not all code headers in the repository follow the same
template.

This commit moves all Python code headers to the following template:

    # subfolder/file_name.py - Very brief description -*- python -*--
    #
    # This source file is part of the Swift.org open source project
    #
    # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
    # Licensed under Apache License v2.0 with Runtime Library Exception
    #
    # See http://swift.org/LICENSE.txt for license information
    # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
    #
    # -----------------------------------------------------------------------------
    #
    # This file contains stuff that I am describing here in the header and will
    # be sure to keep up to date.
    #
    # ----------------------------------------------------------------------------
2015-12-24 11:35:53 -05:00
practicalswift
4ff12be924 Fix typos. 2015-12-24 14:26:57 +01:00
practicalswift
a8cabe6cbf Use explicit imports. 2015-12-24 00:19:30 +01:00
Dmitri Gribenko
5b171b6de7 Merge pull request #733 from practicalswift/additional-python-fixes
Various Python cleanups
2015-12-23 11:05:35 -08:00
practicalswift
6e3b700b44 Fix typos. 2015-12-23 00:31:13 +01:00
practicalswift
4f2496e1a6 Various Python cleanups
Fixes:
* Unused import
* Redundant backslash
* Use of discouraged if not x in y
* Use of deprecated form of raising exceptions

Follow-up to PR #655 as requested by @gribozavr
2015-12-22 21:05:47 +01:00
practicalswift
36d7072013 Remove immediately adjacent repeated words ("the the", "for for", "an an", etc.). 2015-12-21 22:16:04 +01:00
practicalswift
cd7d8dfaff Fix alignment as requested by @gribozavr in #692 2015-12-21 08:54:24 +01:00
practicalswift
176f487d76 Fix incorrect filenames in headers. 2015-12-20 23:59:05 +01:00
GauravDS
3315f592e8 Fix typos copnsumers => consumers 2015-12-12 23:57:12 +05:30
Andrew Trick
739b0e9c56 Reorganize SILOptimizer directories for better discoverability.
(libraries now)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
2015-12-11 15:14:23 -08:00
Andrew Trick
84450b4c43 Reorganize SILOptimizer directories for better discoverability.
(Headers first)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
2015-12-11 12:34:51 -08:00
Xi Ge
cf11ca48b9 [SourceKit] Sanitize -embed-bitcode flag to avoid crashing. rdar://22874139 2015-12-09 15:05:21 -08:00
Tysun M
faddc283be Two typo corrections for SwiftEditor.cpp
Lines 1132 and 2666. Thank you.
2015-12-09 14:25:30 -08:00
Xi Ge
ab969d14a4 [SourceKit][PlaceholderExpand] Avoid function signatures when expanding trailing closures of ()->(). rdar://21879249 2015-12-07 11:48:53 -08:00
Mohammad Ghasembeigi
ee2ceca8d1 Remove unnecessary 'visitDecl' default cases.
The default cases are unnecessary and provide no benefits so they should
just be removed.
2015-12-06 03:08:08 +11:00
moi
f45190056f Reformat README 2015-12-04 16:48:57 +08:00
Martin Kiss
b2ed2af54a Fix spelling 2015-12-03 20:55:43 +01:00
Dmitri Gribenko
4324e7c903 Remove conditional compilation of tvOS 2015-12-01 14:43:45 -07:00
Argyrios Kyrtzidis
8c6c9a27c1 [sourcekitd] Be tolerant of multiple calls to sourcekitd_initialize. 2015-11-30 10:46:52 -08:00
Xi Ge
9beeb56a90 [TypeInterface] When printing type-specific interfaces, replace parameter and return types with instantiated types. 2015-11-17 19:12:30 -08:00
Argyrios Kyrtzidis
6bcd425047 [sourcekit] Introduce sourcekitd_set_uid_handlers, to fully control how uid's are mapped to strings and vice-versa. 2015-11-16 13:26:58 -08:00
Argyrios Kyrtzidis
df060ff827 [sourcekit] Fix a comment. 2015-11-16 13:26:58 -08:00
Argyrios Kyrtzidis
e8b1a10b5c [sourcekit] Fix sourcekitd::UIdentFromSKDUID on the service side, that is used for logging purposes. 2015-11-16 13:26:58 -08:00
Argyrios Kyrtzidis
d06b55a622 [CMake/build] Instead of just picking up the libclang dylib, invoke install-libclang target on the llvm build. 2015-11-11 21:35:01 -08:00
Xi Ge
4b847abf92 [SourceKit][CodeFormat] Align the comments before a case statement with the statement. rdar://20985149 2015-11-11 11:40:49 -08:00
Ben Langmuir
7b0784958f [CodeCompletion] Penalize fuzzy matches that aren't on token boundaries even more
rdar://problem/22419553
2015-11-06 20:01:53 -08:00
Ben Langmuir
11444373a5 [CodeCompletion] Don't fuzzy-match on single characters
Use prefix matching on the first character, switch to fuzzy after 2 or
more. With only a single character, we often get silly fuzzy results.
2015-11-06 19:26:48 -08: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
Jordan Rose
6a0527ec14 [SourceKit/CMake] Fix output directory for building with Xcode. 2015-11-06 16:27:08 -08:00
Xi Ge
6d19519e14 [SourceKit][CodeFormat] Adjust the indentation for getter methods that have no explicit "getter" keyword.
rdar://21598808
2015-11-06 11:34:18 -08:00
Argyrios Kyrtzidis
f0f83d32c2 Fix -Wunused-function warnings. 2015-11-05 19:04:10 -08:00
Argyrios Kyrtzidis
a11b5628e3 [SourceKit] Use the correct macro, 'SWIFT_ENABLE_TARGET_TVOS'. 2015-11-05 18:34:42 -08:00
Argyrios Kyrtzidis
26fca3a347 [SourceKit/CMake] Use 'tools' install component for the SourceKit tools. 2015-11-05 18:24:19 -08:00
Xi Ge
c022c9925c [CodeComplete] Start to support keyword-based code completion. rdar://23101032
Conventionally, code completion results are matched with user input solely by
names. However, names are limited in expressiveness. From this comments, we start to
decorate code completion results with @keywords fields extracted from Clang doc comments.
These fields are added by API authors to comment the decl with information that
is not manifested clear enough through names. Code completion users' typing of the
keyword leads to the corresponding code completion results being selected as well.
Keywords can be arbitrarily long and can be multiple.

For instance, a function called "index()" has "@keyword find" in its doc comment.
Users' typing of "find" leads to "index()" being selected in the code completion list.
2015-11-05 15:36:55 -08:00
Ben Langmuir
07e7be5d99 [sourcekit] Fix swift library dependencies
Now that we're in the same repo, use cmake targets instead of paths so
we get correct dependencies.
2015-11-05 12:47:38 -08:00
Argyrios Kyrtzidis
d19e4ae026 [SourceKit] Add license notices to all the source files. 2015-11-05 12:01:14 -08:00
Argyrios Kyrtzidis
8f0bc8c95f [CMake] Fix building SourceKit for a standalone build. 2015-11-05 11:02:47 -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