Skip to content

Commit 563ca76

Browse files
committed
feat: redesign typing for more flexible
1 parent 296df63 commit 563ca76

36 files changed

+2766
-2425
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
codeme
2+
*_test.go

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ just test
108108
go run . stats
109109
```
110110

111+
### Debug from database
112+
```bash
113+
# Check if activities exist
114+
sqlite3 ~/.local/share/codeme/codeme.db "SELECT COUNT(*) FROM activities;"
115+
116+
# If > 0, check API output
117+
codeme api | jq '.this_week.total_time'
118+
119+
# If 0, use debug version
120+
# Replace bridge.go with debug_bridge artifact
121+
go build && ./codeme api 2>&1 | grep DEBUG
122+
```
123+
111124
### Integration with Editors
112125

113126
#### Neovim

core/detector.go

Lines changed: 171 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ import (
77
"strings"
88
)
99

10-
var langMap = map[string]string{
11-
"go": "Go", "js": "JavaScript", "ts": "TypeScript", "py": "Python",
12-
"rb": "Ruby", "java": "Java", "c": "C", "cpp": "C++", "cs": "C#",
13-
"rs": "Rust", "php": "PHP", "swift": "Swift", "kt": "Kotlin",
14-
"lua": "Lua", "vim": "Vim", "sh": "Shell", "bash": "Shell",
15-
"md": "Markdown", "json": "JSON", "yaml": "YAML", "toml": "TOML",
16-
"html": "HTML", "css": "CSS", "scss": "SCSS", "sql": "SQL",
17-
}
18-
1910
func DetectProject(filePath string) string {
2011
// Try git root first
2112
dir := filepath.Dir(filePath)
@@ -31,7 +22,7 @@ func DetectProject(filePath string) string {
3122
if len(parts) > 0 {
3223
return parts[len(parts)-1]
3324
}
34-
return "unknown"
25+
return "n/a"
3526
}
3627

3728
func DetectLanguage(filePath string) string {
@@ -51,3 +42,173 @@ func DetectBranch(filePath string) string {
5142
}
5243
return ""
5344
}
45+
46+
var langMap = map[string]string{
47+
"go": "Go",
48+
"js": "JavaScript",
49+
"ts": "TypeScript",
50+
"jsx": "JSX",
51+
"tsx": "TSX",
52+
"py": "Python",
53+
"rb": "Ruby",
54+
"java": "Java",
55+
"c": "C",
56+
"h": "C Header",
57+
"cpp": "C++",
58+
"hpp": "C++ Header",
59+
"cs": "C#",
60+
"rs": "Rust",
61+
"php": "PHP",
62+
"swift": "Swift",
63+
"kt": "Kotlin",
64+
"lua": "Lua",
65+
"vim": "Vim script",
66+
"sh": "Shell",
67+
"bash": "Bash",
68+
"zsh": "Zsh",
69+
"fish": "Fish",
70+
"md": "Markdown",
71+
"json": "JSON",
72+
"yaml": "YAML",
73+
"yml": "YAML",
74+
"toml": "TOML",
75+
"html": "HTML",
76+
"htm": "HTML",
77+
"css": "CSS",
78+
"scss": "SCSS",
79+
"sass": "Sass",
80+
"less": "Less",
81+
"sql": "SQL",
82+
"mysql": "MySQL",
83+
"psql": "PostgreSQL",
84+
"plsql": "PL/SQL",
85+
"jl": "Julia",
86+
"rkt": "Racket",
87+
"clj": "Clojure",
88+
"cljs": "ClojureScript",
89+
"scm": "Scheme",
90+
"lisp": "Lisp",
91+
"el": "Emacs Lisp",
92+
"erl": "Erlang",
93+
"ex": "Elixir",
94+
"exs": "Elixir",
95+
"hs": "Haskell",
96+
"nim": "Nim",
97+
"crystal": "Crystal",
98+
"scala": "Scala",
99+
"sbt": "SBT",
100+
"fs": "F#",
101+
"fsi": "F# Script",
102+
"ml": "OCaml",
103+
"mli": "OCaml Interface",
104+
"re": "Reason",
105+
"dart": "Dart",
106+
"flutter": "Flutter",
107+
"web": "WebAssembly",
108+
"wat": "WAT",
109+
"zig": "Zig",
110+
"v": "V",
111+
"odin": "Odin",
112+
"bun": "Bun",
113+
"deno": "Deno",
114+
"bunjs": "Bun JavaScript",
115+
"vue": "Vue",
116+
"svelte": "Svelte",
117+
"svelte-": "Svelte",
118+
"astro": "Astro",
119+
"solid": "SolidJS",
120+
"qml": "QML",
121+
"rsh": "ReScript",
122+
"res": "ReScript",
123+
"elm": "Elm",
124+
"purs": "PureScript",
125+
"gleam": "Gleam",
126+
"mojo": "Mojo",
127+
"vala": "Vala",
128+
"d": "D",
129+
"pas": "Pascal",
130+
"pascal": "Pascal",
131+
"ada": "Ada",
132+
"fortran": "Fortran",
133+
"77": "Fortran 77",
134+
"f90": "Fortran 90",
135+
"asm": "Assembly",
136+
"s": "Assembly",
137+
"nasm": "NASM",
138+
"objdump": "Object Dump",
139+
"bat": "Batch",
140+
"cmd": "CMD",
141+
"ps1": "PowerShell",
142+
"psm1": "PowerShell Module",
143+
"ahk": "AutoHotkey",
144+
"applescript": "AppleScript",
145+
"scpt": "AppleScript",
146+
"tex": "LaTeX",
147+
"latex": "LaTeX",
148+
"rnoweb": "Rnoweb",
149+
"rtex": "R TeX",
150+
"xml": "XML",
151+
"xhtml": "XHTML",
152+
"svg": "SVG",
153+
"graphql": "GraphQL",
154+
"gql": "GraphQL",
155+
"proto": "Protocol Buffers",
156+
"thrift": "Thrift",
157+
"capnp": "Cap'n Proto",
158+
"dockerfile": "Dockerfile",
159+
"docker": "Docker",
160+
"dockerignore": "Docker Ignore",
161+
"compose": "Docker Compose",
162+
"editorconfig": "EditorConfig",
163+
"gitignore": "Gitignore",
164+
"gitattributes": "Git Attributes",
165+
"prettierrc": "Prettier RC",
166+
"eslintrc": "ESLint RC",
167+
"tsconfig": "TSConfig",
168+
"jsconfig": "JSConfig",
169+
"package.json": "Package JSON",
170+
"package-lock.json": "Package Lock",
171+
"pnpm-lock.yaml": "PNPM Lock",
172+
"yarn.lock": "Yarn Lock",
173+
"cargotoml": "Cargo TOML",
174+
"cargo.lock": "Cargo Lock",
175+
"composer.json": "Composer JSON",
176+
"pubspec.yaml": "Pubspec YAML",
177+
"build.gradle": "Gradle",
178+
"gradle.properties": "Gradle Properties",
179+
"pom.xml": "Maven POM",
180+
"makefile": "Makefile",
181+
"make": "Makefile",
182+
"meson.build": "Meson",
183+
"cmake": "CMake",
184+
"ninja": "Ninja",
185+
"vcpkg.json": "VCPKG",
186+
"justfile": "Justfile",
187+
"taskfile.yml": "Taskfile",
188+
"wolfram": "Wolfram Language",
189+
"wl": "Wolfram Language",
190+
"mathematica": "Mathematica",
191+
"nb": "Mathematica Notebook",
192+
"ipynb": "Jupyter Notebook",
193+
"rmd": "R Markdown",
194+
"quarto": "Quarto",
195+
"org": "Org-mode",
196+
"rst": "reStructuredText",
197+
"adoc": "AsciiDoc",
198+
"txt": "Plain Text",
199+
"log": "Log File",
200+
"cfg": "Config",
201+
"conf": "Config",
202+
"ini": "INI",
203+
"env": ".env",
204+
"graphql.config.json": "GraphQL Config",
205+
"tailwind.config.js": "Tailwind Config",
206+
"next.config.js": "Next.js Config",
207+
"nuxt.config.ts": "Nuxt Config",
208+
"vite.config.ts": "Vite Config",
209+
"rollup.config.js": "Rollup Config",
210+
"webpack.config.js": "Webpack Config",
211+
"jest.config.js": "Jest Config",
212+
"cypress.config.ts": "Cypress Config",
213+
"playwright.config.ts": "Playwright Config",
214+
}

core/detector_test.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)