Skip to content

VB -> C# use project context - #28

Merged
GrahamTheCoder merged 11 commits into
masterfrom
project-context
Feb 18, 2018
Merged

GrahamTheCoder merged 11 commits into
masterfrom
project-context

Conversation

@GrahamTheCoder

Copy link
Copy Markdown
Member

Addresses VB -> C# part of #9
Also fixes #13

We'd probably get a better conversion out of converting a whole file then picking a subset, but since I don't actually understand the use case, the effort isn't really worth it here.
This only kicks in when the runtime is already having difficulty finding the required assembly anyway.
This way we be sure of compatibility with the latest version if we compile against the latest assembly shipped with VS, then just hope for compatibility with older versions.

The alternative is to compile against the oldest versions of the assemblies for a version of VS we care about, and rely on Visual Studio's own binding redirects (or our advice to it in assemblyinfo) to sort things out. The APIs we're using are quite stable, but I'd rather old versions break than new versions since "please upgrade VS" is a better response to a bug report than "please downgrade VS". If we get lots of MissingMethodException bug reports, we'll have to reconsider this.
The benefit over converting just the selected characters is that we're converting what's hopefully a well formed document, so the rest of the document can be used for context, and returning something that represents a node, rather than trying to convert the text "tring", when someone slightly mis-selects.

If two layers of the node hierarachy fail to go through the trivia converter, then the whole document will be converted, which seems like an OK failure case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS2017 - Can't resolve dependencies

1 participant