Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MonacoOutlineContribution creates broken Range #12304

Closed
colin-grant-work opened this issue Mar 14, 2023 · 0 comments · Fixed by #12306
Closed

MonacoOutlineContribution creates broken Range #12304

colin-grant-work opened this issue Mar 14, 2023 · 0 comments · Fixed by #12306
Labels
bug bugs found in the application monaco issues related to monaco outline issues related to the outline

Comments

@colin-grant-work
Copy link
Contributor

colin-grant-work commented Mar 14, 2023

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
@colin-grant-work colin-grant-work added bug bugs found in the application outline issues related to the outline monaco issues related to monaco labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application monaco issues related to monaco outline issues related to the outline
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant