Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 1.75 KB

File metadata and controls

70 lines (48 loc) · 1.75 KB

Contributing

Contributions of all kinds are welcome.

Getting Started

  1. Fork and clone: git clone https://github.com/semanticdata/pastepad.git
  2. Install dependencies: pnpm install
  3. Press F5 in VS Code to launch the Extension Development Host

Development

  • Source: src/
  • Tests: src/test/
  • Run tests: Test view or pnpm test
  • Lint: pnpm run lint
  • Build: pnpm run compile

Testing

Use suiteSetup/suiteTeardown for VS Code commands (can only be registered once), setup/teardown for other tests.

suite('Feature Tests', () => {
    let mockContext: any;

    suiteSetup(async () => {
        // One-time setup for the entire suite
        mockContext = { /* mock extension context */ };
    });

    setup(() => {
        // Reset state before each test
    });

    test('should do something', () => {
        // Test implementation
    });
});

Logging

Use LoggerService instead of console.log():

import { LoggerService } from './services';

const logger = LoggerService.getInstance();

logger.debug('Detailed info', { key: 'value' });  // Development only
logger.info('User operation');                    // Normal operations
logger.warn('Recoverable issue', { key });        // Warnings
logger.error('Failure occurred', { error });      // Errors

Logs appear in the Output panel under "PastePad". Set to "debug" in settings.json or launch.json for development.

Making Changes

  1. Branch: git checkout -b feature/your-feature
  2. Make changes and add tests
  3. Commit with a clear message
  4. Push and open a pull request

Follow existing patterns and update CHANGELOG.md for user-facing changes.

Questions

Open an issue or start a discussion.