I would like to write a syntax highlighting editor extension for VS 2019 in C++ (nothing else), are there any samples to get me started? - visual-studio-2019

I would like to write a syntax highlighting editor extension for VS 2019 in C++ (nothing else), are there any samples to get me started?
I can only find one example extension for VS 2019 written in C++ and it consists of a subclass with no explanations of how to do anything AFAI can see.
I believe I need a language editor extension, but am not 100%
The language it needs to highlight is similar to assembler.
If this was VS6, I might have just used the custom keyword colouriser.

I would like to write a syntax highlighting editor extension for VS
2019 in C++ (nothing else), are there any samples to get me started?
In current VS IDE, Microsoft does not advocate writing extensions in c++.
As Microsoft recommends, current extensions are more likely to use c# rather than c++.
Although some VS SDK APIs are probably written in c++, but the interfaces are still called using c#.
However, there is only one c++ project template called vspakcage
But this project provides various background services for VS IDE . It will only be loaded when needed. So for you to add the syntax highlighting feature permanently, this project is afraid of lacking.
Besides, there is no official documentation to guide the writing of the c++ project.
Suggestion
You can try to write such extension in c#, and you can refer to this official document and this.
In addition, if you still want your feature, I suggest you could suggest a feature on our User Voice Forum.(click suggest a feature). Then you can share the link with us here and anyone who is interested in this feature will vote for you so that it will get Microsoft's attention.

Related

First steps to reconstruct the architecture in a Delphi 7 project

I am working with an undocumented, 100.000 lines Delphi 7 project and one of my goals is to create a software architecture document from the source code.
Can you give me any ideas on how to approach this?
These tools work with Delphi 7 and are of great help:
the UML tool ModelMaker
the refacotoring tool ModelMaker Code Explorer
the documentation tool Documentation Insight (as of august 2012)
UML diagrams are a great way to get an overview of structure. How well that overview is, depends on how well the structure is.
For taking over projects like these, I start with some basic documentation (often in MarkDown format, as that text based format is version control friendly, and generates nice HTML).
To get that going, it helps if the original developers or/and some base documentation are still there.
Then just start to:
fix bugs / apply feature requests
use ModelMaker to get a feel for overall structure
use ModelMaker Code Explorer as a refactoring tool
use Documentation Insight to document inside the source code (you can generate help files and web pages with the pro version, see feature matrix)
update my Markdown documents with any information that does not fit in the source code documentation well
Note you can put some documentation in using Model Maker Code Explorer, but it can not be exported as help files, since it uses a different documentation format than Documentation Insight.
So I agree with the comment by Jan Doggen (thanks Jan!): just start. Make sure you have the right tools to help that going.
Try running the source code through a newer Delphi version that supports UML modeling, then let it show you how different sections of code related to each other.
Understand will do the job. Free download includes 15 days evaluation which will be more then enough for what you need to document.

Running Scala code on iOS [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Any way to use some Scala for iOS coding?
Would it be possible to use the Scala.NET implementation, and then MonoTouch to run Scala code on an iOS device?
I have not been able to find a page with binaries of Scala.NET that I can test, so the following are just general guidelines as to what you can do with MonoTouch and .NET languages.
MonoTouch can run any ECMA CIL that you feed to it. When you consider using a new language with Monotouch, there are two components that come into play:
Tooling for the IDE
Runtime for the language
The tooling for the IDE is the part responsible for starting the builds, providing intellisense and if you use Interface Builder, it creates a set of helper methods and properties to access the various outlets in your UI. As of today, we have only done the full implementation for C#. What this means for an arbitrary language is that you wont get the full integrated experience until someone does the work to integrate other languages.
This is not as bad as it sound, it just means that you need to give up on using XIB files from your language and you probably wont get syntax highlighting and intellisense. But if you are porting code from another language, you probably dont need it. This also means that you would probably have to build your assembly independently and just reference that from your C# project.
So you compile with FoobarCompiler your code into a .dll and then reference in your main C# project.
The language runtime component only matters for languages that generate calls into a set of supporting routines at runtime and those routines are not part of the base class libraries (BCL). C# makes a few of those calls, but they are part of the BCL.
If your compiler generates calls to a supporting runtime that is not part of the BCL, you need to rebuild your compiler runtime using the Mono Mobile Profile. This is required since most runtimes target a desktop edition of the BCL. There are many other API profiles available, like Silverlight, Mono Mobile, Compact Framework and Micro Framework.
Once you have your runtime compiled with our core assemblies, then you are done
If you had read the MonoTouch FAQ, you would have noticed that it currently supports only C# and no other CLR languages.
Binaries for the Scala.NET library and the compiler can be obtained via SVN, in the bin folder of the preview:
svn co http://lampsvn.epfl.ch/svn-repos/scala/scala-experimental/trunk/bootstrap
Bootstrapping has been an important step, and ongoing work will add support for missing features (CLR generics, etc). All that will be done.
For now we're testing Scala.NET on Microsoft implementations only, but we would like our compiler to be useful for as many profiles and runtime implementations as possible.
A survivor's report on using Scala.NET on XNA at http://www.srtsolutions.com/tag/scala
Miguel Garcia
http://lamp.epfl.ch/~magarcia/ScalaNET/

How do I implement an F# Read Eval Print Loop (REPL)?

I would like to add an F# REPL to my application for live debugging purposes. I am looking at the source code for fsi.exe (F# Interactive) and there is a ton of stuff going on that looks like it pokes around with F# compiler internals. I cannot get this same code to compile in the context of our application because of this.
Is there a nice simple example of implementing an F# REPL somewhere? I would have hoped for this to be fairly easy.
The short answer is that F# (unfortunatelly) doesn't currently provide any API for hosting F# Interactive in your applications. There are a lot of people asking for this - see for example this SO question.
There are essentially two things you could do about that:
You can modify the open-source release and compile fsi.exe as some DLL library that would provide the API you need. This isn't simple task - F# Interactive is tightly bound with the compiler (it compiles code you enter on the fly), but it should be doable to encapsulate the types implementing REPL into some type you could call (But you cannot just take some file out of it - you need to compile entire F# to get this working).
You can run fsi.exe as a separate process as Visual Studio does and send commands to it using standard input/output. You can get some more flexibility by loading your library when fsi.exe starts. The library could use .NET Remoting to connect back to your application and expose some data.
Unfortunatelly, these two options are probably the only things you can do at the moment.
EDIT I was thinking that I already answered this question somewhere (perhaps in email), but couldn't
find it! Thanks to Mauricio who found the exact duplicate (even with my duplicate answer... Doh!)
I've written a series of blog posts about using the open source F# interactive executable inside and WPF application.
The code base is available on github - https://github.com/oriches/Simple.Wpf.FSharp.Repl
The series of blog posts are:
http://awkwardcoder.blogspot.co.uk/2013/12/simple-f-repl-in-wpf-part-1.html
http://awkwardcoder.blogspot.co.uk/2013/12/simple-f-repl-in-wpf-part-2.html
http://awkwardcoder.blogspot.co.uk/2013/12/simple-f-repl-in-wpf-part-3.html
The final post is to follow soon.

FxCop/StyleCop for Delphi?

Does anyone know of an equivalent to FxCop/StyleCop for Delphi? I would really like to get the automatic checking of style, etc. into Continuous Integration.
There's Pascal Analyzer from Peganza: http://www.peganza.com/products_pal.htm
I don't know how the features compare to FxCop, since I haven't really used either one.
The closest I've seen is CodeHealer from SOCK software. We use it, and we have integrated it into our FinalBuilder build. It differs from FxCop in one important way: It analyzes the source code, rather than the produced executable. It also doesn't check quite as much as FxCop does. But I think it is the best thing which is available in this category for Delphi.
Delphi 2009 support isn't there just yet, but they say they're working on it.
Delphi Code Analyzer is another one that is open source.
The DGrok project started with something like FxCop some years ago. The parser and analysis parts are still available, read more at "DGrok 0.8.1: multithreading, default options, GPL" - The parser is a .Net project but
DGrok is a set of tools for parsing
Delphi source code and telling you
stuff about it. Read more about it on
the DGrok project page.
There is a new Delphi plugin for Sonar, which uses a Delphi grammar to run automatic tests over the source code.
I've heard of something called Delforex but haven't used it myself (yet)
Delforex is great for actually formatting the code. It does not do much more than that though. (we have/do use it).
I would second the votes for either Pascal Analyzer or Code Healer.
Vaccano
Doesn't Delphi output .net compatible IL code? I haven't used it in an age but I thought newer versions output .net assemblies.
If so then I would have thought FXcop would work and you could always add some of your own custom rules to it. Stylecop would not work but you could at least get FXCop running.

Are there any support tools like coderush or resharper for F#?

Are there any support tools like coderush or resharper for F#?
Preview version of FSharpRefactor released in Visual Studio Gallery.
http://visualstudiogallery.msdn.microsoft.com/339cbae9-911d-4f99-9033-3c3564676f45
http://www.youtube.com/watch?v=T6-YjUULNCA/
F# Refactor open source project on CodePlex (Apache license).
Take a look at the open-source Visual F# Power Tools project. They've got a rename refactoring, some code generation stuff (eg. record stub generation), graying out of unused declarations, as well as some other things. They're moving pretty fast at the moment, with lots of new features getting added all the time.
There's an effort to support F# in ReSharper via an external plug-in (itself written in F#). You can find preliminary info here.
FSharpRefactor 0.1 (Preview version) Released on the Visual Studio Gallery.
http://visualstudiogallery.msdn.microsoft.com/339cbae9-911d-4f99-9033-3c3564676f45?SRC=Home
Not yet, as far as I know. I was also looking for something similar to no success. I suspect as soon as F# hits VS2010 as its integral part, or even a bit earlier, such tools will eventually emerge.
As far as ReSharper is concerned, you may want to drop JetBrains a quick email, it would be interesting to know whether these guys have any plans regarding F#.
Since the push in f# is towards light mode the reformatting possible is likely to be both limited, and hard to implement.
Normally reformatting takes the structural information and uses that to create the textual position. In the case of #light the textual position (of indenting at least) is the structure. As such any reformatting would be at best to sort inter symbol spacing, hardly onerous to do yourself.
I would therefore not expect a commercial product for it at least until the 'proper' integration with the IDE (I do not consider the current CTP proper in this regard since several outstanding bugs with it exist which will not be fixed in 2008)
CodeRush is working in F# editor. At least some code assistance and code templates. But code templates are not defined yet (you have to create your own).

Resources