Hirse / brackets-outline-list

Extension for Brackets and Phoenix to display a list of the functions or definitions in the currently opened document.
MIT License
79 stars 30 forks source link

ES6 class functions showing up multiple times #81

Closed yngve-sk closed 7 years ago

yngve-sk commented 7 years ago

It does display functions now BUT it also displays the same function multiple times. See screenshots.

screen shot 2017-03-13 at 1 49 24 pm

screen shot 2017-03-13 at 1 49 44 pm

Minimal class to reproduce the issue:

class Test {
    constructor() {}

    _init() {
        this.container = document.querySelector('.tf-editor-container.ng-id-' + this.$scope$id);

        this.canvas = d3.select(this.container)
            .append('canvas')
            .attr('class', 'tf-editor-background-canvas')
            .attr('width', 400)
            .attr('height', 400); // 400x400 pixels to render on

        this.svgMain = d3.select(this.container)
            .append('svg')
            .attr('class', 'tf-editor-svg-container');
        //.attr('width', '100%')
        //.attr('height', '100%');

        let sizes = this._getSizes();
        this.originalSize.total = sizes.total;
        this.originalSize.content = sizes.content;

        this.histogramSelectionGroup = this.svgMain.append('g')
            .attr('class', 'tf-editor-3d-selection-histogram-group');

        this.histogramGroup = this.svgMain.append('g')
            .attr('class', 'tf-editor-full-histogram-group');

        this.transferFunctionGroup = this.svgMain.append('g')
            .attr('class', 'tf-editor-tf-view-group');

        this.eventListenerRect = this.svgMain.append('rect')
            .attr('class', 'tf-editor-event-listener-rect')
            .on('mousedown', () => {
                this._mousedown();
            })
            .on('mouseup', () => {
                this._mouseup();
            })
            .on('mousemove', () => {
                this._mousemove();
            });

        this.transferFunctionControlPointGroup = this.svgMain.append('g');

        //this.canvasContext = this.canvas.node().getContext(); TODO BITMAP

        let self = this;

        this.colorGradientRectContainer = this.svgMain.append('g');

        this.colorGradientRect = this.colorGradientRectContainer.append('rect')
            .attr('class', 'tf-editor-color-gradient-axis')
            .on('mousedown', function () {
                d3.event.stopPropagation();
                self._colorGradientMouseDown(d3.mouse(this));
            })
            .on('mouseup', function () {
                d3.event.stopPropagation();
                self._colorGradientMouseUp(d3.mouse(this));
            })
            .on('mousemove', function () {
                d3.event.stopPropagation();
                self._colorGradientMouseMove(d3.mouse(this));
            })
            .attr('width', sizes.content.width)
            .attr('height', sizes.bottomAxis.colorGradientRect.height);

        this.colorGradientControlPointsGroup = this.colorGradientRectContainer.append('g')
            .attr('class', 'tf-editor-color-gradient-control-points');

        $(this.colorGradientRect.node()).on('click', function () {
            return false;
        });
        $(this.colorGradientRect.node()).on('mouseup', function () {
            return false;
        });
        $(this.colorGradientRect.node()).on('mousemove', function () {
            return false;
        });

        this.isovalueAxis = this.svgMain.append('g')
            .attr('class', 'tf-editor-axis-isovalue');

        this.opacityAxis = this.svgMain.append('g')
            .attr('class', 'tf-editor-axis-opacity');

        this.defs = this.svgMain.append('defs');
        this.colorGradient = this.defs.append('linearGradient')
            .attr('id', 'linear-gradient-' + this.$scope$id);

        $(".tf-editor-color-picker-container.ng-id-" + this.$scope$id + ">input").spectrum({

        }); 
        this.colorPicker = $(".tf-editor-color-picker-container.ng-id-" + this.$scope$id + ">input");

        this.colorPicker.on('change', (tinycolor) => {
            this._colorPicked(tinycolor, true);
        });
        this.colorPicker.on('move', (tinycolor) => {
            this._colorPicked(tinycolor, false);
        });
    }
}

Details about your environment OS: Mac OSX sierra (10.12.2) JS version: ES6

Brackets Version: Release 1.8 build 1.8.0-17108 (alf_localization_release_1.8 3af64fae4)

Brackets Outline List Version: v1.0.0-alpha.1

Hirse commented 7 years ago

I found a fix for this, would you mind installing the latest commit and checking if it works for all your cases?

yngve-sk commented 7 years ago

Yep it works now sir! Thanks again 👍