static/ext/src/ux/AceEditor.js
function(position) {
        if (!this.arg) {
            return false;
        }

        // Note we don't check if position >= this.arg.start because that's
        // implied by the fact that we're asking the assignments in turn, and
        // we want to avoid thing falling between the cracks, but we do need
        // to check that the argument does have a position
        if (this.arg.start === -1) {
            return false;
        }

        // We're clearly done if the position is past the end of the text
        if (position > this.arg.end) {
            return false;
        }

        // If we're AT the end, the position is captured if either the status
        // is not valid or if there are other valid options including current
        if (position === this.arg.end) {
            return this.conversion.status !== Status.VALID ||
                    this.conversion.predictions.length !== 0;
        }

        // Otherwise we're clearly inside
        return true;
    }
function(position) {
        if (!this.arg) {
            return false;
        }

        // Note we don't check if position >= this.arg.start because that's
        // implied by the fact that we're asking the assignments in turn, and
        // we want to avoid thing falling between the cracks, but we do need
        // to check that the argument does have a position
        if (this.arg.start === -1) {
            return false;
        }

        // We're clearly done if the position is past the end of the text
        if (position > this.arg.end) {
            return false;
        }

        // If we're AT the end, the position is captured if either the status
        // is not valid or if there are other valid options including current
        if (position === this.arg.end) {
            return this.conversion.status !== Status.VALID ||
                    this.conversion.predictions.length !== 0;
        }

        // Otherwise we're clearly inside
        return true;
    }
function ( position ) { if ( ! this . arg ) { return false ; } // Note we don't check if position >= this.arg.start because that's // implied by the fact that we're asking the assignments in turn, and // we want to avoid thing falling between the cracks, but we do need // to check that the argument does have a position if ( this . arg . start === - 1 ) { return false ; } // We're clearly done if the position is past the end of the text if ( position > this . arg . end ) { return false ; } // If we're AT the end, the position is captured if either the status // is not valid or if there are other valid options including current if ( position === this . arg . end ) { return this . conversion . status !== Status . VALID || this . conversion . predictions . length !== 0 ; } // Otherwise we're clearly inside return true ; }
If the cursor is at 'position', do we have sufficient data to start
displaying the next hint. This is both complex and important.
For example, if the user has just typed:<ul>
<li>'set tabstop ' then they clearly want to know about the valid
values for the tabstop setting, so the hint is based on the next
parameter.
<li>'set tabstop' (without trailing space) - they will probably still
want to know about the valid values for the tabstop setting because
there is no confusion about the setting in question.
<li>'set tabsto' they've not finished typing a setting name so the hint
should be based on the current parameter.
<li>'set tabstop' (when there is an additional tabstopstyle setting) we
can't make assumptions about the setting - we're not finished.
</ul>
<p>Note that the input for 2 and 4 is identical, only the configuration
has changed, so hint display is environmental.

<p>This function works out if the cursor is before the end of this
assignment (assuming that we've asked the same thing of the previous
assignment) and then attempts to work out if we should use the hint from
the next assignment even though technically the cursor is still inside
this one due to the rules above.
If the cursor is at position do we have sufficient data to start displaying the next hint . This is both complex and important . For example if the user has just typed : <ul > <li > set tabstop then they clearly want to know about the valid values for the tabstop setting so the hint is based on the next parameter . <li > set tabstop ( without trailing space ) - they will probably still want to know about the valid values for the tabstop setting because there is no confusion about the setting in question . <li > set tabsto they ve not finished typing a setting name so the hint should be based on the current parameter . <li > set tabstop ( when there is an additional tabstopstyle setting ) we can t make assumptions about the setting - we re not finished . < / ul > <p > Note that the input for 2 and 4 is identical only the configuration has changed so hint display is environmental .