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

Problem with hyperref and `` '' #182

Open
sleepymalc opened this issue Dec 8, 2023 · 0 comments
Open

Problem with hyperref and `` '' #182

sleepymalc opened this issue Dec 8, 2023 · 0 comments

Comments

@sleepymalc
Copy link

sleepymalc commented Dec 8, 2023

I recently encountered a weird bug that is related to \hyperref[]{} and `` ''. Specifically, the snippet doesn't work in the math environment within the hyperref argument \hyperref[]{\(\)} and ``\(\)''. The scope inside \hyperref[]{\(\)}looks like this:
image
and the scope inside ``\(\)'' looks like this:
image

And my math context function is defined as

function math(context) {
    return  context.scopes.findLastIndex(s => s.includes("math")) > context.scopes.findLastIndex(s => s.startsWith("comment") || s.startsWith("meta.text.normal.tex"));
}

This isn't the case like a month ago, and I can't quite pinpoint the problem. Some related issues for such scope are jlelong/vscode-latex-basics#67 and jlelong/vscode-latex-basics#75. I manually checked the extension log, and found that there are some errors occurring:

2024-01-23 16:08:53.565 [error] TypeError: Cannot read properties of undefined (reading 'range')
    at HSnippetInstance.update (/Users/pbb/.vscode/extensions/draivin.hsnips-0.2.9/src/hsnippetInstance.ts:215:19)
    at f.value (/Users/pbb/.vscode/extensions/draivin.hsnips-0.2.9/src/extension.ts:184:26)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1972)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2188)
    at m.$acceptModelChanged (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:10094)
    at l.S (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:10829)
    at l.Q (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:10595)
    at l.M (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:9685)
    at l.L (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:8764)
    at f.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:7567)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:14039)
    at f.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:7903)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:14039)
    at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6183)
    at MessagePortMain.emit (node:events:513:28)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)

Hope this can be fixed soon @draivin .

@sleepymalc sleepymalc changed the title Problem with hyperref Problem with hyperref and `` '' Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant