Skip to content

MonacoOutlineContribution creates broken Range #12304

Closed
@colin-grant-work

Description

Bug Description:

range: this.asRange(new monaco.Range(0, 0, 0, 0)),
fullRange: this.asRange(new monaco.Range(0, 0, 0, 0)),

protected asRange(range: monaco.IRange): Range {
const { startLineNumber, startColumn, endLineNumber, endColumn } = range;
return {
start: {
line: startLineNumber - 1,
character: startColumn - 1
},
end: {
line: endLineNumber - 1,
character: endColumn - 1
}
};
}

Creates a range with all values set to -1

const parentRange = Range.is(parent) ? parent : this.getFullRange(parent);

Uses vscode-languageserver-types Range.is

Which includes this check:

function uinteger(value) {
    return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
}

So check fails, leading to a call to

protected getFullRange(documentSymbol: monaco.languages.DocumentSymbol): Range {
return this.asRange(documentSymbol.range);
}

Which passes undefined back into

protected asRange(range: monaco.IRange): Range {
const { startLineNumber, startColumn, endLineNumber, endColumn } = range;
return {
start: {
line: startLineNumber - 1,
character: startColumn - 1
},
end: {
line: endLineNumber - 1,
character: endColumn - 1
}
};
}

Leading to

image

Steps to Reproduce:

  1. Open a file that has multiple language servers serving it, each able to provide outline data.

This seems to be necessary for the procedure that checks for parents to examine the 'root' nodes.

  1. Look in the dev tools.
  2. See errors about trying to destructure undefined

Additional Information

  • Operating System: RHEL
  • Theia Version: 1.34.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugbugs found in the applicationmonacoissues related to monacooutlineissues related to the outline

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions