locked
Add-in: VS thinks my PHP file is an XML file and messes up Intellisense RRS feed

  • Question

  • Product: VS 2010 Ultimate (if you need more then look at full dump at the bottom)

    Important Add-In: VS.PHP from JCX software https://www.jcxsoftware.com/

    Oh then, this must be a JCX software bug: Nice try, but I highly doubt it.

    Description of Problem:

    The JCX software supports PHP projects and provides Intellisense for PHP documents. I have also associated a number of other extensions to be considered PHP so that these three should be associated with the PHP editor: .php, .module, .install

    A typical PHP file could look like an XML file to the VS editor:

    <?php
    phpinfo();
    ?>

    Normally, editing any of these files works fine and I get the PHP intellisense behavior. However, sometimes (probably when I save) VS starts thinking that this file is an XML file. Then, Intellisense gets totally messed up.

    If you edit the file (give it focus) and also have the Properties window open, you will see that VS thinks this file is an "XML Document". Other PHP documents with the same extension have nothing in this Properties.

    Solution?

    Why does VS think this is an "XML Document" and how do I tell it that it is wrong so that I can get the PHP Intellisense? I cannot select different data in the Properties window and cannot delete "XML Document."

    Workaround:

     * Create a new file foo.install

     * Copy all text from bar.install to foo.install

     * Remove bar.install from project and delete it

     * Rename foo.install to bar.install

    Now VS thinks bar.install is a PHP file again!

    Exact Tools Installed: Microsoft Visual Studio 2010

    Version 10.0.40219.1 SP1Rel
    Microsoft .NET Framework
    Version 4.0.30319 SP1Rel

    Installed Version: Ultimate

    Microsoft Office Developer Tools   01019-315-4422995-70621
    Microsoft Office Developer Tools

    Microsoft Visual Basic 2010   01019-315-4422995-70621
    Microsoft Visual Basic 2010

    Microsoft Visual C# 2010   01019-315-4422995-70621
    Microsoft Visual C# 2010

    Microsoft Visual C++ 2010   01019-315-4422995-70621
    Microsoft Visual C++ 2010

    Microsoft Visual F# 2010   01019-315-4422995-70621
    Microsoft Visual F# 2010

    Microsoft Visual Studio 2010 Architecture and Modeling Tools   01019-315-4422995-70621
    Microsoft Visual Studio 2010 Architecture and Modeling Tools
        
    UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

    Microsoft Visual Studio 2010 Code Analysis Spell Checker   01019-315-4422995-70621
    Microsoft Visual Studio 2010 Code Analysis Spell Checker

    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

    Microsoft Visual Studio 2010 Team Explorer   01019-315-4422995-70621
    Microsoft Visual Studio 2010 Team Explorer

    Microsoft Visual Studio Tools for Applications 3.0   01019-315-4422995-70621
    Microsoft Visual Studio Tools for Applications 3.0

    Microsoft Visual Web Developer 2010   01019-315-4422995-70621
    Microsoft Visual Web Developer 2010

    Crystal Reports Templates for Microsoft Visual Studio 2010   
    Crystal Reports Templates for Microsoft Visual Studio 2010

    Git Source Control Provider   1.0.0.0


    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2522890)   KB2522890
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2522890.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2529927)   KB2529927
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2529927.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2542054)   KB2542054
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2542054.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2548139)   KB2548139
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2548139.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2549864)   KB2549864
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2549864.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2581019)   KB2581019
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2581019.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2591016)   KB2591016
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2591016.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2635973)   KB2635973
    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2635973.

    Microsoft Visual Studio 2010 SharePoint Developer Tools   10.0.40219
    Microsoft Visual Studio 2010 SharePoint Developer Tools

    NuGet Package Manager   1.8.30423.9026
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

    Security Update for Microsoft Visual Studio 2010 Ultimate - ENU (KB2644980)   KB2644980
    This security update is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this security update will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2644980.

    Security Update for Microsoft Visual Studio 2010 Ultimate - ENU (KB2645410)   KB2645410
    This security update is for Microsoft Visual Studio 2010 Ultimate - ENU.
    If you later install a more recent service pack, this security update will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/2645410.

    SQL Server Analysis Services   
    Microsoft SQL Server Analysis Services Designer 
    Version 11.0.2100.60

    SQL Server Integration Services   
    Microsoft SQL Server Integration Services Designer
    Version 11.0.2100.60

    SQL Server Reporting Services   
    Microsoft SQL Server Reporting Services Designers 
    Version 11.0.2100.60

    Visual Studio 2010 Shell (Isolated) - ENU Service Pack 1 (KB983509)   KB983509
    This service pack is for Visual Studio 2010 Shell (Isolated) - ENU.
    If you later install a more recent service pack, this service pack will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/983509.

    VS.Php 2.10 for Visual Studio   VS.Php 2.10 for Visual Studio
    VS.Php 2.10 for Visual Studio version 2,10,6970,0.
    Copyright (C) 2003-2011 Jcx.Software Corp. All Rights Reserved.
    For more information about VS.Php 2.10 for Visual Studio, see the Jcx.Software website at <http://www.jcxsoftware.com>. For customer support send email to support@jcxsoftware.com.

    This product includes DBG, freely available from http://dd.cron.ru/dbg/

    Visual Git
    Henk Westhuis


    • Edited by Vinolarium Monday, July 2, 2012 8:36 PM
    Monday, July 2, 2012 8:03 PM

All replies

  • >Oh then, this must be a JCX software bug: Nice try, but I highly doubt it.

    Really?  You see  bug in a file type that is only supported at all with the presence of a third party extension and you assume the bug must be in VS instead of this third party extension?

    Do you see the bug repro in any other file types that are XML involved/derived? Say XAML? HTML?


    Ryan
    Tuesday, July 3, 2012 12:01 AM
  • Actually Ryan this is a VS issue. Probably not a bug, because it is "by design", but VS aggressively tries to parse files which look like XML as XML.

    Open an XML file and save it as .XYZ or something. VS still parses it as XML.

    I see the same issue in the extension I am writing. See also :

    http://stackoverflow.com/questions/195293/disable-visual-studios-validation-of-non-xml-files-that-look-like-xml 

    Tuesday, May 12, 2015 2:43 PM