Get semantic model from a classifier VSIX
c#, roslyn, visual-studio-2013
Solution
You need to add a reference to Microsoft.CodeAnalysis.EditorFeatures.Text.dll, then use the following code.
var doc = point.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
var model = await doc.GetSemanticModelAsync();
This requires the `Microsoft.CodeAnalysis.EditorFeatures.Text` NuGet package (.NET 4.6 required)
Problem
As R# is not supporting the Roslyn Early Preview C# 6.0 features, the code looks very dull... I would like to colorize the code using a classifier VSIX. Is it possible to get the semantic model from the Roslyn Language Service for the current document?