Port document symbol tests + fixes #2207
Draft
+16,093
−28
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.
In Strada, the document symbol tests (i.e.
navigationTree) were not baseline tests. I initially ported those tests as they were in Strada, but some 40 tests failed, and mostly due to intentional differences, and so I just went through every failing test, fixed the most relevant differences, and re-ported the tests as baseline tests. Long term I think baseline tests are what we want for document symbol, and I think keeping diffs was going to be too noisy anyways.I had to add support in document symbol for expandos and some other missing things like name truncation.
Noticeable differences:
import *{} from 'foo'won't include an unnamed namespace import).Still missing:
Object.defineProperty(...)is missing because we still haven't added support for this construct yet in Corsa. SeenavigationBarFunctionPrototype_test.go. If we add support for it by reparsing it into something else, we'll just need to update thenewDocumentSymbolto allow that reparsed node, but that should be a quick change.If the baseline format is ok, I can add a similar baselining function for workspace symbols too, since it's likely we'll want to use that for new tests going forward.