Repository navigation
Build the cref resolver only when a doc comment has a cref - #1557
Merged
Merged
Conversation
Hover asks for the cref resolver on every tooltip, and GetCrefResolver built it right away. Building it lists every entity of every assembly the project references, so the first hover in a project paid for that list, also when the doc comment had no cref to resolve. The resolver is now built when the first cref is resolved. On the Fantomas solution with the transparent compiler, the first hover in CodePrinter.fs took 50 ms instead of 1.1 to 1.2 s, and the server grew by 1 MB instead of 47 to 72 MB.
With a project snapshot, FCS parses each file it is asked to search and only looks further when the identifiers of the file contain the name of the symbol, or the name of the attribute without its suffix. But FCS 43.12 imports all references of the project before it parses a file of it. So Find References imported the references of every project that depends on the declaring project, also of projects that have no file with the name. FSAC now looks for these names in the text of the file first, as whole identifiers (`Expr` is not in `Expression`), and does not ask FCS when they are not there. FCS takes its identifiers from the tokens of the file, so every identifier it finds is in the text: this skips no file that FCS would search. Only the transparent compiler path does this. The background compiler searches files without the identifier test, so the same filter could change its results. On the Fantomas solution, Find References on SyntaxOak.Expr found the same 672 references in 9 files. It took 1.5 to 1.6 s instead of 2.7 to 3.3 s, and the server grew by 199 to 227 MB instead of 460 to 502 MB.
The setting has done nothing since the older server implementations were removed (ionide#1174): nothing set the checker property it used to set, and nothing read that property. With the setting on, a referenced F# project now comes from its output DLL, for both compilers. With the transparent compiler, the snapshot gets a PE reference to the DLL. With the background compiler, the options have no referenced projects, so FCS reads the DLL from the command line, as before ionide#1174. The unused checker property is removed. Find References finds the projects that depend on the declaring project through the referenced projects of the snapshots or options. With the setting on, a DLL reference names no project, so it now also follows the project references that MSBuild reports. On the Fantomas solution with the setting on, Find References on SyntaxOak.Expr found the same 672 references in 9 files. A DLL reflects the last build of its project, not changes made since, so the setting stays off by default.
CHANGELOG.md gets the 0.85.1 section, so merging this publishes 0.85.1: the first hover in a file is fast again, Find References skips files that do not contain the name, and DisableInMemoryProjectReferences works again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes that came out of measuring FSAC's memory on the Fantomas solution with the transparent compiler. One commit each.
CHANGELOG.mdgets a 0.85.1 section, so merging this publishes 0.85.1.Changes
ParseAndCheckResults.fs). Hover asked for the resolver on every tooltip, and building it lists every entity of every referenced assembly. Now it is built on the first cref it resolves. This came in with Resolve cref links in hover and documentation #1527, so 0.85.0 has it.AdaptiveServerState.fs,String.containsIdentifierinUtils.fs). FCS 43.12 imports all references of a project before it parses a file of it, also when the file then fails FCS's own identifier test. FSAC now checks the text of the file for the name as a whole identifier first. FCS takes its identifiers from the tokens of the file, so this skips no file FCS would search. Transparent compiler only: the background compiler path searches without an identifier test, so the filter could change its results.DisableInMemoryProjectReferenceswork again (ProjectWorkspace.fs,AdaptiveServerState.fs). It has done nothing since Remove older impls #1174. With the setting on, a referenced F# project comes from its output DLL, for both compilers, and Find References follows MSBuild's project references to find dependent projects. The unusedFSharpCompilerServiceChecker.DisableInMemoryProjectReferencesproperty is removed. The setting stays off by default: a DLL does not show changes made since the last build.Results
Fantomas solution, transparent compiler, replaying a reading session: open
CodePrinter.fs, hover, navigate, readSyntaxOak.fs, then Find References onSyntaxOak.Expr.Averages of four runs before and three after; runs differ by up to 40 MB. Find References returns the same 672 references in 9 files before and after, and with
DisableInMemoryProjectReferenceson.Tests
CoreUtilsTests.fs:String.containsIdentifier(whole identifiers,'a, backticks, operators).SnapshotTests.fs: with the setting on, Console1 referencesLibrary1.dllas a PE reference.Related
keepAllBackgroundResolutionsandkeepAllBackgroundSymbolUsessay.