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

Commit52fa7f3

Browse files
committed
feat: add Go LSP configuration and code navigation documentation
Change-Id: I994c8ee8fa2c246808a9f68a86e83a6a3db6f8acSigned-off-by: Thomas Kosiewski <tk@coder.com>
1 parentf46d478 commit52fa7f3

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

‎.claude/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [],
4+
"deny": [
5+
"mcp__go-language-server__edit_file"
6+
]
7+
}
8+
}

‎.mcp.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"mcpServers": {
3+
"go-language-server": {
4+
"type":"stdio",
5+
"command":"go",
6+
"args": [
7+
"run",
8+
"github.com/isaacphi/mcp-language-server@latest",
9+
"-workspace",
10+
"./",
11+
"-lsp",
12+
"go",
13+
"--",
14+
"run",
15+
"golang.org/x/tools/gopls@latest"
16+
],
17+
"env": {}
18+
}
19+
}
20+
}

‎CLAUDE.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,50 @@ if errors.Is(err, errInvalidPKCE) {
270270
-Test both positive and negative cases
271271
-Use`testutil.WaitLong`for timeouts in tests
272272

273+
##CodeNavigation andInvestigation
274+
275+
###UsingGoLSPTools
276+
277+
When working with theCoder codebase, leverageGoLanguageServerProtocol toolsfor efficient code navigation:
278+
279+
1. **Find function definitions**:
280+
281+
```none
282+
mcp__go-language-server__definition symbolName
283+
```
284+
285+
-Example:`mcp__go-language-server__definition getOAuth2ProviderAppAuthorize`
286+
-Quickly jump to function implementations across packages
287+
288+
2. **Find symbol references**:
289+
290+
```none
291+
mcp__go-language-server__references symbolName
292+
```
293+
294+
-Locate all usages of functions, types, or variables
295+
-Understand code dependencies and call patterns
296+
297+
3. **Get symbol information**:
298+
299+
```none
300+
mcp__go-language-server__hover filePath line column
301+
```
302+
303+
-Gettype information and documentation at specific positions
304+
305+
4. **When to useLSP vs other tools**:
306+
- **UseLSPfor**:Following function calls, understandingpackage relationships, finding specific implementations
307+
- **UseGrepfor**:Text-based searches, finding patterns across files
308+
- **UseBashfor**:Simple file operations, running tests, git commands
309+
310+
###InvestigationStrategy
311+
312+
1. **Start with route registration** in`coderd/coderd.go` to understandAPI endpoints
313+
2. **UseLSP definition lookup** to trace from route handlers to actual implementations
314+
3. **Follow the middleware chain** to understand request processing flow
315+
4. **Check test files**for expected behavior anderror patterns
316+
273317
##TestingScripts
274318

275319
###OAuth2TestScripts

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp