June 10, 2012
On Sunday, 10 June 2012 at 17:10:40 UTC, Roman D. Boiko wrote:
> On Sunday, 10 June 2012 at 16:51:23 UTC, Rainer Schuetze wrote:
>> So far I have the beta of VS 2012 installed, and from the files you added to the translation, it seems that the release candidate has a few more files. I'll update my VS11beta to VS2012rc and will have a look.
> I didn't include all required files yet.
What would be the correct strategy: translate as many header files as possible, or only necessary (this is what I tried so far), or use some other criteria to decide?
June 10, 2012

On 6/10/2012 7:10 PM, Roman D. Boiko wrote:
> On Sunday, 10 June 2012 at 16:51:23 UTC, Rainer Schuetze wrote:
>> As you don't need the VS2012 SDK or the Windows 8 SDK to build Visual
>> D, it does not seem urgent to do the translations, but it might be
>> nice to have them as this is a fast way to update the interface
>> headers to a new OS version. The recent version of the converter also
>> translates "#ifdef _WIN64" to "version(Win64)" instead of throwing the
>> code out, but I have not done a lot with it yet.
> I wanted to experiment with VisualD a bit to check whether it is
> possible to make use of my other project
> (https://github.com/roman-d-boiko/dct, currently very early draft) from
> VisualD.

I have recently refactored the code so that the parser and the semantic analysis can run in an different process (a local COM server). This was mainly to avoid GC stalls within the IDE, but could also be used to plugin other code for semantic analysis. The current interface is here: https://github.com/rainers/visuald/blob/master/vdc/ivdserver.d

>
> Are these SDKs needed for developing VisualD on Windows 8 RC with Visual
> Studio 11 RC? This setup is the one I use most often.
>

You can also use the SDKs that come with VS2008 or VS2010.

> Basically, either a block of text from some file is commented out when
> it generates compiler error, or some block (`open`) is replaced with
> equivalent starting from `/+`, and the other (`close`) with the one
> ending `+/`, so that everything between them is commented out.
>
> I think some blocks could be converted to the D equivalents, but I don't
> have experience with this.
>
>> Those _null_terminated_ annotations (and similar) should probably be
>> translated to their Win7 SDK version identifier __nullterminated. That
>> way they might get handled correctly by the regex expressions.
> Would be nice to know the correct mapping for various annotations. So
> far I tried to mimic code already present in VisualD.

The annotations are usually commented out by the converter to keep them as documentation. But that means they can still confuse some conversion rules (e.g. calls to replaceTokenSequence that contain __nulltermiatated).

June 10, 2012

On 6/10/2012 7:14 PM, Roman D. Boiko wrote:
> On Sunday, 10 June 2012 at 17:10:40 UTC, Roman D. Boiko wrote:
>> On Sunday, 10 June 2012 at 16:51:23 UTC, Rainer Schuetze wrote:
>>> So far I have the beta of VS 2012 installed, and from the files you
>>> added to the translation, it seems that the release candidate has a
>>> few more files. I'll update my VS11beta to VS2012rc and will have a
>>> look.
>> I didn't include all required files yet.
> What would be the correct strategy: translate as many header files as
> possible, or only necessary (this is what I tried so far), or use some
> other criteria to decide?

The more complete the translation, the better. But to keep it feasable, I have also cut off include dependencies where sensible. The files in sdk/port are the files that might not be converted. (Beware: some of them are in fact converted, I'll need to cleanup the folder).
June 10, 2012
On Sunday, 10 June 2012 at 18:16:39 UTC, Rainer Schuetze wrote:
> I have recently refactored the code so that the parser and the semantic analysis can run in an different process (a local COM server). This was mainly to avoid GC stalls within the IDE, but could also be used to plugin other code for semantic analysis. The current interface is here: https://github.com/rainers/visuald/blob/master/vdc/ivdserver.d
Great! This simplifies my task a lot. Interface and implementation seem to be straightforward. Of course, I'll need to understand overall design first, but now I have a good starting point.

>> Would be nice to know the correct mapping for various annotations. So
>> far I tried to mimic code already present in VisualD.
>
> The annotations are usually commented out by the converter to keep them as documentation. But that means they can still confuse some conversion rules (e.g. calls to replaceTokenSequence that contain __nulltermiatated).
I'll try to finish in the same way as I started (commenting them out), in order to avoid doing changes that I don't understand. If you will consider the result useful, it should be relatively easy to fix them for you.
June 11, 2012
On Sunday, 10 June 2012 at 18:45:55 UTC, Roman D. Boiko wrote:
> On Sunday, 10 June 2012 at 18:16:39 UTC, Rainer Schuetze wrote:
>> I have recently refactored the code so that the parser and the semantic analysis can run in an different process (a local COM server). This was mainly to avoid GC stalls within the IDE, but could also be used to plugin other code for semantic analysis. The current interface is here: https://github.com/rainers/visuald/blob/master/vdc/ivdserver.d
> Great! This simplifies my task a lot. Interface and implementation seem to be straightforward. Of course, I'll need to understand overall design first, but now I have a good starting point.
Do I understand correctly that syntax coloring is implemented via using GetTip / GetTipResult pair of functions, which serialize tokens using ast.node.Node.toD(CodeWriter)? If yes, is format defined by some standard or documented? If no, what mechanism is used to highlight syntax?
June 11, 2012

On 6/11/2012 1:10 PM, Roman D. Boiko wrote:
> On Sunday, 10 June 2012 at 18:45:55 UTC, Roman D. Boiko wrote:
>> On Sunday, 10 June 2012 at 18:16:39 UTC, Rainer Schuetze wrote:
>>> I have recently refactored the code so that the parser and the
>>> semantic analysis can run in an different process (a local COM
>>> server). This was mainly to avoid GC stalls within the IDE, but could
>>> also be used to plugin other code for semantic analysis. The current
>>> interface is here:
>>> https://github.com/rainers/visuald/blob/master/vdc/ivdserver.d
>> Great! This simplifies my task a lot. Interface and implementation
>> seem to be straightforward. Of course, I'll need to understand overall
>> design first, but now I have a good starting point.
> Do I understand correctly that syntax coloring is implemented via using
> GetTip / GetTipResult pair of functions, which serialize tokens using
> ast.node.Node.toD(CodeWriter)? If yes, is format defined by some
> standard or documented? If no, what mechanism is used to highlight syntax?

No. Syntax highlighting is done by the lexer, no (complex) parsing involved. The only case where the parser is consulted (but not waiting for an answer, just using cached information) is to figure out whether "in"/"is" are used as operators or as parameter modifier/IsExpression, respectively.

Syntax highlighting needs to be rather fast, as it is done during drawing, so switching context is out of the question. Instead, Visual D keeps a lexer-state (an int) per line and continues scanning from the start of the line when color information is requested by the IDE.
June 11, 2012
On Monday, 11 June 2012 at 17:41:12 UTC, Rainer Schuetze wrote:
> No. Syntax highlighting is done by the lexer, no (complex) parsing involved. The only case where the parser is consulted (but not waiting for an answer, just using cached information) is to figure out whether "in"/"is" are used as operators or as parameter modifier/IsExpression, respectively.
>
> Syntax highlighting needs to be rather fast, as it is done during drawing, so switching context is out of the question. Instead, Visual D keeps a lexer-state (an int) per line and continues scanning from the start of the line when color information is requested by the IDE.
I couldn't find respective code so far
June 12, 2012

On 6/11/2012 7:57 PM, Roman D. Boiko wrote:
> On Monday, 11 June 2012 at 17:41:12 UTC, Rainer Schuetze wrote:
>> No. Syntax highlighting is done by the lexer, no (complex) parsing
>> involved. The only case where the parser is consulted (but not waiting
>> for an answer, just using cached information) is to figure out whether
>> "in"/"is" are used as operators or as parameter modifier/IsExpression,
>> respectively.
>>
>> Syntax highlighting needs to be rather fast, as it is done during
>> drawing, so switching context is out of the question. Instead, Visual
>> D keeps a lexer-state (an int) per line and continues scanning from
>> the start of the line when color information is requested by the IDE.
> I couldn't find respective code so far

It's mostly in class Colorizer, with the IDE paint callback being ColorizeLine.
June 13, 2012
On Sunday, 10 June 2012 at 18:16:39 UTC, Rainer Schuetze wrote:
> https://github.com/rainers/visuald/blob/master/vdc/ivdserver.d

Hmm... why do you mark the interface dual? It doesn't look as one.
June 13, 2012

On 6/13/2012 10:16 AM, Kagamin wrote:
> On Sunday, 10 June 2012 at 18:16:39 UTC, Rainer Schuetze wrote:
>> https://github.com/rainers/visuald/blob/master/vdc/ivdserver.d
>
> Hmm... why do you mark the interface dual? It doesn't look as one.

It just discloses that I am not an expert in the COM world. The IUnknown base class instead of IDispatch was the result of trial and error when trying to implement the server in C#.

I guess I should just remove the "dual" from the idl file, shouldn't I?