You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让Mac上VSCode集成终端的Option+Click支持Elixir堆栈追踪跳转

VSCode集成终端中Elixir堆栈追踪跳转失效的解决方案

问题描述

在Mac的VSCode集成终端中,尝试通过Option+Click跳转到Elixir堆栈追踪中的文件时,会选中包含括号的内容(比如(ecto 3.10.2) lib/ecto/queryable.ex),导致跳转失效。此前尝试调整以下设置未解决问题:

"terminal.integrated.wordSeparators": " ()[]{}',\"`─‘’|",

示例堆栈追踪:

stacktrace:
       (ecto 3.10.2) lib/ecto/queryable.ex:40: Ecto.Queryable.Atom.to_query/1
       (ecto 3.10.2) lib/ecto/query/builder/from.ex:155: Ecto.Query.Builder.From.apply/5
       (jump 0.1.0) lib/jump/integration_references/schema.ex:41: Jump.IntegrationReference.permissions_query/2
       (jump 0.1.0) lib/jump/users/permissions.ex:71: Jump.Permissions.permissions_query_for_resource/2
       (jump 0.1.0) lib/jump/users/permissions.ex:81: Jump.Permissions.permissions/2
       (jump 0.1.0) lib/jump/users/permissions.ex:38: anonymous fn/3 in Jump.Permissions.map/2
       (elixir 1.15.0) lib/enum.ex:2510: Enum"-reduce/3-lists^foldl/2-0-"/3
       (jump 0.1.0) lib/jump/users/permissions.ex:34: Jump.Permissions.map/2
       (jump 0.1.0) lib/jump_web/middleware/check_authorized.ex:17: Jump.Middleware.CheckAuthorized.call/2
       (absinthe 1.7.4) lib/absinthe/phase/document/execution/resolution.ex:234: Absinthe.Phase.Document.Execution.Resolution.reduce_resolution/1
       (absinthe 1.7.4) lib/absinthe/phase/document/execution/resolution.ex:189: Absinthe.Phase.Document.Execution.Resolution.do_resolve_field/3
       (absinthe 1.7.4) lib/absinthe/phase/document/execution/resolution.ex:174: Absinthe.Phase.Document.Execution.Resolution.do_resolve_fields/6
       (absinthe 1.7.4) lib/absinthe/phase/document/execution/resolution.ex:145: Absinthe.Phase.Document.Execution.Resolution.resolve_fields/4
       (absinthe 1.7.4) lib/absinthe/phase/document/execution/resolution.ex:88: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
       (absinthe 1.7.4) lib/absinthe/phase/document/execution/resolution.ex:67: Absinthe.Phase.Document.Execution.Resolution.perform_resolution/3
       (absinthe 1.7.4) lib/absinthe/phase/document/execution/resolution.ex:24: Absinthe.Phase.Document.Execution.Resolution.resolve_current/3
       (absinthe 1.7.4) lib/absinthe/pipeline.ex:408: Absinthe.Pipeline.run_phase/3
       (absinthe_plug 1.5.8) lib/absinthe/plug.ex:536: Absinthe.Plug.run_query/4
       (absinthe_plug 1.5.8) lib/absinthe/plug.ex:290: Absinthe.Plug.call/2
       (phoenix 1.7.7) lib/phoenix/router/route.ex:42: Phoenix.Router.Route.call/2

可行解决方案

  • 调整终端单词分隔符
    将括号从分隔符列表中移除,让VSCode能正确识别路径部分。修改设置为:

    "terminal.integrated.wordSeparators": "[]{}',\"`─‘’|",
    

    移除(和)后,终端不会将括号作为单词分隔符,Option+Click时会精准选中lib/ecto/queryable.ex:40这类路径,而非包含括号的整段内容。

  • 确认文件链接检测功能开启
    检查VSCode是否启用了终端文件链接识别,确保以下设置为true:

    "terminal.integrated.enableFileLinks": true,
    

    该设置默认开启,若被意外关闭,重新开启后能提升终端对文件路径的识别能力。

  • 自定义堆栈追踪输出格式(可选)
    如果上述方法仍有问题,可以通过Elixir的日志配置自定义堆栈追踪格式,将包信息(如(ecto 3.10.2))与文件路径分开输出,让路径部分独立呈现,进一步降低VSCode识别路径的难度。

内容的提问来源于stack exchange,提问作者atomkirk

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 07:05:56