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

fix: prevent Request textDocument/documentHighlight failed with message: Debug Failure. False expression. Code: -32603 error when selecting Javascript code in the embedded <script> tag #5975

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,11 @@ export const getJavascriptMode = (documentRegions: LanguageModelCache<HTMLDocume
findDocumentHighlight: (document: TextDocument, position: Position): DocumentHighlight[] => {
updateCurrentTextDocument(document);
const highlights = jsLanguageService.getDocumentHighlights(FILE_NAME, currentTextDocument.offsetAt(position), [
FILE_NAME,
document.uri
]);

if (highlights.length > 0) {
if (highlights?.length > 0) {
// Only one file to search above so there should only be one result
return highlights[0].highlightSpans.map(entry => {
return {
Expand Down
Loading