File tree 1 file changed +8
-1
lines changed
presentation-compiler/src/main/dotty/tools/pc/completions
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,14 @@ class Completions(
231
231
label : String ,
232
232
toCompletionValue : (String , SingleDenotation , CompletionSuffix ) => CompletionValue
233
233
): List [CompletionValue ] =
234
- val sym = denot.symbol
234
+ // Workaround for LTS due to lack of https://github.com/scala/scala3/pull/18874 backport
235
+ // required after backport of https://github.com/scala/scala3/pull/18914
236
+ // We use the symbol of accessor result type to make the sym compliant with the 3.4+
237
+ // where we would obtain the field symbol directly
238
+ val sym =
239
+ val resultTpeSym = denot.info.finalResultType.typeSymbol
240
+ if denot.symbol.is(Accessor ) && resultTpeSym != NoSymbol then resultTpeSym
241
+ else denot.symbol
235
242
// find the apply completion that would need a snippet
236
243
// <accessor> handling is LTS specific: It's a workaround to mittigate lack of https://github.com/scala/scala3/pull/18874 backport
237
244
// which was required in backport of https://github.com/scala/scala3/pull/18914 to achive the improved completions semantics.
You can’t perform that action at this time.
0 commit comments