Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6decdec

Browse files
mizchiclaude
andcommitted
refactor: improve tool usability and documentation
- Remove redundant find_file tool (functionality covered by list_dir and glob)- Update search_symbols output to recommend get_symbol_details for comprehensive information- Restructure documentation to emphasize workflow: get_project_overview → search_symbols → get_symbol_details- Add "When to Use Each Tool" sections for better guidance- Sync sample workflows between CLAUDE.md and README.md- Add concrete workflow examples for common scenarios (exploration, debugging, refactoring, new features)- Remove implementation-focused PRIMARY TOOLS section in favor of usage-focused guidanceBREAKING CHANGE: find_file tool has been removed. Use list_dir or glob patterns instead.🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
1 parent3d90913 commit6decdec

17 files changed

+524
-609
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
created:2025-08-16T16:23:18.179Z
3+
updated:2025-08-16T16:23:18.179Z
4+
---
5+
6+
#Code Style and Conventions
7+
8+
##TypeScript Conventions
9+
-**File Naming**: lowerCamelCase (e.g.,`symbolIndex.ts`,`lspClient.ts`)
10+
-**Import Extensions**: Always add`.ts` extension to imports for Deno compatibility
11+
- Example:`import { foo } from "./bar.ts"`
12+
-**Type Definitions**: Prefer`interface` over`type` for object definitions
13+
-**Async Code**: Use`async/await` over raw promises
14+
-**Strict Mode**: TypeScript strict mode is enabled
15+
-`noImplicitAny: true`
16+
-`noUnusedLocals: true`
17+
-`noUnusedParameters: true`
18+
19+
##Code Formatting (Biome)
20+
-**Indent Style**: Spaces
21+
-**Indent Width**: 2 spaces
22+
-**Quote Style**: Double quotes for JavaScript/TypeScript strings
23+
-**Semicolons**: Required
24+
-**Trailing Commas**: Preferred for multi-line structures
25+
26+
##Documentation Language
27+
-**IMPORTANT**: All documentation, comments, and code should be in English
28+
- This includes:
29+
- Code comments
30+
- Documentation files (README, TODO, etc.)
31+
- Commit messages
32+
- Variable and function names
33+
- Error messages and logs
34+
35+
##Module System
36+
- ES Modules (type: "module" in package.json)
37+
- Use named exports for better tree-shaking
38+
- Default exports are acceptable for main entry points
39+
40+
##Testing Conventions
41+
- Test files named with`.test.ts` suffix
42+
- Unit tests in`tests/unit/`
43+
- Integration tests in`tests/integration/`
44+
- Language-specific tests in`tests/languages/`
45+
46+
##Error Handling
47+
- Use`neverthrow` for functional error handling where appropriate
48+
- Provide descriptive error messages
49+
- Log errors appropriately for debugging
50+
51+
##LSP/MCP Specific
52+
- Tool names use snake_case (e.g.,`get_hover`,`find_references`)
53+
- MCP tools may be prefixed by client (e.g.,`mcp__lsmcp__get_hover`)
54+
- Symbol kinds follow LSP specification numbers
55+
56+
##Git Conventions
57+
- Conventional commits format:`type(scope): description`
58+
- Types:`feat`,`fix`,`docs`,`chore`,`test`,`refactor`,`perf`
59+
- Branch naming:`fix/issue-name` or`feat/feature-name`
60+
- Target main branch for pull requests
61+
62+
##Configuration Files
63+
-`.lsmcp/config.json` - LSP/MCP configuration
64+
-`tsconfig.json` - TypeScript configuration
65+
-`biome.json` - Formatter configuration
66+
-`vitest.config.ts` - Test configuration
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
created:2025-08-16T16:23:53.319Z
3+
updated:2025-08-16T16:23:53.319Z
4+
---
5+
6+
#lsmcp Configuration and Indexing
7+
8+
##Main Configuration (.lsmcp/config.json)
9+
```json
10+
{
11+
"files": ["**/*.ts","**/*.tsx"],
12+
"symbolFilter": {
13+
"excludeKinds": ["Variable","Constant","String","Number","Boolean"]
14+
}
15+
}
16+
```
17+
18+
This configuration:
19+
- Indexes TypeScript and TSX files
20+
- Excludes certain symbol kinds from the project overview to reduce noise
21+
- Note: TypeScript LSP reports module-level const/let as Properties, not Variables
22+
23+
##Available Presets
24+
-`tsgo` - TypeScript with tsgo (recommended for TypeScript projects)
25+
-`typescript` - Standard typescript-language-server
26+
-`rust-analyzer` - Rust language support
27+
-`moonbit` - MoonBit language
28+
-`fsharp` - F# with fsautocomplete
29+
-`deno` - Deno TypeScript/JavaScript
30+
-`gopls` - Go official language server
31+
-`hls` - Haskell Language Server
32+
-`ocaml` - OCaml Language Server
33+
34+
##Symbol Indexing System
35+
The indexing system provides fast symbol search across the codebase:
36+
37+
###Tools that use pre-built index (fast):
38+
-`search_symbols` - Primary symbol search tool
39+
-`search_symbol_from_index` - Direct index search
40+
-`get_index_stats_from_index` - Index statistics
41+
-`update_index_from_index` - Incremental index updates
42+
43+
###Index Management:
44+
- Auto-indexing enabled by default (`autoIndex: true`)
45+
- Concurrent indexing with 10 workers (`indexConcurrency: 10`)
46+
- Index automatically updates with git changes
47+
- Use`noCache: true` to force full re-index
48+
- SQLite cache for persistence across sessions
49+
50+
###Symbol Kinds (LSP specification):
51+
1. File
52+
2. Module
53+
3. Namespace
54+
4. Package
55+
5. Class
56+
6. Method
57+
7. Property
58+
8. Field
59+
9. Constructor
60+
10. Enum
61+
11. Interface
62+
12. Function
63+
13. Variable (often reported as Property by TypeScript)
64+
14. Constant (often reported as Property by TypeScript)
65+
15. String
66+
16. Number
67+
17. Boolean
68+
18. Array
69+
19. Object
70+
20. Key
71+
21. Null
72+
22. EnumMember
73+
23. Struct
74+
24. Event
75+
25. Operator
76+
26. TypeParameter
77+
78+
##Tool Naming Conventions
79+
- Raw MCP tool names: snake_case (e.g.,`get_hover`)
80+
- Client-qualified names:`mcp__lsmcp__get_hover`
81+
- Tools ending in`_from_index` use the pre-built index for speed
82+
83+
##Performance Tips
84+
1. Use`search_symbols` for fast searching (uses index)
85+
2. Use`get_symbol_details` for comprehensive symbol info
86+
3. The index is automatically maintained - no manual updates needed
87+
4. For large codebases, initial indexing may take time but subsequent searches are fast
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
created:2025-08-16T16:22:42.833Z
3+
updated:2025-08-16T16:22:42.833Z
4+
---
5+
6+
#lsmcp Project Overview
7+
8+
##Purpose
9+
lsmcp (Language Service Protocol MCP) is a unified Model Context Protocol server that provides advanced code manipulation and analysis capabilities for multiple programming languages through Language Server Protocol integration.
10+
11+
##Tech Stack
12+
-**Language**: TypeScript (ES modules)
13+
-**Runtime**: Node.js
14+
-**Package Manager**: pnpm (9.15.0)
15+
-**Build Tool**: tsdown (Rolldown-based bundler)
16+
-**Testing**: Vitest (unit, integration, language tests)
17+
-**Linting**: oxlint
18+
-**Type Checking**: tsgo (TypeScript Go-based checker)
19+
-**Formatting**: Biome
20+
-**Core Dependencies**:
21+
-@modelcontextprotocol/sdk - MCP implementation
22+
- vscode-languageserver-protocol - LSP client implementation
23+
- zod - Schema validation
24+
25+
##Project Structure
26+
```
27+
lsmcp/
28+
├── src/ # Main source code
29+
├── packages/ # Internal packages
30+
│ ├── code-indexer/ # Symbol indexing functionality
31+
│ ├── lsp-client/ # LSP client implementation
32+
│ └── types/ # Shared TypeScript types
33+
├── tests/ # Test files
34+
│ ├── unit/ # Unit tests
35+
│ ├── integration/ # Integration tests
36+
│ └── languages/ # Language-specific tests
37+
├── examples/ # Example projects for different languages
38+
│ ├── rust-project/ # Current working directory (Rust example)
39+
│ └── ... # Other language examples
40+
└── scripts/ # Build and utility scripts
41+
```
42+
43+
##Current Working Directory
44+
We are currently in`/home/mizchi/mizchi/lsmcp/examples/rust-project/` which is a Rust example project demonstrating how to use lsmcp with rust-analyzer.
45+
46+
###Rust Project Structure
47+
```
48+
rust-project/
49+
├── src/
50+
│ ├── main.rs # Main entry point
51+
│ ├── lib.rs # Library with Calculator struct and greet function
52+
│ ├── errors.rs # File with intentional errors for testing
53+
│ └── test_diagnostics.rs # Various diagnostic test cases
54+
├── Cargo.toml # Rust project configuration
55+
└── README.md # Usage documentation
56+
```
57+
58+
##Version
59+
- lsmcp: v0.10.0-rc.3
60+
- TypeScript/Native: 7.0.0-dev
61+
- Node.js environment on Linux
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
created:2025-08-16T16:22:59.010Z
3+
updated:2025-08-16T16:22:59.010Z
4+
---
5+
6+
#Suggested Commands for lsmcp Development
7+
8+
##Build and Development
9+
-`pnpm build` - Build the project (required before running integration tests)
10+
-`pnpm watch` - Watch mode for development
11+
-`pnpm generate-schema` - Generate JSON schema for configuration
12+
13+
##Testing
14+
-`pnpm test` - Run all unit and integration tests
15+
-`pnpm test:unit` - Run unit tests only
16+
-`pnpm test:integration` - Run integration tests (requires build first)
17+
-`pnpm test:languages` - Run language-specific tests (local only)
18+
-`pnpm test:languages:rust` - Test Rust language support specifically
19+
-`pnpm test:watch` - Run tests in watch mode
20+
-`pnpm coverage` - Generate test coverage report
21+
22+
##Code Quality
23+
-`pnpm typecheck` - Type check with tsgo (fast TypeScript checker)
24+
-`pnpm typecheck:tsc` - Type check with native TypeScript compiler
25+
-`pnpm lint` - Run oxlint in quiet mode
26+
-`pnpm lint:refactor` - Run oxlint with detailed output
27+
-`pnpm format` - Format code with Biome
28+
-`pnpm format:check` - Check formatting without changing files
29+
30+
##Rust-specific (for examples/rust-project)
31+
-`cargo build` - Build the Rust project
32+
-`cargo check` - Check for compilation errors
33+
-`cargo test` - Run Rust tests
34+
-`cargo fmt` - Format Rust code
35+
-`cargo clippy` - Run Rust linter
36+
37+
##Git and Version Control
38+
- Use conventional commits:`feat:`,`fix:`,`docs:`,`chore:`, etc.
39+
-`pnpm changelog` - Generate changelog from commits
40+
-`git` - Standard git commands available
41+
42+
##System Utilities
43+
-`ls` - List directory contents
44+
-`cd` - Change directory
45+
-`rg` (ripgrep) - Fast text search (preferred over grep)
46+
-`find` - Find files and directories
47+
48+
##MCP Server
49+
-`npx @mizchi/lsmcp -p tsgo` - Run lsmcp with tsgo preset
50+
-`npx @mizchi/lsmcp --bin "rust-analyzer"` - Run with rust-analyzer
51+
52+
##Important Notes
53+
- Always run`pnpm build` before integration tests
54+
- Use`rg` instead of`grep` for searching
55+
- The project uses strict TypeScript mode
56+
- Tests may fail if timeouts are insufficient - DO NOT modify timeouts without permission
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
created:2025-08-16T16:23:31.971Z
3+
updated:2025-08-16T16:23:31.971Z
4+
---
5+
6+
#Task Completion Checklist
7+
8+
When completing any coding task in the lsmcp project, ensure you:
9+
10+
##1. Code Quality Checks
11+
-[ ] Run`pnpm typecheck` to ensure no TypeScript errors
12+
-[ ] Run`pnpm lint` to check for linting issues
13+
-[ ] Run`pnpm format` to ensure consistent formatting
14+
15+
##2. Testing
16+
-[ ] Run`pnpm test:unit` for unit tests
17+
-[ ] Run`pnpm build` before integration tests
18+
-[ ] Run`pnpm test:integration` if changes affect MCP/LSP functionality
19+
-[ ] Run specific language tests if modifying language adapters
20+
- For Rust:`pnpm test:languages:rust`
21+
- For TypeScript:`pnpm test:languages:tsgo`
22+
- For F#:`pnpm test:languages:fsharp`
23+
24+
##3. Documentation
25+
-[ ] Update relevant documentation if API changes
26+
-[ ] Ensure all new functions have proper TypeScript types
27+
-[ ] Add code comments in English for complex logic
28+
29+
##4. Before Committing
30+
-[ ] Verify all tests pass
31+
-[ ] Check that build succeeds with`pnpm build`
32+
-[ ] Review changes with`git diff`
33+
-[ ] Use conventional commit format
34+
35+
##Important Reminders
36+
-**NEVER** modify test timeouts without permission
37+
- Always use`rg` (ripgrep) instead of`grep` for searching
38+
- Build before running integration tests
39+
- Use English for all documentation and comments
40+
- Follow lowerCamelCase for file naming
41+
- Add`.ts` extension to imports
42+
43+
##For Rust Example Project
44+
When working in`examples/rust-project/`:
45+
-[ ] Run`cargo check` to verify compilation
46+
-[ ] Run`cargo fmt` to format Rust code
47+
-[ ] Run`cargo clippy` for linting
48+
-[ ] Run`cargo test` for Rust tests

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp