Add source generator support to the LSIF indexer#49306
Merged
jasonmalinowski merged 3 commits intodotnet:masterfrom Nov 13, 2020
Merged
Add source generator support to the LSIF indexer#49306jasonmalinowski merged 3 commits intodotnet:masterfrom
jasonmalinowski merged 3 commits intodotnet:masterfrom
Conversation
We now require that source generators must live in a netstandard2.0 project, and our various test projects (both unit tests and integration tests) don't always target that. To keep things simple, we'll have a single project that provides some trivial source generators so we can test loading them in all platforms.
b08aed4 to
89d1804
Compare
89d1804 to
9a91ebd
Compare
jasonmalinowski
commented
Nov 13, 2020
| { | ||
| var text = semanticModel.SyntaxTree.GetText(); | ||
|
|
||
| // We always use UTF-8 encoding when writing out file contents, as that's expected by LSIF implementations. |
Member
Author
There was a problem hiding this comment.
This is from talking with @BertanAygun, although I'm asking for further spec clarification in microsoft/language-server-protocol#1139.
Member
Author
There was a problem hiding this comment.
Current answer at least is this is correct, so if that changes we'll come back and fix it.
mavasani
approved these changes
Nov 13, 2020
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.
This adds support for running generators when the LSIF tool is invoked, and writes out contents for the generated files so further tools can process them.
The "interesting" bit of this PR is actually refactoring out a test source generator we had into a project of it's own. The compiler now requires that the assembly that contains the generator not be targeting the .NET Framework; since we have test projects that are currently targeting .NET Framework we can't put the generator in the unit test projects; even if we retarget the test projects we may still want to test on .NET Framework hosts since that's where our code is actually running in some scenarios. Right now the compiler has a similar need for such a project, so hopefully we'll move it further down and use it for that too. (FYI to @chsienki on this bit.)