Skip to content

Give extensions the browser and clipboard back, and correct the README - #69

Merged
Seungpyo1007 merged 1 commit into
developfrom
fix/ext-env-openexternal-clipboard
Aug 6, 2026
Merged

Give extensions the browser and clipboard back, and correct the README#69
Seungpyo1007 merged 1 commit into
developfrom
fix/ext-env-openexternal-clipboard

Conversation

@Seungpyo1007

Copy link
Copy Markdown
Member

First item on track C of the 0.3.0 plan. It started as a README correction and turned out to be two one-line fixes plus a README correction.

What the README claimed

Each of those throws rather than returning an empty value, so an extension that needs one fails loudly instead of quietly doing nothing.

Two of the three were right:

Gap Actual behaviour
WorkspaceEdit create/delete/rename throws (vscodeShim.ts:146-148) ✓
Custom editors, debug adapter API absent from the API object → TypeError
TextEditor decorations silent no-op

Two more the README never mentioned

openExternal: () => Promise.resolve(true),                     // opens nothing, reports success
clipboard: { writeText: () => Promise.resolve(),               // writes nowhere
             readText: () => Promise.resolve("") },            // always empty

openExternal reported success without calling schutz:openExternal — an IPC that has existed all along, complete with scheme validation. The clipboard stubs sat next to six working navigator.clipboard call sites in the app itself.

From an extension's side this reads as its own bug: it writes to the clipboard, reads it back, and finds it empty.

This change

  • env.openExternal goes through the real IPC. The main process only opens http/https/mailto, and a refusal is passed back rather than reported as success.
  • env.clipboard goes through navigator.clipboard.
  • Decorations need an implementation, so the README now names them as the one place left that answers successfully and draws nothing — better than asserting the opposite. Building it is the next item on this track.

Verification

npm run typecheck clean, 981 unit tests passing, npm run build succeeds.

No real-app probe on these two: driving them would open a browser window and overwrite the clipboard on the machine running the test. The wiring was checked by reading — the IPC exists and validates schemes, and the clipboard path is the one the app already uses. Running an extension through them belongs with the decoration work.

README 는 셰임에 남은 구멍들이 "빈 값을 돌려주는 대신 던진다" 고 적어 뒀다.
확인해 보니 셋 중 둘만 맞았다. WorkspaceEdit 는 정말 던지고, 커스텀 에디터와
디버그 어댑터는 API 객체에 아예 없어 TypeError 가 난다. 데코레이션은 아니다 —
createTextEditorDecorationType 이 멀쩡해 보이는 핸들을 주고 setDecorations 가
범위를 받아 놓고, 아무것도 그리지 않는다.

문서가 언급조차 안 한 자리가 둘 더 있었다. env 안이다.

  openExternal: () => Promise.resolve(true),        // 아무것도 안 열고 true
  clipboard: { writeText: () => Promise.resolve(),  // 어디에도 안 쓰고
               readText: () => Promise.resolve("") } // 늘 빈 문자열

openExternal 은 schutz:openExternal IPC 가 진작 있었는데도 부르지 않고 성공만
답했다. 클립보드는 앱 자신이 navigator.clipboard 를 여섯 군데서 쓰고 있다.
확장 입장에서는 "썼는데 비어 있다" 라 자기 버그로 보인다.

둘을 실제 경로에 연결한다. 메인이 http/https/mailto 만 열므로 거절도 그대로
전한다. 데코레이션은 구현이 따로 필요하므로 지금은 README 에 이름을 박아
둔다 — 이 저장소가 한 판을 통째로 들여 없앤 그 모양이 하나 남아 있다는 사실을,
아니라고 적어 두는 것보다는 낫다.

브라우저를 실제로 열고 클립보드를 덮어쓰는 일이라 실제 앱 프로브는 돌리지
않았다. 배선은 코드로 확인했다. typecheck·build 통과, 단위 981개 통과.
@Seungpyo1007 Seungpyo1007 added this to the v0.3 (2026-09-30) milestone Aug 6, 2026
@Seungpyo1007 Seungpyo1007 added the bug Something isn't working label Aug 6, 2026
@Seungpyo1007 Seungpyo1007 self-assigned this Aug 6, 2026
@Seungpyo1007
Seungpyo1007 merged commit 0a2dfeb into develop Aug 6, 2026
1 check passed
@Seungpyo1007
Seungpyo1007 deleted the fix/ext-env-openexternal-clipboard branch August 6, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant