VsixCommunity / docs

MIT License
10 stars 7 forks source link

Completed the Walkthrough Create Language Editor I promised #36

Closed ghost closed 2 years ago

ghost commented 2 years ago

@madskristensen

Here is the Walkthrough: Create Language Editor I promised. I will also upload the fixed solution to the VS Marketplace. Please let me know if you have any issues.

ghost commented 2 years ago

@madskristensen The marketplace version: LinqLanguageEditor2022 The Source Link: LinqLanguageEditor2022

madskristensen commented 2 years ago

This is an amazing body of work. Thank you so much. It's almost more a sample or use case than a tutorial, in that it shows so much more than creating a language service.

ghost commented 2 years ago

Your are welcome.

Note: That the CScript is not perfect since I could not figure out how to return some of the results. I can get the imports for namespaces and references working but how to you get an internal class reference like below "Person" needs to be referenced without it you get the results Submission#0Person but if ran inside of LinqPad you get whats in the last picture:

class Person { public string Name { get; set; } public int Age { get; set; } }

static void Sample_Where_Linq_Objects() { Person[] persons = { new Person { Name = "Mike", Age = 25 }, new Person { Name = "Joe", Age = 43 }, new Person { Name = "Nadia", Age = 31 } };

var result = from p in persons where p.Age >= 30 select p;

Debug.WriteLine("Finding persons who are 30 years old or older:"); foreach (Person person in result) Debug.WriteLine(String.Format("{0}: {1} years old", person.Name, person.Age)); }

[cid:90b3c494-3fd5-4891-9e35-3e25496cf5da]

[cid:75993c32-f4d8-423a-a536-f7b6a97e3790]

If I run the query through the test program under debug I get: (But every thing I try to covert the Submission#0.Person to a usable object fails. )

[cid:9155c6c5-c9c0-42bf-8592-66148ee754e1]

Can you ask one of your experts to tell me what I am doing wrong. Thou it may fix it's self if I can get the class reference inside of the CScript.

Danny McNaught Computer Question

email: @.***


From: Mads Kristensen @.> Sent: Wednesday, March 9, 2022 17:37 To: VsixCommunity/docs @.> Cc: Danny McNaught @.>; Author @.> Subject: Re: [VsixCommunity/docs] Completed the Walkthrough Create Language Editor I promised (PR #36)

This is an amazing body of work. Thank you so much. It's almost more a sample or use case than a tutorial, in that it shows so much more than creating a language service.

— Reply to this email directly, view it on GitHubhttps://github.com/VsixCommunity/docs/pull/36#issuecomment-1063447992, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCSP6XHMCAFGYLTIYSBOP3U7ERY5ANCNFSM5QKYWFOQ. You are receiving this because you authored the thread.Message ID: @.***>

ghost commented 2 years ago

@madskristensen

The reply to email removed the pictures.

Your are welcome.

Note: That the CScript is not perfect since I could not figure out how to return some of the results. I can get the imports for namespaces and references working but how to you get an internal class reference like below "Person" needs to be referenced without it you get the results Submission#0Person but if ran inside of LinqPad you get whats in the last picture:

class Person { public string Name { get; set; } public int Age { get; set; } }

static void Sample_Where_Linq_Objects() { Person[] persons = { new Person { Name = "Mike", Age = 25 }, new Person { Name = "Joe", Age = 43 }, new Person { Name = "Nadia", Age = 31 } };

var result = from p in persons where p.Age >= 30 select p;

Debug.WriteLine("Finding persons who are 30 years old or older:"); foreach (Person person in result) Debug.WriteLine(String.Format("{0}: {1} years old", person.Name, person.Age)); }

image

image

If I run the query through the test program under debug I get: (But every thing I try to covert the Submission#0.Person to a usable object fails. )

image

Can you ask one of your experts to tell me what I am doing wrong. Thou it may fix it's self if I can get the class reference inside of the CScript.

Danny McNaught Computer Question

email: @.***


From: Mads Kristensen @.> Sent: Wednesday, March 9, 2022 17:37 To: VsixCommunity/docs @.> Cc: Danny McNaught @.>; Author @.> Subject: Re: [VsixCommunity/docs] Completed the Walkthrough Create Language Editor I promised (PR #36)

This is an amazing body of work. Thank you so much. It's almost more a sample or use case than a tutorial, in that it shows so much more than creating a language service.

— Reply to this email directly, view it on GitHubhttps://github.com/VsixCommunity/docs/pull/36#issuecomment-1063447992, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCSP6XHMCAFGYLTIYSBOP3U7ERY5ANCNFSM5QKYWFOQ. You are receiving this because you authored the thread.Message ID: @.***> You are receiving this because you are subscribed to this thread. Danny McNaught Wed 3/9/2022 18:32 Your are welcome.

Note: That the CScript is not perfect since I could not figure out how to return some of the results. I can get the imports for namespaces and references working but how to you get an internal class reference like below "Person" needs to be referenced without it you get the results Submission#0Person but if ran inside of LinqPad you get whats in the last picture:

class Person { public string Name { get; set; } public int Age { get; set; } }

static void Sample_Where_Linq_Objects() { Person[] persons = { new Person { Name = "Mike", Age = 25 }, new Person { Name = "Joe", Age = 43 }, new Person { Name = "Nadia", Age = 31 } };

var result = from p in persons where p.Age >= 30 select p;

Debug.WriteLine("Finding persons who are 30 years old or older:"); foreach (Person person in result) Debug.WriteLine(String.Format("{0}: {1} years old", person.Name, person.Age)); }

If I run the query through the test program under debug I get: (But every thing I try to covert the Submission#0.Person to a usable object fails. )

Can you ask one of your experts to tell me what I am doing wrong. Thou it may fix it's self if I can get the class reference inside of the CScript.