Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>iris anchorNew to Visual Studio Code? Get it now.
iris anchor

iris anchor

CryzeZz

| (0) | Free
Maintain an anchor directory in your workspace: mark files or lines, organize them with tags, and view, jump to, and remove them from a tree in the Explorer sidebar.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

iris anchor

Maintain an anchor directory for the current workspace in VS Code: mark files or lines, then view, jump to, and remove them from a tree in the Explorer sidebar.

Anchors are stored per workspace (or opened folder) and persist across restarts. They live in VS Code workspace state, not in the project directory, so they are never committed to git.

在 VS Code 里维护当前工作区的锚点目录:给文件或某一行打锚点,在资源管理器侧边栏以树形结构集中查看、跳转与删除。

锚点按工作区(或打开的文件夹)隔离保存,重启后仍在;不写进项目目录,因此不会被提交到 git。


Adding anchors

Where How
File title bar Click the star in the editor title bar to anchor the whole file; click again (filled star) to remove.
A line Right-click a line and choose "Add Anchor at This Line", or press Ctrl+Alt+K (Cmd+Alt+K on macOS) to toggle.
Explorer Right-click a file or folder and choose "Add Anchor" — files get a file anchor, folders a directory anchor.
Command palette Run iris anchor: Add File Anchor / Add Anchor at This Line.

Adding anchors with a tag

Besides the default add, you can add an anchor with a tag/category to organize anchors:

  • Explorer right-click → Add Anchor with Tag.
  • The tag icon in the editor title bar → whole-file anchor with a tag.
  • Line right-click → Add Anchor at This Line with Tag.

These prompt you to pick an existing tag or type a new one. Adding with a tag to a location that is already anchored updates its tag.

Lines with a line anchor show a small blue anchor icon in the gutter.

Remote resources from InterSystems are also supported: with vscode-objectscript installed, classes (.cls) and routines in remote namespaces appear in the Explorer as isfs:// / isfs-readonly:// virtual files. Right-click "Add Anchor" works the same — files get file anchors, packages/folders get directory anchors, and line anchors work once opened. Remote anchors are recorded by URI and opened via openTextDocument, independent of local disk paths.

添加锚点

位置 操作
文件标题栏 点编辑器右上角的星标,给整个文件打锚点;再点一次(实心星)移除
某一行 在某行右键选择「在此行添加锚点」,或按 Ctrl+Alt+K(macOS Cmd+Alt+K)切换
资源管理器 在文件目录树里右键文件或目录,选择「添加锚点」——文件打文件锚点,目录打目录锚点
命令面板 Ctrl+Shift+P 执行 iris anchor: 添加文件锚点 / 在此行添加锚点

带标签添加锚点

除了默认添加,还可以「带标签(分类)」添加,方便按类别整理锚点:

  • 资源管理器右键文件/目录 → 添加锚点(带标签)
  • 编辑器标题栏的标签图标($(tag))→ 给整个文件打带标签锚点
  • 某行右键 → 在此行添加锚点(带标签)

点这些入口时会弹出选择框:选一个已有标签,或选「新建标签…」输入新标签名。给已存在锚点的位置带标签添加,会直接更新它的标签。

打了行锚点的行,行号左侧会出现一个蓝色小锚点图标。

也支持 InterSystems 插件映射的远程资源:装了 vscode-objectscript 后,远程命名空间里的类(.cls)、例程等会以 isfs:// / isfs-readonly:// 虚拟文件系统的形式出现在资源管理器里,对它们右键「添加锚点」同样有效——文件打文件锚点、包/目录打目录锚点、打开后还能打行锚点。远程锚点按 URI 记录,跳转走 openTextDocument,不依赖本地磁盘路径。


Viewing and removing

Expand the "Anchors" section at the bottom of the Explorer (the file sidebar) to list all anchors as a tree:

└─ src/
   ├─ ★ store.ts      2 lines        ← star = file anchor
   │   ├─ Line 12  export class AnchorStore {
   │   └─ Line 45  removeByFile(...)
   ├─ ★ utils         dir anchor     ← star = directory anchor
   │   └─ ...
   └─ panel.ts
       └─ Line 3
  • Directory and file nodes collapse and expand; files are organized by directory, with line anchors nested under their file.
  • File/directory anchors show on the node itself: an anchored file or folder gets a star icon rather than a separate child row.
  • Click a file node to jump to its first anchor, or a line anchor to go to that exact line.
  • Line anchors show a snippet of the line content to help recognition (remote resources show the line number only, no live read).
  • Hover a node to reveal a delete icon: anchor nodes delete one anchor, file nodes delete all anchors of that file, folder nodes delete all anchors under the folder (including the folder anchor); right-click works too.
  • The "Clear All Anchors" button at the top removes every anchor.
  • Tagged anchors show a #tag suffix; the "Filter by Tag" button filters the tree by tag (or "All"), and a "Clear Tag Filter" button appears while a filter is active.

When you edit a file, line anchors below the edited region shift along with the change, so they don't drift after inserting or deleting lines.

查看与删除

在资源管理器(左侧文件侧边栏)底部展开「锚点」分区,直接以树形结构列出所有锚点:

└─ src/
   ├─ ★ store.ts      2 行        ← 星标表示该文件有文件锚点
   │   ├─ 第 12 行  export class AnchorStore {
   │   └─ 第 45 行  removeByFile(...)
   ├─ ★ utils         目录锚点      ← 星标表示该目录有目录锚点
   │   └─ ...
   └─ panel.ts
       └─ 第 3 行
  • 目录和文件节点可折叠展开;文件按目录层级组织,行锚点挂在文件下
  • 文件锚点 / 目录锚点直接体现在节点上:有锚点的文件或目录图标显示为星标,不单独占用一行
  • 点文件节点跳到该文件的第一个锚点,点某个行锚点直接定位到那一行
  • 行锚点条目右侧会显示该行的内容摘要,方便辨认(远程资源只显示行号,不实时读取)
  • 鼠标悬停节点出现删除图标:锚点删除单条、文件删除该文件全部锚点、目录删除该目录(含目录锚点)下全部锚点;也可右键选择
  • 树顶部「清空全部」按钮删除所有锚点
  • 带标签的锚点在节点上以 #标签 标出;树顶部「按标签过滤」按钮可只显示某个标签(或「全部」),过滤后顶部会出现「清除过滤」按钮

编辑文件时,改动位置之后的行锚点会跟着平移,不会因为插入或删除几行就错位。


Browsing folders

Hover a folder node and click the list icon to open the "Browse Folder" panel, which lists the folder's subfolders and files in a table:

  • Three columns — name, modified time, size — click headers to sort, and filter by name via the top input.
  • Click a folder to go deeper, click a file to open it in the editor; the "↑" button goes up one level.
  • Read-only browsing; no files are modified.

浏览目录

目录节点悬停时,右侧的列表图标可在主窗口打开「目录浏览」面板,以表格列出该目录下的子目录与文件:

  • 三列:名称、修改时间、大小,点表头排序,顶部输入框按名称过滤
  • 点目录进入下一层,点文件在编辑器中打开;左上角「↑」返回上一层
  • 只读浏览,不会改动任何文件

Keyboard shortcuts

Shortcut Action
Ctrl+Alt+K (Cmd+Alt+K on macOS) Toggle the current line anchor

快捷键

快捷键 作用
Ctrl+Alt+K(macOS Cmd+Alt+K) 添加/移除当前行锚点

Known limitations

  • Line numbers may be imprecise under complex edits inside the edited region (only anchors after the edit are guaranteed to shift).
  • Anchors live in VS Code workspace state and are not synced to other machines with the project files.

已知限制

  • 行锚点的行号在「改动区间内部」的复杂编辑下可能不完全精确(只有改动位置之后的锚点保证平移)。
  • 锚点存在 VS Code 的工作区状态里,不随项目文件同步到其他机器。
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft