Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Visual Studio Community 2013 #268

Open
huettenhain opened this issue Feb 13, 2017 · 3 comments
Open

Bug in Visual Studio Community 2013 #268

huettenhain opened this issue Feb 13, 2017 · 3 comments
Labels
Milestone

Comments

@huettenhain
Copy link

I have installed the Plugin, I run Visual Studio Community 2013 on Windows 2008 Server R2. Usually, differences to Windows 7 are negligible. When creating a new "Rust Application" project, I receive the following error message:

error

where I have anonymized the path to my ActivityLog.xml. The file contains two error messages towards the end:

<?xml version="1.0" encoding="utf-16"?>
<?xml-stylesheet type="text/xsl" href="ActivityLog.xsl"?>
<activity>
  <entry>
    <record>334</record>
    <time>2017/02/13 11:16:02.231</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;1) Cannot set the value of &apos;VisualRust.Text.RustClassifierProvider.lexer&apos; because the member is not writable. If the member is a property, it must have an accessible setter; otherwise, if it is a field, it must not be read-only.&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot activate part &apos;VisualRust.Text.RustClassifierProvider&apos;.&#x000D;&#x000A;Element: VisualRust.Text.RustClassifierProvider --&gt;  VisualRust.Text.RustClassifierProvider&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot get export &apos;VisualRust.Text.RustClassifierProvider (ContractName=&quot;Microsoft.VisualStudio.Text.Tagging.ITaggerProvider&quot;)&apos; from part &apos;VisualRust.Text.RustClassifierProvider&apos;.&#x000D;&#x000A;Element: VisualRust.Text.RustClassifierProvider (ContractName=&quot;Microsoft.VisualStudio.Text.Tagging.ITaggerProvider&quot;) --&gt;  VisualRust.Text.RustClassifierProvider&#x000D;&#x000A;&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()&#x000D;&#x000A;   at System.ComponentModel.Composition.Primitives.Export.get_Value()&#x000D;&#x000A;   at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export)&#x000D;&#x000A;   at System.ComponentModel.Composition.ExportServices.&lt;&gt;c__DisplayClass4`2.&lt;CreateStronglyTypedLazyOfTM&gt;b__1()&#x000D;&#x000A;   at System.Lazy`1.CreateValue()&#x000D;&#x000A;   at System.Lazy`1.LazyInitValue()&#x000D;&#x000A;   at System.Lazy`1.get_Value()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)</description>
  </entry>
  <entry>
    <record>335</record>
    <time>2017/02/13 11:16:02.418</time>
    <type>Error</type>
    <source>Color Theme Service</source>
    <description>The color &apos;Popup&apos; in category &apos;de7b1121-99a4-4708-aedf-15f40c9b332f&apos; does not exist.</description>
  </entry>
</activity>

The source file in this project then has no syntax highlighting. Building and running executables works fine.

Observation: When I reload the project, or close the solution and re-open it without restarting Visual Studio, syntax highlighting works and no error message is displayed. However, the error re-occurs every time I open Visual Studio for the first time and then load the rust application project.

@huettenhain
Copy link
Author

I just opened the same solution on a Windows 10 computer with Visual Studio 2015 and Visual Rust installed - there is no error message and the syntax highlighting works. The problem seems to be with VS2013 or my OS.

@MaulingMonkey
Copy link
Collaborator

record 334

reformatted for readability:

System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) Cannot set the value of 'VisualRust.Text.RustClassifierProvider.lexer' because the member is not writable. If the member is a property, it must have an accessible setter; otherwise, if it is a field, it must not be read-only.

Resulting in: Cannot activate part 'VisualRust.Text.RustClassifierProvider'.
Element: VisualRust.Text.RustClassifierProvider -->  VisualRust.Text.RustClassifierProvider

Resulting in: Cannot get export 'VisualRust.Text.RustClassifierProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.ITaggerProvider")' from part 'VisualRust.Text.RustClassifierProvider'.
Element: VisualRust.Text.RustClassifierProvider (ContractName="Microsoft.VisualStudio.Text.Tagging.ITaggerProvider") -->  VisualRust.Text.RustClassifierProvider

   at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
   at System.ComponentModel.Composition.Primitives.Export.get_Value()
   at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export)
   at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedLazyOfTM>b__1()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)

It's complaining about this:

        [Import]
        readonly IRustLexer lexer; // <---

        [ImportingConstructor]
        public RustClassifierProvider(IRustLexer lexer)
        {
            this.lexer = lexer;
        }

I don't know enough about VS extension to be certain, but I think we don't need to both [Import] and init this via [ImportingConstructor].

tl;dr: I just need to remove either [Import] or readonly and the ctor.

record 335

seems unrelated.

@MaulingMonkey
Copy link
Collaborator

Should be fixed by MaulingMonkey@38b5e9d

@MaulingMonkey MaulingMonkey added this to the 0.2 milestone Sep 20, 2017
@MaulingMonkey MaulingMonkey self-assigned this Sep 20, 2017
@MaulingMonkey MaulingMonkey removed their assignment Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Syntax (Lexer/AST)
Awaiting triage
Development

No branches or pull requests

2 participants