Hi,
@safesparrow and I encountered a bug with the autocompletion of a new record instance:
type Entry =
{
Idx: int
FileName: string
/// Own deps
DependencyCount: int
/// Being depended on
DependentCount: int
LineCount: int
}
let x =
{
Entry.{caret}
}
IComputationExpr
FSharpTokenType+LbraceTokenElement(type:LBRACE, text:{)
NewLine(type:NEW_LINE, text:\n) spaces:"\n"
Whitespace(type:WHITE_SPACE, text: ) spaces:" "
IFromErrorExpr
IReferenceExpr
FSharpIdentifierToken(type:IDENTIFIER, text:Entry)
FSharpTokenType+DotTokenElement(type:DOT, text:.)
NewLine(type:NEW_LINE, text:\n) spaces:"\n"
Whitespace(type:WHITE_SPACE, text: ) spaces:" "
FSharpTokenType+RbraceTokenElement(type:RBRACE, text:})
|
let getRecordEntity (context: FSharpCodeCompletionContext) = |
|
let getRecordFromExprType (expr: IFSharpExpression) = |
|
if isNull expr then None else |
|
|
|
let expr = expr.TryGetOriginalRecordExprThroughSandBox() |
|
if isNull expr then None else |
|
|
|
let fcsType = expr.TryGetFcsType() |
|
if isNull fcsType || not fcsType.HasTypeDefinition then None else |
|
|
|
let fcsEntity = fcsType.TypeDefinition |
|
if not fcsEntity.IsFSharpRecord then None else |
|
|
|
Some(fcsEntity, expr) |
is not finding the fcsType for the IComputationExpr:

We believe this used to work in 2022.1.2. It no longer works for us in 2023.1.3 and 2023.2 EAP 5.
checkResults.GetTypeOfExpression(range) no longer seems to work as expected it seems.
Does this ring a bell? Anything we can do to help?
Hi,
@safesparrow and I encountered a bug with the autocompletion of a new record instance:
resharper-fsharp/ReSharper.FSharp/src/FSharp.Psi.Features/src/CodeCompletion/Rules/RecordFieldRule.fs
Lines 51 to 64 in caf2860
is not finding the fcsType for the
IComputationExpr:We believe this used to work in
2022.1.2. It no longer works for us in2023.1.3and2023.2 EAP 5.checkResults.GetTypeOfExpression(range)no longer seems to work as expected it seems.Does this ring a bell? Anything we can do to help?