Пример #1
0
            private void OnGotoReference()
            {
                ILuaIntellisenseNavigator navigator = LuaTextEditorFactory.Get();

                if ((navigator != null) && (navigator.OpenAndSelectHandler != null))
                {
                    navigator.OpenAndSelectHandler(Script.Path, new SyntaxEditorTextRange(Expression.TextRange));
                }
            }
Пример #2
0
        public void Initialize()
        {
            m_broker = LuaTextEditorFactory.CreateOrGetBroker();
            m_broker.UseNavigationBar = false;
            m_broker.CustomScriptRegistrationHandler = CustomScriptRegistrationHandler;
            m_broker.OpenAndSelectHandler            = CustomOpenAndSelectHandler;
            m_broker.Status.Changed += BrokerStatusChanged;

            m_statusService = SledServiceInstance.TryGet <IStatusService>();
            m_gotoService   = SledServiceInstance.Get <ISledGotoService>();

            var projectService = SledServiceInstance.Get <ISledProjectService>();

            projectService.Created     += ProjectServiceCreated;
            projectService.Opened      += ProjectServiceOpened;
            projectService.FileOpened  += ProjectServiceFileOpened;
            projectService.FileClosing += ProjectServiceFileClosing;
            projectService.Closed      += ProjectServiceClosed;

            m_documentService = SledServiceInstance.Get <ISledDocumentService>();

            // Register the toolbar menu
            var menuInfo = new MenuInfo(Menu.LuaIntellisense, "Lua Intelliense", "Lua Intelliense Menu");

            m_commandService.RegisterMenu(menuInfo);

            // Register the commands
            m_commandService.RegisterCommand(
                Command.GotoDefinition,
                Menu.LuaIntellisense,
                null,
                "Goto &Definition",
                "Jumps to the definition of the selected variable",
                Atf.Input.Keys.Alt | Atf.Input.Keys.G,
                null,
                CommandVisibility.Menu,
                this);

            m_commandService.RegisterCommand(
                Command.GotoReference,
                Menu.LuaIntellisense,
                null,
                "Goto &References",
                "Jumps to the references of the selected variable",
                Atf.Input.Keys.Alt | Atf.Input.Keys.R,
                null,
                CommandVisibility.Menu,
                this);

            //m_commandService.RegisterCommand(
            //    Command.RenameVariable,
            //    Menu.LuaIntellisense,
            //    Group.LuaIntellisense,
            //    "Rename variable",
            //    "Renames selected variable",
            //    Atf.Input.Keys.Shift | Atf.Input.Keys.Alt | Atf.Input.Keys.R,
            //    null,
            //    CommandVisibility.Menu,
            //    this);

            m_commandService.RegisterCommand(
                Command.MoveToPreviousPosition,
                Menu.LuaIntellisense,
                Group.LuaIntellisense,
                "&Previous visited location",
                "Moves the caret to the previous visited location",
                Atf.Input.Keys.Alt | Atf.Input.Keys.Left,
                null,
                CommandVisibility.Menu,
                this);

            m_commandService.RegisterCommand(
                Command.MoveToNextPosition,
                Menu.LuaIntellisense,
                Group.LuaIntellisense,
                "&Next visited location",
                "Moves the caret to the next visited location",
                Atf.Input.Keys.Alt | Atf.Input.Keys.Right,
                null,
                CommandVisibility.Menu,
                this);
        }