Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Anyone know any good resources for extending VS and VS Code syntax highlighting/intellisense?

Anyone know any good resources for extending VS and VS Code syntax highlighting/intellisense?

Scheduled Pinned Locked Moved The Lounge
visual-studioquestioncsharp
33 Posts 8 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H honey the codewitch

    I think the answer lies in this TextMate mess but everything I've found is incomprehensible or incomplete. Preferably I'd like it to also work with VS Code. I think the TextMate stuff does but I'm not sure as I don't know where to begin, with even finding a good place to read and start with it. This is a Visual Studio and VS Code question and I have no good place to put it.

    Real programmers use butterflies

    T Offline
    T Offline
    Thornik
    wrote on last edited by
    #9

    Do you understand HUGE DIFFERENCE between VS and cr@p named VS Code??

    H 1 Reply Last reply
    0
    • T Thornik

      Do you understand HUGE DIFFERENCE between VS and cr@p named VS Code??

      H Offline
      H Offline
      honey the codewitch
      wrote on last edited by
      #10

      You'll notice there's a complicated word in my post called "and" Once you figure out what it means, you'll answer your own question.

      Real programmers use butterflies

      1 Reply Last reply
      0
      • S Stefan_Lang

        Not sure if that's what you're looking for, and I don't know if it can be used with VS Code, but I'm very happy with the extended coloring and highlighting capabilities of Visual Assist - a Visual Studio extension by Whole Tomato Software[^] But admittedly the main use I get out of it is its outliner and VA View that gives me a host of information about any symbol I'm currently hovering over. You can find references to any symbol, and unlike Intellisense it will distinguish uses of that specific symbol from uses of a same name symbol from another context. Also the code macros and refactoring options are better than anything offered by Intellisense. There are a lot more useful features like renaming: renaming a member variable will show you every affected line as context and lets you disable those you don't want changed, and renaming a class within a file of the same name will offer to also change the file names accordingly, as well as adjust #include statements of renamed headers.

        GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #11

        I'm looking for ways to extend Visual Studio to highlight my own files. I don't think Visual Assist will help me there? I also don't want end users to have to install it to highlight my files.

        Real programmers use butterflies

        S 2 Replies Last reply
        0
        • H honey the codewitch

          I'm looking for ways to extend Visual Studio to highlight my own files. I don't think Visual Assist will help me there? I also don't want end users to have to install it to highlight my files.

          Real programmers use butterflies

          S Offline
          S Offline
          Stefan_Lang
          wrote on last edited by
          #12

          You can tell VA to interpret files without extensions as C++ headers, or tell it to interpret files with custum extensions as code files. See Custom File Extensions[^]

          GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

          1 Reply Last reply
          0
          • H honey the codewitch

            I'm looking for ways to extend Visual Studio to highlight my own files. I don't think Visual Assist will help me there? I also don't want end users to have to install it to highlight my files.

            Real programmers use butterflies

            S Offline
            S Offline
            Stefan_Lang
            wrote on last edited by
            #13

            honey the codewitch wrote:

            I also don't want end users to have to install it to highlight my files.

            I'm not sure I understand this part. Are you saying you have source files with non-standard extensions that your end users are looking at? If so, then maybe the cost or effort to install VA may not be worth it. However, VisualStudio also has the feature to interpret files with custom extensions as C++. Not sure where in the settings this is hiding. But it would at least enable the built-in highlighting capabilities.

            GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

            1 Reply Last reply
            0
            • H honey the codewitch

              It's fine, but I want it to support my own file formats, namely XBNF and RL I'm looking primarily to target VS rather than VS Code at first, and then take advantage of any overlap but I'll check that out. Thanks.

              Real programmers use butterflies

              J Offline
              J Offline
              Jo_vb net
              wrote on last edited by
              #14

              For your own file formats you could write a small external tool and add it to VS with the external tools manager. I have a log analyser where I load the plain text to a rich text box. For each wanted color I have a list with keywords. A simple function formats the content of the rich text box. Then after formatting the text it shows the desired result.

              H 1 Reply Last reply
              0
              • J Jo_vb net

                For your own file formats you could write a small external tool and add it to VS with the external tools manager. I have a log analyser where I load the plain text to a rich text box. For each wanted color I have a list with keywords. A simple function formats the content of the rich text box. Then after formatting the text it shows the desired result.

                H Offline
                H Offline
                honey the codewitch
                wrote on last edited by
                #15

                Yeah, I already have an app that syntax highlights, and frankly it works better than a rich text box. I'm really hoping for something more integrated, and wedging my app in in place of an actual native-VS editor because I don't know how to use TextMate seems less than ideal. I'm looking over some of the VS code links, and I hope that stuff transfers to VS. I think they both can use TextMate, although VS has another thing you can use too that's code based.

                Real programmers use butterflies

                J 1 Reply Last reply
                0
                • H honey the codewitch

                  Yeah, I already have an app that syntax highlights, and frankly it works better than a rich text box. I'm really hoping for something more integrated, and wedging my app in in place of an actual native-VS editor because I don't know how to use TextMate seems less than ideal. I'm looking over some of the VS code links, and I hope that stuff transfers to VS. I think they both can use TextMate, although VS has another thing you can use too that's code based.

                  Real programmers use butterflies

                  J Offline
                  J Offline
                  Jo_vb net
                  wrote on last edited by
                  #16

                  Do your own file formats contain Program Code or what kind of data?

                  H 1 Reply Last reply
                  0
                  • J Jo_vb net

                    Do your own file formats contain Program Code or what kind of data?

                    H Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #17

                    Grammars and lexer specs. The grammars are an attributed variation of EBNF format called XBNF The lexer specs are my own format, and it's basically attributed name value pairs where the values are either regex expressions or string literals.

                    Real programmers use butterflies

                    J 1 Reply Last reply
                    0
                    • H honey the codewitch

                      Grammars and lexer specs. The grammars are an attributed variation of EBNF format called XBNF The lexer specs are my own format, and it's basically attributed name value pairs where the values are either regex expressions or string literals.

                      Real programmers use butterflies

                      J Offline
                      J Offline
                      Jo_vb net
                      wrote on last edited by
                      #18

                      Can the VS Editor open/read your files with ParentGrammars and lexer specs? And would you know a way to add your own highlighting rules to VS / VS Editor?

                      H 1 Reply Last reply
                      0
                      • J Jo_vb net

                        Can the VS Editor open/read your files with ParentGrammars and lexer specs? And would you know a way to add your own highlighting rules to VS / VS Editor?

                        H Offline
                        H Offline
                        honey the codewitch
                        wrote on last edited by
                        #19

                        To your first question, I don't think so. To your second question, that's exactly what I'm asking about in the OP.

                        Real programmers use butterflies

                        J 1 Reply Last reply
                        0
                        • H honey the codewitch

                          To your first question, I don't think so. To your second question, that's exactly what I'm asking about in the OP.

                          Real programmers use butterflies

                          J Offline
                          J Offline
                          Jo_vb net
                          wrote on last edited by
                          #20

                          You wrote earlier: I want it to support my own file formats, namely XBNF and RL So you could add those files to your VS project and when it appears in the Project Explorer, try to open it.

                          H 1 Reply Last reply
                          0
                          • J Jo_vb net

                            You wrote earlier: I want it to support my own file formats, namely XBNF and RL So you could add those files to your VS project and when it appears in the Project Explorer, try to open it.

                            H Offline
                            H Offline
                            honey the codewitch
                            wrote on last edited by
                            #21

                            Yes, I already do that. It opens them as plain text files. Why would it do otherwise? It has no way of automatically discerning the syntax. Are you having a go at me?

                            Real programmers use butterflies

                            J 2 Replies Last reply
                            0
                            • H honey the codewitch

                              Yes, I already do that. It opens them as plain text files. Why would it do otherwise? It has no way of automatically discerning the syntax. Are you having a go at me?

                              Real programmers use butterflies

                              J Offline
                              J Offline
                              Jo_vb net
                              wrote on last edited by
                              #22

                              The easy part is to get syntax highlighting for alternate file extension: https://stackoverflow.com/questions/21499143/how-to-get-syntax-highlighting-for-alternate-file-extension-for-visual-studio-20 Go to Tools -> Options -> Text Editor -> File Extension And type your alternative extension And then associate it with your editor (e.g. Microsoft Visual C++) The challenge is to add your custom highlighting list to VS / VS Editor!

                              1 Reply Last reply
                              0
                              • H honey the codewitch

                                Yes, I already do that. It opens them as plain text files. Why would it do otherwise? It has no way of automatically discerning the syntax. Are you having a go at me?

                                Real programmers use butterflies

                                J Offline
                                J Offline
                                Jo_vb net
                                wrote on last edited by
                                #23

                                It looks like add new [code] language to VS Code is the only way to go. Colorizer - vscode-docs[^]

                                H 1 Reply Last reply
                                0
                                • J Jo_vb net

                                  It looks like add new [code] language to VS Code is the only way to go. Colorizer - vscode-docs[^]

                                  H Offline
                                  H Offline
                                  honey the codewitch
                                  wrote on last edited by
                                  #24

                                  There are ways to do it with visual studio as well.

                                  Real programmers use butterflies

                                  J 1 Reply Last reply
                                  0
                                  • H honey the codewitch

                                    There are ways to do it with visual studio as well.

                                    Real programmers use butterflies

                                    J Offline
                                    J Offline
                                    Jo_vb net
                                    wrote on last edited by
                                    #25

                                    How many different words / strings are in your custom (grammar) file? Would it be good enough to highlight all of them with the same backcolor?

                                    H 1 Reply Last reply
                                    0
                                    • J Jo_vb net

                                      How many different words / strings are in your custom (grammar) file? Would it be good enough to highlight all of them with the same backcolor?

                                      H Offline
                                      H Offline
                                      honey the codewitch
                                      wrote on last edited by
                                      #26

                                      I'm tired of this conversation. Look, I told you what I was looking for. The rest is just wasting time, and I'm busy.

                                      Real programmers use butterflies

                                      1 Reply Last reply
                                      0
                                      • H honey the codewitch

                                        I think the answer lies in this TextMate mess but everything I've found is incomprehensible or incomplete. Preferably I'd like it to also work with VS Code. I think the TextMate stuff does but I'm not sure as I don't know where to begin, with even finding a good place to read and start with it. This is a Visual Studio and VS Code question and I have no good place to put it.

                                        Real programmers use butterflies

                                        J Offline
                                        J Offline
                                        Jo_vb net
                                        wrote on last edited by
                                        #27

                                        Extending Visual Studio to Provide a Colorful Language Editor[^] To make it run on VS 2019 you have to update some references.

                                        1 Reply Last reply
                                        0
                                        • H honey the codewitch

                                          I think the answer lies in this TextMate mess but everything I've found is incomprehensible or incomplete. Preferably I'd like it to also work with VS Code. I think the TextMate stuff does but I'm not sure as I don't know where to begin, with even finding a good place to read and start with it. This is a Visual Studio and VS Code question and I have no good place to put it.

                                          Real programmers use butterflies

                                          M Offline
                                          M Offline
                                          mikemkii
                                          wrote on last edited by
                                          #28

                                          Just in case you haven't come across this yet - there's this youtube playlist by Mads Kristensen: https://www.youtube.com/playlist?list=PLReL099Y5nRdG2n1PrY_tbCsUznoYvqkS[^] ...and specifically this item within there which sounds like it might be what you're looking for, if it's detailed enough: Writing Visual Studio Extensions with Mads - Supporting new Languages with TextMate Grammar Files - YouTube[^] I have no personal experience to add, but came across it the other day.

                                          H 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups