Give extensions the browser and clipboard back, and correct the README - #69
Merged
Merged
Conversation
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개 통과.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Two of the three were right:
WorkspaceEditcreate/delete/renamevscodeShim.ts:146-148) ✓TypeError✓TextEditordecorationsTwo more the README never mentioned
openExternalreported success without callingschutz:openExternal— an IPC that has existed all along, complete with scheme validation. The clipboard stubs sat next to six workingnavigator.clipboardcall 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.openExternalgoes through the real IPC. The main process only openshttp/https/mailto, and a refusal is passed back rather than reported as success.env.clipboardgoes throughnavigator.clipboard.Verification
npm run typecheckclean, 981 unit tests passing,npm run buildsucceeds.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.