Xi Ge
2ba1ca2d8f
IDE: simplify some code. NFC ( #11935 )
...
* IDE: simplify some code. NFC
* add assert.
2017-09-14 18:19:48 -07:00
Slava Pestov
cc28c543fa
IDE: Don't look at inheritance clause in SynthesizedExtensionAnalyzer
2017-09-14 01:14:25 -07:00
Xi Ge
5626c72718
Refactoring tool: Avoid re-tokenizing when collecting the available refactorings in a given source range. NFC ( #11857 )
2017-09-11 15:45:26 -07:00
Xi Ge
0437214b40
Refactoring: avoid re-tokenizing during syntactic renames. NFC
2017-09-11 10:25:44 -07:00
Davide Italiano
3b800aa11f
[gardening] Remove unused lambda capture(s). NFCI.
2017-09-10 21:44:38 -07:00
Alex Hoppen
1c7e289b96
[Mangling] Adjust subscript mangling to not include "subscript"
...
Change the mangling of accessors to have a variable or subscript node
as their only child node, while subscript nodes no longer contain a decl
name.
2017-09-10 19:44:07 +02:00
Alex Hoppen
588fa4a4ee
[TypeReconstruction] Retrieve subscript setter decl for setter node
2017-09-10 19:42:22 +02:00
Alex Hoppen
ebca84aedd
[IDE] Change lookup in TypeReconstruction to be by DeclBaseName
2017-09-10 19:42:22 +02:00
Xi Ge
6970b692e1
SyntaxModel: remove more unnecessary code. NFC
2017-09-08 13:23:48 -07:00
Xi Ge
0cfa094e75
SyntaxModel: remove unnecessary code. NFC ( #11820 )
2017-09-08 13:13:01 -07:00
Xi Ge
560b08c171
SyntaxModel: simplify the collecting of contextual keywords in PrecedenceGroup.NFC ( #11819 )
2017-09-08 12:38:44 -07:00
Xi Ge
34e2aec662
Parser: use parser to generate a refined token stream to help syntax coloring. ( #11809 )
...
This patch allows Parser to generate a refined token stream to satisfy tooling's need. For syntax coloring, token stream from lexer is insufficient because (1) we have contextual keywords like get and set; (2) we may allow keywords to be used as argument labels and names; and (3) we need to split tokens like "==<". In this patch, these refinements are directly fulfilled through parsing without additional heuristics. The refined token vector is optionally saved in SourceFile instance.
2017-09-08 10:28:19 -07:00
Slava Pestov
9f8760b942
AST: Remove unused 'resolver' parameter from ModuleDecl::lookupConformance()
...
... as well as a bunch of downstream plumbing that is no
longer necessary.
2017-09-07 03:36:17 -07:00
Xi Ge
acfb511357
RangeInfo: Add several defensive null pointer checks. rdar://32047178 ( #11729 )
2017-09-01 13:47:32 -07:00
Greg Parker
0af574a7be
[AST] Rename DefaultArgumentKind::Nil to NilLiteral.
...
This avoids a conflict with #define Nil in objc/objc.h.
2017-08-31 21:55:45 -07:00
Xi Ge
53585a5e70
Refactoring: Implement a refactoring action to simplify long number literal format. SR-5746
...
For instance, converting from "100000" to "100_000", and "1000.0001" to
"1_000.000_1".
2017-08-31 14:25:48 -07:00
Xi Ge
17f749d1f3
Refactoring: Simplify a switch case statement. NFC
2017-08-31 14:25:48 -07:00
Jordan Rose
f8b7db4e76
Excise the terms "blacklist" and "whitelist" from Swift source. ( #11687 )
...
The etymology of these terms isn't about race, but "black" = "blocked"
and "white" = "allowed" isn't really a good look these days. In most
cases we weren't using these terms particularly precisely anyway, so
the rephrasing is actually an improvement.
2017-08-30 09:28:00 -07:00
Xi Ge
7f29b362d6
SourceKitd: Rename SemaToken to ResolvedCursorInfo. NFC ( #11680 )
2017-08-29 15:34:15 -07:00
Marcelo Fabri
5c65887fd0
[SourceKit] Add function argument when optional chaining is used (SR-5717) ( #11542 )
2017-08-29 12:59:43 -07:00
Jordan Rose
449cd98997
Excise "Accessibility" from the compiler (3/3)
...
"Accessibility" has a different meaning for app developers, so we've
already deliberately excised it from our diagnostics in favor of terms
like "access control" and "access level". Do the same in the compiler
now that we aren't constantly pulling things into the release branch.
Rename AccessibilityAttr to AccessControlAttr and
SetterAccessibilityAttr to SetterAccessAttr, then track down the last
few uses of "accessibility" that don't have to do with
NSAccessibility. (I left the SourceKit XPC API alone because that's
supposed to be more stable.)
2017-08-28 13:27:59 -07:00
Jordan Rose
1c651973c3
Excise "Accessibility" from the compiler (2/3)
...
"Accessibility" has a different meaning for app developers, so we've
already deliberately excised it from our diagnostics in favor of terms
like "access control" and "access level". Do the same in the compiler
now that we aren't constantly pulling things into the release branch.
This commit changes the 'Accessibility' enum to be named 'AccessLevel'.
2017-08-28 11:34:44 -07:00
Jordan Rose
5f30eac288
Excise "Accessibility" from the compiler (1/3)
...
"Accessibility" has a different meaning for app developers, so we've
already deliberately excised it from our diagnostics in favor of terms
like "access control" and "access level". Do the same in the compiler
now that we aren't constantly pulling things into the release branch.
This commit changes the names of methods, fields, a few local
variables, and even a swift-ide-test flag. The full list is below.
accessibilityForDiagnostics -> accessLevelForDiagnostics
checkAccessibility -> checkAccess
checkGenericParamAccessibility -> checkGenericParamAccess
checkTypeAccessibility -> checkTypeAccess
checkWitnessAccessibility -> checkWitnessAccessibility
computeAccessibility -> computeAccessLevel
computeDefaultAccessibility -> computeDefaultAccessLevel
fixItAccessibility -> fixItAccess
getAccessibilityString -> getAccessLevelString
getAccessibilityStrictly -> getAccessLevelStrictly
getAccessibilityUID -> getAccessLevelUID
getActualAccessibility -> getActualAccessLevel
getDefaultAccessibility -> getDefaultAccessLevel
getMaxAccessibility -> getMaxAccessLevel
getOverridableAccessibility -> getOverridableAccessLevel
getRawStableAccessibility -> getRawStableAccessLevel
getSetterAccessibility -> getSetterFormalAccess
hasAccessibility -> hasAccess
hasDefaultAccessibility -> hasDefaultAccessLevel
inferAccessibility -> inferAccessLevel
inferDefaultAccessibility -> inferDefaultAccessLevel
inferSetterAccessibility -> inferSetterAccessLevel
overwriteAccessibility -> overwriteAccess
overwriteSetterAccessibility -> overwriteSetterAccess
printAccessibility -> printAccess
requiredAccessibilityForDiagnostics -> requiredAccessForDiagnostics
resolveAccessibility -> resolveAccessControl
setAccessibility -> setAccess
setSetterAccessibility -> setSetterAccess
setDefaultAndMaxAccessibility -> setDefaultAndMaxAccess
validateAccessibility -> validateAccessControl
Accessibility -> AccessLevel
AccessibilityFilter -> AccessFilter
IgnoreAccessibility -> IgnoreAccessControl
NL_IgnoreAccessibility -> NL_IgnoreAccessControl
PrintAccessibility -> PrintAccess
PrintInternalAccessibilityKeyword -> PrintInternalAccessKeyword
SetterAccessibility -> SetterAccessLevel
setterAccessibility -> setterAccess
storedPropertyAccessibility -> storedPropertyAccess
-print-accessibility -> -print-access
2017-08-28 11:11:57 -07:00
swift-ci
c64e7f7dd9
Merge pull request #11489 from marcelofabri/associatedtype-structure
2017-08-25 11:40:10 -07:00
Argyrios Kyrtzidis
60a91bb736
[refactoring] Upstreaming the implementation for Swift local refactoring ( #11568 )
...
[refactoring] Upstreaming the implementation for Swift local refactoring
2017-08-22 16:50:16 -07:00
Marcelo Fabri
8b9b49fdf3
[SourceKit] Add associatedtype to doc structure (SR-5700)
2017-08-16 23:40:36 +02:00
Marcelo Fabri
c639147f02
[SourceKit] Include function return type in function kinds structure (SR-5613)
2017-08-14 20:53:00 +02:00
swift-ci
98f9510e39
Merge pull request #11438 from nkcsgexi/color-keyword
2017-08-11 14:43:19 -07:00
Xi Ge
6123cb19e8
SyntaxColoring: Highlight keywords immediately after periods as identifiers. rdar://33805178
2017-08-11 14:14:15 -07:00
Marcelo Fabri
40b054b642
[SourceKit] Add local variables to structure (SR-5057) ( #11431 )
2017-08-11 13:43:05 -07:00
Rintaro Ishizaki
eb6914ccfc
Merge pull request #11346 from rintaro/rip-cfor
...
Eliminate C-style ForStmt
2017-08-08 07:49:42 -07:00
Xi Ge
6573a5fe41
SourceKit: Report the signature length for subscript declarations. SR-5626 ( #11376 )
2017-08-07 14:11:52 -07:00
Xi Ge
b17ccf1ae7
Formatting: when aligning siblings in indentation, we should respect use tab setting. rdar://32611247 ( #11334 )
...
We use white spaces for the remaining that cannot be filled with tabs.
2017-08-04 12:14:23 -07:00
Rintaro Ishizaki
b754b9e9b6
[IDE] Remove support for C-style ForStmt
2017-08-04 23:27:22 +09:00
Rintaro Ishizaki
546aeb2336
[Parse] Remove Parser support for C-style for statement.
2017-08-04 23:27:15 +09:00
Rintaro Ishizaki
07957070cd
[CodeComplete] Remove C-style-for specific facilities
2017-08-04 23:25:26 +09:00
Nathan Hawes
df91a46729
Filter out 0-length tokens when generating syntax model nodes.
...
Resolves rdar://problem/33601932.
2017-08-03 13:09:18 -07:00
Ben Langmuir
3279cf5ced
[code-completion] Add Bool type context for if/guard/while conditions
...
When completing in an if/while/guard statement condition that expects a
boolean, add the code-completion type relation for Bool. We already had
this for repeat-while.
rdar://problem/26509084
2017-08-02 14:24:07 -07:00
Marcelo Fabri
d16cce3a94
[SourceKit] Add documentation range in structure (SR-2487) ( #11264 )
2017-08-02 13:39:49 -07:00
Marcelo Fabri
c4dad0c321
[SourceKit] Add subscript to doc structure (SR-5035)
2017-08-01 00:00:20 +02:00
Ben Langmuir
534c0cc2cb
[code-completion] Generic where clauses
...
Complete generic parameters and their members inside generic where
clauses on structs, classes, enums, extensions, typealiases, funcs,
subscripts and inits.
Still not handled correctly are associatedtypes.
rdar://problem/20582394
2017-07-31 09:57:00 -07:00
Kosuke Ogawa
2a18723b55
[gardening] Fix typos ( #11245 )
...
* [Gardening] Fix typo: getTopLeveDecls -> getTopLevelDecls
* [Gardening] Fix typo: silModue -> silModule
* [Gardening] Fix typo: Evaludate -> Evaluate
* [Gardening] Fix typo: OptioanlPayload -> OptionalPayload
* [Gardening] Fix typo: confromance -> conformance
* [Gardening] Fix typos
* [Gardening] Fix typo: tpye -> type
* [Gardening] Fix typo: resoved -> resolved
* [Gardening] Fix typo: ahve -> have
* Revert "[Gardening] Fix typo: silModue -> silModule"
This reverts commit ed8c4d0b71 .
2017-07-28 10:14:21 -07:00
John Fairhurst
1f94eca80c
[SourceKit] Add typealias to doc structure ( #11143 )
...
From https://bugs.swift.org/browse/SR-4828
2017-07-26 09:59:06 -07:00
Harlan
a5098e6b69
Generate libSyntax API ( #10926 )
...
* Generate libSyntax API
This patch removes the hand-rolled libSyntax API and replaces it with an
API that's entirely automatically generated. This means the API is
guaranteed to be internally stylistically and functionally consistent.
2017-07-25 18:19:58 -07:00
Slava Pestov
c429ae2b9f
IDE: Fix a crash with AnyObject constraints
2017-07-24 22:38:33 -07:00
Xi Ge
a6b25eac8d
RangeInfo: Remove unused fields in resolver. NFC ( #11137 )
2017-07-24 11:31:54 -07:00
Robert Widmann
b77f2c147c
Parse Shared
...
Add parser support for __shared and __owned as type attributes. Also, extend parser diagnostics and tests to account for the new type attributes.
2017-07-23 21:47:25 -07:00
Xi Ge
7595ed353e
[RangeInfo] Address Argyrios' code review comments. NFC ( #11114 )
2017-07-21 18:10:52 -07:00
Xi Ge
ac348b597a
[RangeInfo] Using the underlying token array reference to represent the content of a range under selection. ( #11106 )
...
Comparing to CharSourceRange, token stream is a better way because we can preserve comment information at the start of the range.
Needed for rdar://33437855
2017-07-21 16:19:25 -07:00
Ben Langmuir
93d22c9ff0
[code-completion] Add a new custom completion context for a for-each sequence
...
For normal completions it behaves the same as PostfixExprBeginning, but
it provides a hook for clients to provide a custom completion for this
position. For example, you might want to a x ..< y snippet in this
position.
rdar://problem/29910383
2017-07-19 13:29:36 -07:00