-
Notifications
You must be signed in to change notification settings - Fork 14
/
ref.txt
41 lines (35 loc) · 2.06 KB
/
ref.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<<< Real CoreLib location >>>
https://github.com/dotnet/runtime/blob/master/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
<<< Roslyn Code Analyzers >>>
* In VS 2019 installer: Check "Visual Stdios extension development".
* In VS 2019 installer -> "Individual Components" tab: Check ".NET Compiler Platform SDK".
* Create code analyzer in VS by: File->New Proj->Extensibility->Analyzer With Code Fix (.NET Standard)
* Run .Vsix for debugging for testing syntax highlighting errors.
* NOTE: Only installed NuGet will get you failed builds (not just syntax highlighting).
* To package anylizer for NuGet prep: ".\nuget pack .\Analyzer.csproj -IncludeReferencedProjects"
* Then extract .nupkg (aka zip) files and reformat them using "AnylizerRef"
* Then re-zip and change ext to .nupkg
* Custom NuGet packages can be installed in VS via:
* Tools->NuGet Package Manager->Package Manager Settings->Package Sources
* Set "Source" to file location .nupkg files are located
NuGet Cache location: C:\Users\<USER>\.nuget\packages\...
<<< Install Roslyn compiler services >>>
Roslyn compiler from NuGet (Install or Update these ONLY): https://gist.github.com/DustinCampbell/32cd69d04ea1c08a16ae5c4cd21dd3a3
* Microsoft.VisualStudio.LanguageServices (.NET Framework)
* Microsoft.CodeAnalysis.CSharp.Workspaces (.NET Core)
* Microsoft.CodeAnalysis.Workspaces.MSBuild
* Microsoft.Build.Locator
To uninstall all packaged for clean updates
* Open in VS: "Tools->NuGet Package Manager->Package Manager Consonle"
* Run command: get-package | uninstall-package -removedependencies -force
<<< Common Roslyn SemanticModel Methods >>>
* GetOperation: Gets a multitude of data such as ISymbol, ConstantValue, etc
* GetDeclaredSymbol: Gets ISymbol for Declaration Syntax
* GetSymbolInfo: Gets ISymbol for Reference Syntax
* GetTypeInfo: Gets ITypeSymbol for Reference Syntax
<<< HOW TO: Find symbol references >>>
using Microsoft.CodeAnalysis.FindSymbols;
SymbolFinder.FindReferencesAsync(...)
Inherit from SymbolVisitor<ITypeSymbol> (just a helper class)
<<< Test for special syntax rules >>>
SyntaxFacts