tomasr / viasfora

A Visual Studio Extension containing miscellaneous improvements to the editor.
Other
548 stars 89 forks source link

X++ support #277

Open AndreasVolkmann opened 5 years ago

AndreasVolkmann commented 5 years ago

I wonder if viasfora could support X++?

For reference: X++ is similar to C# in syntax. https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/dev-ref/xpp-language-reference https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/dev-ref/xpp-cs-comparison

tomasr commented 5 years ago

Sure, it would be possible.

What extension adds the X++ support to Visual Studio so that I can test it?

And do you have a reasonably comprehensive piece of X++ sample code that I could use for testing?

AndreasVolkmann commented 5 years ago

It seems the X++ environment is not available to the public.

Similarly, public code samples are sparse. https://github.com/TrudAX/XppTools/blob/master/DEVCommon/DEVCommon/AxClass/DEVFileReaderCSV.xml https://github.com/microsoft/FMLab/blob/master/FMLab/Lab10-2/FMBILabHelper.xml

tomasr commented 5 years ago

It might still be possible for me to add some basic support without being able to test it locally.

At the very least, I would need to know the buffer content type used by X++ code windows (you can find it out by enabling the Developer Toolbar feature in Viasfora).

AndreasVolkmann commented 5 years ago

Yes, I was really just hoping for some of the basics :)

The buffer graph says: X++ (TextBuffer) image

tomasr commented 5 years ago

I've added some basic support in the current developer branch. Could you give it a try and let me know how it works for you?

AndreasVolkmann commented 5 years ago

Great, the rainbow braces work!

What is needed to get the other features, like keyword highlighting to work?

I saw you had already defined some of them, but they are not highlighted.

tomasr commented 5 years ago

Interesting...... Two things could be happening here:

AndreasVolkmann commented 5 years ago

These are the options for X++: image

tomasr commented 5 years ago

The problem is going to be what classifier name is behind that. If you're using VS2015/2017, could you try installing this extension, enable the editor margin, and then putting the caret on a keyword and see what classifier it reports?

Unfortunately it's not available for VS2019 at this time....

AndreasVolkmann commented 5 years ago

So for almost everything, example public and class, it says None.

For custom types it says X++ Metadata Type. == is X++ Operator. There's also literal strings and numbers.

Even though keywords are categorized as none, they are still highlighted as opposed to normal code.

tomasr commented 5 years ago

That's not great.... not sure if I light up this feature given that (though it definitely seems kind of weird that you're seeing a mixture of both old classifications and new classifications).

I'd need to be able to run it locally to debug further, but it doesn't sound like there's much I can do here...