feat: add comprehensive tests and enhance CI [T-006]#4
feat: add comprehensive tests and enhance CI [T-006]#4SuperInstance wants to merge 2 commits intomainfrom
Conversation
| insertText: op.operands.length === 0 | ||
| ? op.mnemonic | ||
| : `${op.mnemonic} ${op.operands.filter(o => o.role !== '-').map(o => o.role === 'imm8' ? '${1:0}' : o.role === 'imm16' ? '${1:0}' : `$\{${op.role}\``).join(', ')}$0`, | ||
| : `${op.mnemonic} ${op.operands.filter(o => o.role !== '-').map(o => o.role === 'imm8' ? '${1:0}' : o.role === 'imm16' ? '${1:0}' : `$\{${o.role}\``).join(', ')}$0`, |
There was a problem hiding this comment.
🔴 Malformed snippet syntax in getOpcodeCompletionItems produces broken completion text
The new inline snippet generation at line 440 replaces the correct buildOpcodeSnippet call with a broken template literal. The expression `$\{${o.role}\ produces strings like `${rd\ instead of the correct VSCode snippet format ${1:rd}. This was confirmed by evaluating the code: for ADD (with operands rd, rs1, rs2), the new code generates "ADD ${rd\, ${rs1`, ${rs2`$0"instead of the correct"ADD ${1:rd}, ${2:rs1}, ${3:rs2}$0". The backtick replaces the closing }, and placeholder numbering is entirely missing. This breaks tab-stop navigation for all ~200+ opcodes with operands. The well-functioning buildOpcodeSnippethelper atsrc/opcode-database.ts:406-425` is now dead code.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
- Fix TypeScript compilation errors (Connection.log, CompletionList import, foldingRanges API, type narrowing issues) - Add Find References feature for label definitions and usages - Add comprehensive test suite (104 tests covering parser, diagnostics, opcode database, and server integration) - Add GitHub CI workflow with multi-node matrix - Add .gitignore and jest.config.js - Update capabilities: referencesProvider enabled, fix foldingRange API
f2740e1 to
619f075
Compare
|
Closing: superseded by merged work on main. The changes from this PR have been incorporated through other merged PRs. Thank you for the contribution! 🙏 |
Summary
Significantly expands test coverage from 104 tests → 216 tests (+108%) and enhances the CI workflow.
New Test Files
server-completion.test.tsparser-edge-cases.test.tsdiagnostics-edge-cases.test.tsTest Coverage Results
diagnostics.ts: 98.3% linesparser.ts: 99.2% linesopcode-database.ts: 85.7% linesserver.ts: 88.9% linesCI Enhancements
fail-fast: falsefor full matrix results--coverage --ci --forceExitflags for coverage reporting on every runcoverage/to.gitignoreLSP Features Tested
closes #T-006