This project is read-only.
1
Vote

Go To Definition fails on top-level code in Script documents

description

You can create a Script document to repro this by cloning & running https://github.com/SLaks/WebEssentials2015/tree/roslyn-markdown (no longer requires Dev12), creating a .md file, and entering
```C#
var x = 2;
x.ToString();
```
Pressing F12 on x will fail early because AbstractGoToDefinitionService.GetContainingTypeSymbol returns null.

Note that this is not an observable failure in that scenario because VisualStudioDocumentNavigationService refuses to navigate to my non-VisualStudioWorkspace.
This will be observable if you ever put a Script file in a VSWorkspace.

comments

Pilchie wrote Dec 4, 2014 at 10:22 PM

This works fine for me with our internal script file syntax, and in our interactive window. AbstractGoToDefinitionService.GetContainingTypeSymbol is allowed to return null, it simply avoids the check for 3rd party navigation (i.e. to xaml files), if there is no containing type symbol.