Repository navigation
[DONE] 끝이 잘린 코드를 붙이면 Lab 과 Live Editor 가 코드가 끝나기 전에 끊겼다고 말한다 - #148
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ShmHaiHWZwMYMhgK7tJvDs
…author never typed Code cut inside a call reported "Unexpected token 'return'", and code missing its last } reported "Unexpected token ')'": the return compilePatternCode appends and the ) new Function closes with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ShmHaiHWZwMYMhgK7tJvDs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ShmHaiHWZwMYMhgK7tJvDs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ShmHaiHWZwMYMhgK7tJvDs
patternflow-bot
marked this pull request as ready for review
October 22, 2026 01:33
This was referenced Oct 22, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 22, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 22, 2026
Patternflow-lab#108 Patternflow-lab#109 Patternflow-lab#110 Patternflow-lab#111 Patternflow-lab#112 Patternflow-lab#113 Patternflow-lab#114 Patternflow-lab#115 Patternflow-lab#116 Patternflow-lab#117 Patternflow-lab#118 Patternflow-lab#119 Patternflow-lab#120 Patternflow-lab#121 Patternflow-lab#122 Patternflow-lab#123 Patternflow-lab#124 Patternflow-lab#125 Patternflow-lab#126 Patternflow-lab#127 Patternflow-lab#128 Patternflow-lab#130 Patternflow-lab#131 Patternflow-lab#132 Patternflow-lab#133 Patternflow-lab#134 Patternflow-lab#135 Patternflow-lab#136 Patternflow-lab#137 Patternflow-lab#138 Patternflow-lab#139 Patternflow-lab#140 Patternflow-lab#141 Patternflow-lab#142 Patternflow-lab#144 Patternflow-lab#145 Patternflow-lab#146 Patternflow-lab#147 Patternflow-lab#148 Patternflow-lab#149 Patternflow-lab#150 Patternflow-lab#151 Patternflow-lab#152 Patternflow-lab#153 Patternflow-lab#154 Patternflow-lab#155 Patternflow-lab#156 Patternflow-lab#157 Patternflow-lab#158 Patternflow-lab#159
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.
lsh / https://claude.ai/code/session_01ShmHaiHWZwMYMhgK7tJvDs
붙인 패턴 코드가 중간에 끊기면 Lab 의 Code 패널과 Live Editor 가 사용자가 쓰지도 않은 return 이나 ) 를 탓했어요. 이제는 닫히지 않은 괄호 수와 마지막 줄을 보여 주고 붙여 넣다 끊겼느냐고 물어요. 머지하면 AI 가 만든 코드를 반만 붙인 사람이 무엇이 빠졌는지 바로 알아요.
좋아지는 것: 잘린 코드를 붙이면 끊겼다고 말한다 — 없는 글자를 찾아 헤매지 않는다
할 일
lib/pattern/harness.ts고치기, 시험 더하기da9dcdf, 이미 들어 있음)edb13b3): Drift checks, Web CI 둘 다 success한 일
describePatternError(web/src/lib/pattern/harness.ts)가 문법 오류를 받으면 먼저 붙인 코드를 처음부터 끝까지 훑어요. 문자열, 주석, 템플릿, 정규식 안의 괄호는 세지 않아요. 끝에(,[,{, 템플릿의${, 닫히지 않은 따옴표나 백틱,/*가 남아 있으면 엔진의 글 대신 이렇게 말해요.가운데가 깨진 코드는 엔진의 글을 그대로 둬요. 닫는 괄호가 다른 여는 괄호를 만나거나 문자열이 줄을 넘어가면 끊긴 게 아니라 틀린 거라서예요. Lab(
PatternRuntime.loadCode)과 Live Editor(LedMatrixTexture.loadCode)가 둘 다 이 함수를 불러서 한 곳만 고쳤어요. 커뮤니티 카드가 쓰는public/pattern-sandbox.html은npm run build:sandbox로 다시 만들었어요.시험은 새
web/src/lib/pattern/harness.test.ts열 개예요.LedMatrixTexture.test.ts의 「코드가 안 읽히는 동안 앞 패턴을 지킨다」 시험은/^Unexpected/를 기대하고 있었어요. 그 시험이 넣는 코드가 바로 끊긴 코드(display.setPixel(0, 0,)라서 새 글을 기대하게 바꿨어요.증거
고치기 전 dev 에서 넷을 붙여 본 글이에요.
고친 뒤예요. 가운데가 깨진 두 줄은 그대로예요.
새 시험을 dev 의
harness.ts에 돌리면 끊긴 코드 시험 여섯과 Live Editor 시험 하나, 일곱이 빨개요.web/에서 다섯 검사의 끝줄이에요.빌드한 사이트에 끊긴 코드를 붙인 화면이에요. Lab 은 Paste 단추로, Live Editor 는 편집기에 Ctrl+V 로 붙였어요.
실행법
cd web npx vitest run src/lib/pattern/harness.test.ts npm run dev/pattern-lab의 Code 패널이나/pattern의 편집기에 패턴 코드를 반쯤 잘라 붙이면 편집기 위(Lab)나 아래(Live Editor)에 위 글이 떠요.가정
/가 정규식인지 나눗셈인지는 앞 글자로 가려요.x++ / 2같은 드문 꼴은 정규식으로 잘못 읽어요. 이 검사는 이미 문법 오류가 난 코드에서만 돌고, 잘못 읽어 짝이 안 맞으면 엔진의 글로 돌아가요.harness.ts의 옛:413주석)은 이 줄의 고칠 곳이 아니라 그대로예요.cdn.jsdelivr.net을 403 으로 막아서 Monaco 가 「Loading…」에 멈췄어요. 사진 스크립트에서만 그 주소를node_modules/monaco-editor/min/(같은 0.55.1)으로 돌렸어요. 사이트는 그대로예요.window.prompt글이 영어 쪽인데 한국어예요(app/pattern-lab/panels/CodePanel.tsx:94).Changelog
Web
}reported "Unexpected token ')'", tokens the author never typed. The message now counts the brackets that never close and quotes the last line.경험
언제: 바퀴에서 Pattern Lab 이나 Live Editor 의 Monaco 편집기를 빌드한 사이트로 찍을 때
교훈:
@monaco-editor/react는cdn.jsdelivr.net에서 편집기를 받는데 컨테이너 프록시가 막으니, Playwrightcontext.route로 그 주소를web/node_modules/monaco-editor/min/의 같은 판 파일로 돌려준다근거: #148 에서
curl이 「CONNECT tunnel failed, response 403」을 냈고 Lab Code 패널과 Live Editor 가 「Loading…」에 멈췄는데, 0.55.1 파일로 돌리자 두 편집기가 떠서 붙여 넣기까지 찍혔다바퀴
바퀴 49 · 후보 5 「끝이 잘린 코드를 붙이면 Lab 과 Live Editor 가 코드가 끝나기 전에 끊겼다고 말한다」
다음 바퀴
http://를 붙여 넣어도 「Send over Wi-Fi」 링크가 그 보드로 간다」. 붙여 넣은http://192.168.0.44에선 링크의 호스트가http가 돼요.https://claude.ai/code/session_01ShmHaiHWZwMYMhgK7tJvDs
Generated by Claude Code