How do I tell VS that what it's editing is PL/SQL?

Last post 08-12-2008 3:17 PM by paulkienitz. 6 replies.

Sort Posts:

  • How do I tell VS that what it's editing is PL/SQL?

    02-28-2008, 6:27 PM

    I have  a project with a bunch of pl/sql source files... packages, functions, and the like.  If I name them FOO.SQL, then it sort of highlights them as SQL, but it appears to assume that it's T-SQL, and if I name them anything else, like FOO.PKG, it treats them as generic text.  The text editor options have handy settings where you can set things like tab behavior when editing PL/SQL and various other languages, but I can't find any way to get it to apply those settings to any real file.  How do I tell it that a file is PL/SQL?

  • Re: How do I tell VS that what it's editing is PL/SQL?

    02-29-2008, 4:17 PM

    The language should be fully supported in VS to get settings available. For example, PHP is not supported in VS and hence there is no way to "tell" VS the file is PHP. You can pick closest possible editor from available ones in Tools | Options | Text Editor | File Extension. For example, closest to .skin is .ascx and it is possible to colorize PHP as C++.

    Thanks

    ------------------------------------------------------------

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: How do I tell VS that what it's editing is PL/SQL?

    02-29-2008, 4:36 PM

    None of the options in that list have anything to do with SQL.  All I can do there, apparently, is tell it to edit it like plain text.  And yet there are six SQL variants listed under text editor languages.  Why are they there if there's no way to use them?  Somewhere in there, there must be something that associates file extensions with that list of languages, no?  Probably hidden in some undocumented config file...

  • Re: How do I tell VS that what it's editing is PL/SQL?

    02-29-2008, 4:44 PM
    Answer

    There are no hidden config files, VS is fully extensible platform. VS editors are under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Editors

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Editors\{C68EA39B-DC7B-472b-B0EC-68DB0603AB94} is SQL editor. Perhaps you can add extension in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Editors\{C68EA39B-DC7B-472b-B0EC-68DB0603AB94}\Extensions

    Thanks

    ------------------------------------------------------------

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: How do I tell VS that what it's editing is PL/SQL?

    02-29-2008, 5:23 PM
    Answer

    Ah, we're getting warmer.  Unfortunately I don't have any {C68EA39B-DC7B-472b-B0EC-68DB0603AB94} editor there, probably because this is studio 8.0, not 9.0.  The only ones that mention SQL are:

    {E1F86ED4-287D-48b1-A159-92FF1C86B40B}  -  SQLMobile File Handler  (extension .MDF)
    {29887BCD-E81F-4722-85CE-2CCF2D9AF30A}  - SQL Data File Handler  (extension .SDF)

    Neither sounds like an SQL source file editor.  And yet such an editor does apparently exist, as it highlights standard SQL keywords, though not the Oracle proprietary ones.

    Nearby I found HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\File Extensions ... this may be where the magic happens.  In there's a key for .sql that has one value: (Default) = {FA6E5E79-C8EE-4D37-B79A-5067F8BD5630}.  That appears to be a reference to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Services\{FA6E5E79-C8EE-4D37-B79A-5067F8BD5630}, which is also referenced by  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\Language Services\T-SQL.  So, it looks like if I find the guid under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\Language Services\PL/SQL, which is {0007B8F0-3435-46BB-BF59-1D3652E6B7A2}, then I can create new extensions pointing to that.

    ...

    IT WORKED!  It highlights things like "create or replace synonym" now.

  • Re: How do I tell VS that what it's editing is PL/SQL?

    07-21-2008, 5:38 PM

    Finally got VS 9 installed, the fix works just the same. 

  • Re: How do I tell VS that what it's editing is PL/SQL?

    08-12-2008, 3:17 PM

    There are still a few keywords it fails to highlight.  I wonder where it keeps the list of keywords. 

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter