Skip to content

Commit 72e28fe

Browse files
Krzysztof-CieslakKevinRansom
authored andcommitted
Add IsRelativeNameResolvableFromSymbol (#3722)
* Add `IsRelativeNameResolvableFromSymbol` * fix compilation
1 parent 4029f19 commit 72e28fe

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/fsharp/vs/service.fs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,10 @@ type TypeCheckInfo
897897
(fun msg ->
898898
Trace.TraceInformation(sprintf "FCS: recovering from error in IsRelativeNameResolvable: '%s'" msg)
899899
false)
900+
901+
/// Determines if a long ident is resolvable at a specific point.
902+
member scope.IsRelativeNameResolvableFromSymbol(cursorPos: pos, plid: string list, symbol: FSharpSymbol) : bool =
903+
scope.IsRelativeNameResolvable(cursorPos, plid, symbol.Item)
900904

901905
/// Get the auto-complete items at a location
902906
member __.GetDeclarations (ctok, parseResultsOpt, line, lineStr, partialName, getAllSymbols, hasTextChangedSinceLastTypecheck) =
@@ -2009,6 +2013,12 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp
20092013
reactorOp userOpName "IsRelativeNameResolvable" true (fun ctok scope ->
20102014
RequireCompilationThread ctok
20112015
scope.IsRelativeNameResolvable(pos, plid, item))
2016+
2017+
member info.IsRelativeNameResolvableFromSymbol(pos: pos, plid: string list, symbol: FSharpSymbol, ?userOpName: string) =
2018+
let userOpName = defaultArg userOpName "Unknown"
2019+
reactorOp userOpName "IsRelativeNameResolvableFromSymbol" true (fun ctok scope ->
2020+
RequireCompilationThread ctok
2021+
scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol))
20122022

20132023
member info.ImplementationFiles =
20142024
if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies"

src/fsharp/vs/service.fsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ type internal FSharpCheckFileResults =
266266
/// <param name="userOpName">An optional string used for tracing compiler operations associated with this request.</param>
267267
member internal IsRelativeNameResolvable: cursorPos : pos * plid : string list * item: Item * ?userOpName: string -> Async<bool>
268268

269+
/// Determines if a long ident is resolvable at a specific point.
270+
/// <param name="userOpName">An optional string used for tracing compiler operations associated with this request.</param>
271+
member IsRelativeNameResolvableFromSymbol: cursorPos : pos * plid : string list * symbol: FSharpSymbol * ?userOpName: string -> Async<bool>
272+
269273
/// Represents complete typechecked implementation files, including thier typechecked signatures if any.
270274
member ImplementationFiles: FSharpImplementationFileContents list option
271275

0 commit comments

Comments
 (0)