Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FSharpChecker.ParseFileNoCache #7108

Merged
merged 2 commits into from Jul 4, 2019
Merged

Conversation

auduchinok
Copy link
Member

Adds API to get parse results when we don't want it to be cached or use previous results.

@auduchinok
Copy link
Member Author

Ah, the service.fs split. I need to rebase.

Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change

@@ -113,6 +113,9 @@ type public FSharpChecker =
/// <param name="userOpName">An optional string used for tracing compiler operations associated with this request.</param>
member ParseFile: filename: string * sourceText: ISourceText * options: FSharpParsingOptions * ?userOpName: string -> Async<FSharpParseFileResults>

/// Parse a source code file, returning a handle that can be used for obtaining navigation bar information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, I see that this summary is similar to the other summary. Would you mind updating both? Something like this:

Parse a source code file, returning a type that represents a parsed document whose contents can be traversed for various features.

Additionally, a <param> comment is needed for each parameter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I like your summary suggestion.
I'd personally remove param comments for both overloads due to quite self-describing parameter names if it was OK.

Copy link
Member

@TIHan TIHan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation is fine. I think the API is alright too.

One thing I worry about is having multiple APIs with "NoCache" now. What if we want to check a file but not cache its results, do we add another API like a "CheckFileInProjectNoCache" ? I guess that seems fine because the method has clear intent.

@auduchinok
Copy link
Member Author

auduchinok commented Jul 3, 2019

@TIHan I'd expect it to be added if it was needed by someone. At least we're adding it when found we need it for parsing. :)

@cartermp cartermp merged commit 8c33139 into dotnet:master Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants