{"id":2267,"date":"2019-10-03T13:47:02","date_gmt":"2019-10-03T17:47:02","guid":{"rendered":"http:\/\/codinggorilla.com\/?p=2267"},"modified":"2020-01-11T05:36:56","modified_gmt":"2020-01-11T10:36:56","slug":"adding-workspaces-to-antlrvsix","status":"publish","type":"post","link":"http:\/\/165.227.223.229\/index.php\/2019\/10\/03\/adding-workspaces-to-antlrvsix\/","title":{"rendered":"Adding &#8220;workspaces&#8221; to AntlrVSIX"},"content":{"rendered":"\n<p><p>After a lot of hemming and hawing, I am now adding the concept of &#8220;workspaces&#8221; to <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=KenDomino.AntlrVSIX\">AntlrVSIX<\/a>. By this I mean an equivalent of <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/microsoft.codeanalysis.workspace?view=roslyn-dotnet\">workspaces<\/a> that is defined in Roslyn. In AntlrVSIX, a <a href=\"https:\/\/github.com\/kaby76\/AntlrVSIX\/blob\/master\/AntlrVSIX.GrammarDescription\/Document.cs\">Document<\/a> will be a source file; a <a href=\"https:\/\/github.com\/kaby76\/AntlrVSIX\/blob\/master\/AntlrVSIX.GrammarDescription\/Project.cs\">Project<\/a> will be a collection of Documents; a program will be a <a href=\"https:\/\/github.com\/kaby76\/AntlrVSIX\/blob\/master\/AntlrVSIX.GrammarDescription\/Workspace.cs\">Workspace<\/a>, a collection of Projects. Properties on a Project or Document are copied to the equivalent AntlrVSIX object as a property list.<\/p>\n<!--more--><\/p>\n\n\n\n<p>The reason for this is clear if you consider what constitutes a program for languages like C# or Java. But, Antlr has a similar issue: a grammar can be &#8220;imported&#8221; into another, and the scope of the grammar symbols is local to the project.<\/p>\n\n\n\n<p>This required a lot of changes to AntlrVSIX, and will be released as v4.0. Although there aren&#8217;t many new features, it is a significant change nonetheless.<\/p>\n\n\n\n<p><em>Note: I found that obtaining the property lists for the older csproj formats very, very slow, while <\/em><a href=\"https:\/\/natemcmaster.com\/blog\/2017\/03\/09\/vs2015-to-vs2017-upgrade\/\"><em>the newer format much faster<\/em><\/a><em>. For AntlrVSIX itself in VS 2019, it takes an additional 10 seconds if I query the property lists for the 10 projects contained in the solution. Investigating this with the profiler, I found that querying the Value of a property runs especially slow. I now only query the FullPath property and ignore the others. I&#8217;m planning on performing a lazy evaluation of EnvDTE properties for properties in general because the Microsoft code that performs the parsing and semantic analysis of build files is exceedingly slow.<\/em><\/p>\n\n\n\n<p>&#8211;Ken<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After a lot of hemming and hawing, I am now adding the concept of &#8220;workspaces&#8221; to AntlrVSIX. By this I mean an equivalent of workspaces that is defined in Roslyn. In AntlrVSIX, a Document will be a source file; a Project will be a collection of Documents; a program will be a Workspace, a collection &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/165.227.223.229\/index.php\/2019\/10\/03\/adding-workspaces-to-antlrvsix\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Adding &#8220;workspaces&#8221; to AntlrVSIX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/2267"}],"collection":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/comments?post=2267"}],"version-history":[{"count":0,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/2267\/revisions"}],"wp:attachment":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/media?parent=2267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/categories?post=2267"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/tags?post=2267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}