Commit a91cede
Nathan Hawes
[Parse][CodeCompletion] Don't special case code completion when forming single-expression closures/function bodies (NFC)
Code completion used to avoid forming single expression closures/function
bodies when the single expression contained the code completion expression
because a contextual type mismatch could result in types not being applied
to the AST, giving no completions.
Completions that have been migrated to the new solver-based completion
mechanism don't need this behavior, however. Rather than trying to guess
whether the type of completion we're going to end up performing is one of
the ones that haven't been migrated to the solver yet when parsing, instead
just always form single-expression closures/function bodies (like we do for
regular compilation) and undo the transformation if and when we know we're
going to perform a completion kind we haven't migrated yet.
Once all completion kinds are migrated, the undo-ing code can be removed.1 parent a665ba6 commit a91cede
File tree
5 files changed
+41
-71
lines changed- include/swift/Parse
- lib
- IDE
- Parse
5 files changed
+41
-71
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | 712 | | |
722 | 713 | | |
723 | 714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1672 | 1672 | | |
1673 | 1673 | | |
1674 | 1674 | | |
1675 | | - | |
| 1675 | + | |
1676 | 1676 | | |
1677 | 1677 | | |
1678 | 1678 | | |
| |||
6054 | 6054 | | |
6055 | 6055 | | |
6056 | 6056 | | |
6057 | | - | |
6058 | | - | |
6059 | | - | |
6060 | | - | |
6061 | | - | |
6062 | | - | |
6063 | | - | |
6064 | | - | |
6065 | | - | |
6066 | | - | |
6067 | | - | |
6068 | | - | |
6069 | | - | |
6070 | | - | |
6071 | | - | |
6072 | | - | |
6073 | | - | |
6074 | | - | |
6075 | | - | |
| 6057 | + | |
6076 | 6058 | | |
6077 | 6059 | | |
6078 | 6060 | | |
| |||
6111 | 6093 | | |
6112 | 6094 | | |
6113 | 6095 | | |
| 6096 | + | |
| 6097 | + | |
| 6098 | + | |
| 6099 | + | |
| 6100 | + | |
| 6101 | + | |
| 6102 | + | |
| 6103 | + | |
| 6104 | + | |
| 6105 | + | |
| 6106 | + | |
| 6107 | + | |
| 6108 | + | |
| 6109 | + | |
| 6110 | + | |
| 6111 | + | |
| 6112 | + | |
| 6113 | + | |
| 6114 | + | |
| 6115 | + | |
| 6116 | + | |
| 6117 | + | |
| 6118 | + | |
| 6119 | + | |
| 6120 | + | |
| 6121 | + | |
| 6122 | + | |
| 6123 | + | |
| 6124 | + | |
| 6125 | + | |
| 6126 | + | |
| 6127 | + | |
| 6128 | + | |
6114 | 6129 | | |
6115 | 6130 | | |
6116 | 6131 | | |
6117 | | - | |
6118 | | - | |
6119 | | - | |
6120 | 6132 | | |
6121 | 6133 | | |
6122 | 6134 | | |
| |||
6134 | 6146 | | |
6135 | 6147 | | |
6136 | 6148 | | |
| 6149 | + | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
6137 | 6153 | | |
6138 | 6154 | | |
6139 | 6155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6588 | 6588 | | |
6589 | 6589 | | |
6590 | 6590 | | |
6591 | | - | |
6592 | | - | |
6593 | | - | |
6594 | | - | |
6595 | | - | |
| 6591 | + | |
6596 | 6592 | | |
6597 | 6593 | | |
6598 | 6594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2841 | 2841 | | |
2842 | 2842 | | |
2843 | 2843 | | |
2844 | | - | |
2845 | | - | |
2846 | | - | |
2847 | | - | |
2848 | 2844 | | |
2849 | | - | |
2850 | | - | |
| 2845 | + | |
2851 | 2846 | | |
2852 | 2847 | | |
2853 | 2848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | 1188 | | |
1217 | 1189 | | |
1218 | 1190 | | |
| |||
0 commit comments