static void Main(string[] args)
        {
            //string extensionPath = "C:\\Users\\azwie\\.vscode\\extensions\\ms-dynamics-smb.al-5.0.329509";
            //string extensionPath = "C:\\Users\\azwie\\Downloads\\VSCode-win32-x64-1.45.1\\data\\extensions\\microsoft.al-0.13.82793";
            string extensionPath = "C:\\Projects\\MicrosoftALVersions\\LatestBC";

            ALDevToolsServerHost host = new ALDevToolsServerHost(extensionPath);

            host.Initialize();

            ALDevToolsServer alDevToolsServer = new ALDevToolsServer(extensionPath);

            //string filePath = "C:\\Projects\\Sandboxes\\al-test-projects\\small\\Pag50000.MySmallTableList.al";
            string filePath = "C:\\Projects\\Sandboxes\\al-test-projects\\SmallBC16\\MyPage.al";
            ALSymbolInfoSyntaxTreeReader syntaxTreeReader = new ALSymbolInfoSyntaxTreeReader(true);
            ALSymbolInformation          symbols          = syntaxTreeReader.ProcessSourceFile(filePath);

            ALFullSyntaxTree syntaxTree = new ALFullSyntaxTree();

            syntaxTree.Load("", filePath);

            CodeAnalyzersLibrariesCollection caLibCol = new CodeAnalyzersLibrariesCollection(alDevToolsServer);
            CodeAnalyzersLibrary             caLib    = caLibCol.GetCodeAnalyzersLibrary("${CodeCop}");

            filePath = "C:\\Projects\\Sandboxes\\al-test-projects\\SmallBC16\\AnZwDev_Small but great AZ AL Extension_1.0.0.0.app";
            ALSymbolInfoPackageReader packageReader = new ALSymbolInfoPackageReader();

            packageReader.ReadAppPackage(filePath);

            Console.WriteLine("Done");
        }
示例#2
0
        static void Main(string[] args)
        {
            ALDevToolsServer alDevToolsServer = new ALDevToolsServer("C:\\Users\\azwie\\.vscode\\extensions\\ms-dynamics-smb.al-5.0.280447");

            string filePath = "";
            ALSyntaxTreeSymbolsReader syntaxTreeReader = new ALSyntaxTreeSymbolsReader();
            ALSyntaxTreeSymbol        symbol           = syntaxTreeReader.ProcessSourceFile(filePath);
        }
示例#3
0
        static void Main(string[] args)
        {
            // The code provided will print ‘Hello World’ to the console.
            // Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.

            ALDevToolsServer server = new ALDevToolsServer("C:\\Users\\azwie\\.vscode\\extensions\\ms-dynamics-smb.al-4.0.209944");

            ALExtensionProxy alExtensionProxy = server.ALExtensionProxy;
            //alExtensionProxy.Load();

            CodeAnalyzersLibrary library = server.CodeAnalyzersLibraries.GetCodeAnalyzersLibrary("${AppSourceCop}");


            //ALPackageSymbolsLibrary lib = new ALPackageSymbolsLibrary(alExtensionProxy,
            //    "C:\\Projects\\Sandboxes\\samplealprojects\\big\\.alpackages\\Microsoft_Application_11.0.20901.0.app");
            //lib.Load(false);

            ALSymbolInfoSyntaxTreeReader s = new ALSymbolInfoSyntaxTreeReader(alExtensionProxy);
            //ALSymbolInformation m = s.ProcessSourceFile("C:\\Projects\\Sandboxes\\ALProject5\\New Page.al");
            //ALSymbolInformation m = s.ProcessSourceFile(
            //    "C:\\Projects\\Sandboxes\\samplealprojects\\big\\ftest\\CardPageTest02.al");

            ALSymbolInformation m = s.ProcessSourceFile(
                "C:\\Projects\\Sandboxes\\samplealprojects\\small\\tt1.al");



            /*
             * DateTime t1 = DateTime.Now;
             * ALSymbolInfoPackageReader appPackageReader = new ALSymbolInfoPackageReader(alExtensionProxy);
             * ALAppPackage package = appPackageReader.ReadAppPackage("C:\\Projects\\Sandboxes\\samplealprojects\\big\\.alpackages\\Microsoft_Application_14.0.29581.0.app");
             * DateTime t2 = DateTime.Now;
             * TimeSpan t = t2 - t1;
             * Console.WriteLine(t.TotalMilliseconds.ToString() + "ms");
             * Console.WriteLine("Package " + package.Name);
             * if (package.Tables != null)
             *  Console.WriteLine("Tables: " + package.Tables.Count.ToString());
             *
             * ALSymbolInformation symbol = package.ToALSymbol();
             */

            ALPackageSymbolsCache   packagesCache  = new ALPackageSymbolsCache(alExtensionProxy);
            ALProjectSymbolsLibrary projectSymbols = new ALProjectSymbolsLibrary(packagesCache,
                                                                                 alExtensionProxy,
                                                                                 false,
                                                                                 "C:\\Projects\\Sandboxes\\samplealprojects\\big",
                                                                                 ".alpackages");

            projectSymbols.Load(false);



            Console.WriteLine("Hello World!");
            Console.ReadKey();

            // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
        }
        public CodeAnalyzersLibrary(ALDevToolsServer newALDevToolsServer, string newName)
        {
            this.ALDevToolsServer = newALDevToolsServer;

            newName = newName.Trim();
            if ((newName.StartsWith("${")) && (newName.EndsWith("}")))
            {
                newName       = newName.Substring(2, newName.Length - 3);
                this.Name     = newName;
                this.FilePath = System.IO.Path.Combine(this.ALDevToolsServer.ExtensionBinPath, "Analyzers", "Microsoft.Dynamics.Nav." + this.Name + ".dll");
            }
            else
            {
                this.FilePath = newName;
                this.Name     = System.IO.Path.GetFileNameWithoutExtension(this.FilePath);
            }

            this.Rules = new List <CodeAnalyzerRule>();
        }
 public GetCodeAnalyzersRulesRequestHandler(ALDevToolsServer server) : base(server, "al/getcodeanalyzersrules")
 {
 }
 public CloseSyntaxTreeNotificationHandler(ALDevToolsServer alDevToolsServer) : base(alDevToolsServer, "al/closesyntaxtree")
 {
 }
 public ProjectSymbolsRequestHandler(ALDevToolsServer server) : base(server, "al/projectsymbols")
 {
 }
 public AppPackageSymbolsRequestHandler(ALDevToolsServer server) : base(server, "al/packagesymbols")
 {
 }
 public CodeAnalyzersLibrariesCollection(ALDevToolsServer newALDevToolsServer)
 {
     this.ALDevToolsServer = newALDevToolsServer;
     this.LibrariesCache   = new Dictionary <string, CodeAnalyzersLibrary>();
 }
 public GetFullSyntaxTreeRequestHandler(ALDevToolsServer server) : base(server, "al/getfullsyntaxtree")
 {
 }
示例#11
0
 public LibrarySymbolsDetailsRequestHandler(ALDevToolsServer server) : base(server, "al/librarysymbolsdetails")
 {
 }
示例#12
0
 public GetSyntaxTreeSymbolRequestHandler(ALDevToolsServer server) : base(server, "al/getsyntaxtreesymbol")
 {
 }
 public ALDevToolsServerHost(string extensionPath)
 {
     this.ALDevToolsServer = new ALDevToolsServer(extensionPath);
 }
 public BaseALRequestHandler(ALDevToolsServer server, string name) : base(name)
 {
     this.Server = server;
 }
 public CloseSymbolsLibraryNotificationHandler(ALDevToolsServer alDevToolsServer) : base(alDevToolsServer, "al/closesymbolslibrary")
 {
 }
示例#16
0
 public WorkspaceCommandRequestHandler(ALDevToolsServer server) : base(server, "al/workspacecommand")
 {
 }
示例#17
0
 public DocumentSymbolsRequestHandler(ALDevToolsServer server) : base(server, "al/documentsymbols")
 {
 }
示例#18
0
 public BaseALNotificationHandler(ALDevToolsServer alDevToolsServer, string name) : base(name)
 {
     this.Server = alDevToolsServer;
 }