bsherin / tactic

5 stars 1 forks source link

Go to error from error item doesn't highlight line if module wasn't already open #1161

Open bsherin opened 1 year ago

bsherin commented 1 year ago

I had to comment out the line in context_react.jsx that does this. When it's in I get a maximum depth exceeded error every time. The line is in here:

_goToModule(module_name, line_number){
        for (let tab_id in this.state.tab_panel_dict) {
            let pdict = this.state.tab_panel_dict[tab_id];
            if (pdict.kind == "creator-viewer" && pdict.panel.resource_name == module_name) {
                this._handleTabSelect(tab_id, this.state.selectedTabId, null,()=>{
                    if ("line_setter" in pdict) {
                        pdict.line_setter(line_number)
                    }
                });
                return
            }
        }
        let self = this;
        let the_view = view_views()["tile"];
        const re = new RegExp("/$");
        the_view = the_view.replace(re, "_in_context");
        postAjaxPromise($SCRIPT_ROOT + the_view, {context_id: window.context_id, resource_name: module_name})
            .then((data)=>{
                const new_id = `${data.kind}: ${data.resource_name}`;
                const drmethod = (dmethod) => {self._registerDirtyMethod(new_id, dmethod)};
                this._addPanel(new_id, data.kind, data.res_type, data.resource_name, "spinner", ()=> {
                     let new_panel = self.propDict[data.kind](data, drmethod, (new_panel)=>{
                        this._updatePanel(new_id, {panel: new_panel}, ()=>{
                            let pdict = self.state.tab_panel_dict[new_id];
                            // pdict.line_setter(line_number)  // gives maximum depth exceeded error
                        });
                     });
                 })
            })
            .catch(doFlash);

        return
    }