Commit Graph

365 Commits

Author SHA1 Message Date
Xi Ge
1aa7816956 swift-api-digester: teach the tool to serialize and de-serialize generic requirements.
The tool should diagnose the change of extension's applicability since
such change can be source-breaking. We need first to support the
requirements in the module dump. Currently, we decorate each
member defined in extension with a field called extension info. The
field will keep track of the generic requirements that need to be satisfied
for this decorated member to be applicable. This patch doesn't implement the checking
of requirements change.
2018-02-23 15:30:57 -08:00
John Fairhurst
677491fc9b [SourceKit] Add syntaxtype for #error/#warning (#14742) 2018-02-21 14:48:18 -08:00
Slava Pestov
6d1fd6da2c Merge pull request #13881 from slavapestov/type-reconstruction-inout-try-again
Re-apply "TypeReconstruction: Fix reconstruction of InOutType"
2018-01-13 15:45:00 -08:00
Argyrios Kyrtzidis
18dfb2810a [swift-ide-test] Provide option '-code-completion-comments' for swift-ide-test to print documentation comments for the completion results 2018-01-12 16:09:03 -08:00
Slava Pestov
e7feb5a59c TypeReconstruction: Remove unused entry point 2018-01-11 15:53:45 -07:00
Marcelo Fabri
94465a38c0 [SourceKit] Add GenericTypeParam to structure (SR-5474) (#13616) 2018-01-09 17:28:52 -08:00
Argyrios Kyrtzidis
14116f84a1 [sourcekitd] Fix cursor resolving when pointing inside string interpolations of return statements
rdar://36336648
2018-01-09 11:46:15 -08:00
Marcelo Fabri
b6ecf9c6d4 [SourceKit] Introduce "source.lang.swift.expr.closure" in structure (SR-6116) (#13617) 2018-01-04 10:45:29 -08:00
Roman Roibu
b2d122c4a7 [IDE] Refactoring: Expand a ternary operator into an if statement and vice-versa (#12554) 2017-12-21 12:40:30 -08:00
Nathan Hawes
c326ec46c7 [Refactoring] Fix subscript rename
Adds support for renaming subscripts with external names, e.g.
subscript(x y: Int), and introduces a noncollapsible parameter name range for
subscript parameters, since these shouldn't be collapsed with an argument label
of the same name as function parameter names are.
2017-11-28 19:45:29 -08:00
Slava Pestov
a70a1f0d36 IDE: Fix bug in SourceEntityWalker subscript handling
We weren't passing the lvalue access kind to the subscript.
This was causing a test to fail with the next patch.
2017-11-13 22:19:25 -08:00
Slava Pestov
0715eaeaed AST: Move SourceEntityWalker to IDE 2017-11-13 22:10:41 -08:00
Alex Hoppen
746bfc6d59 [Refactoring] Add refactoring action to move type members to extension (#12795)
This implements SR-6297.
2017-11-09 11:08:34 -08:00
Rintaro Ishizaki
a57199cf68 [refactoring] Implement "Convert to Trailing Closure" refactoring action 2017-10-16 00:42:05 -07:00
Rintaro Ishizaki
53e514518b [IDE] Add SourceFile property to ResolvedCursorInfo 2017-10-16 00:24:30 -07:00
Kacper Harasim
8cd677eb1f [Refactoring] SR-6051 Expansion of switch statement missing cases (#12281) 2017-10-13 09:37:58 -07:00
Kacper Harasim
1bec63d911 [IDE] Remove convenience function added to SourceEditConsumer 2017-09-28 10:21:00 -07:00
Marcelo Fabri
95383df793 [SourceKit] Introduce "source.lang.swift.expr.tuple" (SR-5977) (#12089) 2017-09-27 10:08:27 -07:00
Kacper Harasim
6fcb8308ff [IDE] Refactoring: conversion from “force try” to error handled version (#12063)
* [IDE] Refactoring: conversion from “force try” do error handled version

* Removed unnecessary empty line

* Changed name of the refactor

* Review fixes

* Fixed recognizing try_! location by CursorResolver

* Review fixes
2017-09-24 09:05:32 -04:00
Xi Ge
4e4f5ae6cf IDE: add a utility stream class to SourceEditorConsumer. NFC (#12069) 2017-09-22 16:37:05 -07:00
Kacper Harasim
80698a04b0 [IDE] SR-5745 Refactoring: converting strings concatenation expression to strings interpolation (#11944) 2017-09-19 13:37:42 -07:00
Will T. Ellis
57454eb8c9 SR-5739 Add refactoring action to collapse nested if (#11851) 2017-09-18 16:16:01 -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
7f29b362d6 SourceKitd: Rename SemaToken to ResolvedCursorInfo. NFC (#11680) 2017-08-29 15:34:15 -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
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
Rintaro Ishizaki
b754b9e9b6 [IDE] Remove support for C-style ForStmt 2017-08-04 23:27:22 +09: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
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
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
Ben Langmuir
0258839815 [code-completion] Add leading-dot completion for enums
When using completion options that will allow the lone "." completion,
provide that result when in contexts that expect an enum type.  Note:
this is a crappy approximationg for whether the type can have "implicit
member expression" syntax, since uninhabited enums should not support
it, and many non-enum types should.  However, it is currently expensive
to compute the accurate answer and this approximation is good enough for
some clients.

rdar://problem/31260505
2017-07-19 11:34:01 -07:00
Xi Ge
e1a4bf32dd [SourceKit] When Cursor infor resolves to the start of an expression, we always get the outermost expression. (#10738)
The reason is that for clients, getting the offspring of an expression is
much easier that getting parents.
2017-06-30 17:57:36 -07:00
Xi Ge
87a0cfb910 swift-api-digester: teach the tool to serialize/deserialize super class Usrs. rdar://32778228
This can help us eliminate false positives when we report removed
declarations are actually moved to a newly-introduced super class.
2017-06-21 19:47:07 -07:00
Xi Ge
1ea4d9ff98 CursorInfo: Teach SemaLocResolver to recognize the start of an expression, if the location cannot be further refined to other kind, e.g. a reference. rdar://32749670 2017-06-19 13:28:36 -07:00
David Farler
c2876dfb69 [Migrator] Migrate x.toIntMax() to Int64(x)
These protocol methods were hard-obsoleted in Swift 4.

rdar://problem/32437759
2017-06-14 14:21:51 -07:00
David Farler
970127b745 [Migrator] Add special-case migration for NSOpenGLGetVersion
This was added in the AppKit overlay as a part of general
AppKit API improvements for Swift 4.

rdar://problem/32178777
2017-06-14 14:21:50 -07:00
swift-ci
7c4a91800a Merge pull request #10212 from nkcsgexi/api-digester-explicit-property 2017-06-12 15:48:46 -07:00
Xi Ge
ce17eae939 swift-api-digester: detected getter/setter function to property updates should be explicit about the new property names instead of inferring them from old function name. 2017-06-12 15:10:41 -07:00
Xi Ge
673d04f240 Range-info: when checking if a decl reference is contained in the selected range, consider only the start location. rdar://32415952 (#10207) 2017-06-12 13:52:28 -07:00
Xi Ge
03d4eb9ece IDE: Add IsValid field to decl name viewer. NFC (#10125) 2017-06-05 17:27:14 -07:00
Xi Ge
824aaa11e2 swift-api-digester: detect the move of static members only.
This patch restricts the detection of moved members to be static members,
since only in this case we need to update qualified access to
them. The move of instance members will be either handled by rename or
we don't need to update anything at all.

Additionally, this patch introduces a sub-kind of type member diff item
called qualified replacement to describe the aforementioned case. However,
the migrator part has not started to honor this sub-kind yet.

rdar://32466196
2017-05-31 11:47:27 -07:00
Xi Ge
d1b0e67620 swift-api-digester: teach the tool do detect APINotes' moving one member variable/method to another type. (#9985)
Different from type hoist that moves global variables to static member
variables, we've also seen member variables being moved among different
types via apinotes. Swift-api-digester should be able to detect such
case so that migrator can handle them properly.

rdar://32466196
2017-05-30 14:23:32 -07:00
Nathan Hawes
e5426ecfa5 Revert "[SyntaxColor] Improve highligting of multiline strings"
This reverts commit 86d0fc37bc.
This was causing a performance regression.

Resolves rdar://problem/32434045
2017-05-26 16:46:03 -07:00
Nathan Hawes
19a2399a1c Merge pull request #9853 from nathawes/rdar32148117-multiline-string-highlighting-issues
[SyntaxColor] Improve highligting of multiline strings
2017-05-22 18:55:18 -07:00