Skip to content

Find references, and let extensions observe debugging - #79

Merged
Seungpyo1007 merged 1 commit into
developfrom
feature/references-and-debug-api
Aug 10, 2026
Merged

Find references, and let extensions observe debugging#79
Seungpyo1007 merged 1 commit into
developfrom
feature/references-and-debug-api

Conversation

@Seungpyo1007

Copy link
Copy Markdown
Member

Two items: the last entry in the 0.4.0 plan §7, and part of track C-3 from the 0.3.0 plan.

find_references

The plan said to check whether the worker exposes references at all, since getNavigateToItems turned out not to exist. It does — getReferencesAtPosition works and returns both the definition and the call sites.

The tool takes a name, locates the definition through the existing symbol search, and asks for references at that position. When a name is defined in several places it says so and asks to narrow with path rather than picking one — guessing here would send the model off to the wrong thing.

Measured on a small project: verifyToken → definition at auth.ts:3 plus the call at app.ts:4; TokenVault → 3 sites including the import and the construction.

vscode.debug, the observing half

Extensions had no way to know whether a debug session was running. This adds what most of them actually use:

  • activeDebugSession, onDidStartDebugSession, onDidTerminateDebugSession, onDidChangeActiveDebugSession
  • breakpoints, onDidChangeBreakpoints, addBreakpoints, removeBreakpoints

All of it is wired to state the app already keeps, so nothing is invented.

registerDebugAdapterDescriptorFactory — an extension providing its own debugger — is still absent, and so are custom editors. Both remain absent from the API object rather than stubbed, so calling one is a TypeError instead of a silent no-op.

A bug made and caught here

The breakpoint an extension adds was keyed by uri.path, which is an absolute path. The count went up and the shim reported it, but the gutter drew nothing — the entry pointed at a key the editor never looks up. Resolved through uriToRel now. The probe caught it by checking the red dot rather than trusting the extension's own count.

Verification

Real app, 5/5: no session reports no session; the breakpoint list reads; a breakpoint added by an extension lands in the app's own state, fires the change event, and draws in the editor gutter.

Symbol references verified separately against a fresh TypeScript project.

1102 unit tests passing. npm run typecheck and npm run build clean.

TS 워커가 getReferencesAtPosition 은 내준다. getNavigateToItems 는 안 내주길래
이것도 없을 줄 알았는데 확인해보니 됨. 이름으로 정의를 잡고 그 자리에서 참조를
묻는다. 이름이 여러 군데 정의돼 있으면 어디를 뜻하는지 되묻고, path 로 좁힐 수
있게 함.

확장 쪽은 vscode.debug 중 관찰과 중단점까지. activeDebugSession,
onDidStartDebugSession / onDidTerminate / onDidChangeBreakpoints,
breakpoints, addBreakpoints / removeBreakpoints. 앱이 이미 들고 있는 상태를
연결한 것.

registerDebugAdapterDescriptorFactory(확장이 디버거를 제공하는 것)와 커스텀
에디터는 아직 없음. 없는 채로 둬서 부르면 TypeError 가 나게 함.

중간에 만든 버그 하나: 확장이 넣은 중단점 키를 uri.path 로 잡아서 절대 경로가
들어갔다. 개수만 늘고 거터에는 아무것도 안 그려짐. uriToRel 로 고침.
@Seungpyo1007 Seungpyo1007 added this to the v0.3 (2026-09-30) milestone Aug 10, 2026
@Seungpyo1007 Seungpyo1007 added the enhancement New feature or request label Aug 10, 2026
@Seungpyo1007 Seungpyo1007 self-assigned this Aug 10, 2026
@Seungpyo1007
Seungpyo1007 merged commit 5af1369 into develop Aug 10, 2026
1 check passed
@Seungpyo1007
Seungpyo1007 deleted the feature/references-and-debug-api branch August 10, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant