Skip to content

Commit 3fd71b5

Browse files
committed
[feature]: add config and improving extension naming
1 parent ddbb85c commit 3fd71b5

File tree

8 files changed

+166
-45
lines changed

8 files changed

+166
-45
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,17 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
66

77
## [Unreleased]
88

9-
- Initial release
9+
## [v0.2.0] - 2025-08-10
10+
11+
- Add search notes
12+
- Add change notes directory
13+
- Add keybindings
14+
- Add Icon
15+
16+
## [v0.1.0] - 2025-08-10
17+
18+
- Initial Release
19+
- Add note taking
20+
21+
[v0.2.0]: https://github.com/Kyonru/feather/compare/v0.1.0...v0.2.0
22+
[v0.1.0]: https://github.com/Kyonru/feather/releases/tag/v0.1.0

README.md

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Code Notes 📝
1+
# Codebase Notebook 📝
22

3-
Code Notes is a VS Code extension that lets you take structured notes across your codebase and quickly jump between code and the notes that describe it.
3+
Codebase Notebook is a VS Code extension that lets you take structured notes across your codebase and quickly jump between code and the notes that describe it.
44

55
## ✨ Features
66

@@ -36,9 +36,9 @@ Code Notes is a VS Code extension that lets you take structured notes across you
3636

3737
### 📸 UI Overview
3838

39-
> Screenshots coming soon
39+
![example](preview.gif)
4040

41-
- Activity Bar → Code Notes
41+
- Activity Bar → Codebase Notebook
4242

4343
- Sidebar tree listing all your notes
4444

@@ -62,23 +62,23 @@ Then press F5 to launch the extension dev host.
6262

6363
## 🎯 Core Commands
6464

65-
| Command | Description |
66-
| ---------------------------------- | ----------------------------------------------- |
67-
| `Code Notes: Create Note` | Create a new note |
68-
| `Code Notes: Select Note` | Switch the active note |
69-
| `Code Notes: Add Reference` | Attach a code reference to a note |
70-
| `Code Notes: Go to Reference` | Jump to referenced file + line |
71-
| `Code Notes: View Note` | Open preview of current note |
72-
| `Code Notes: Open Notes Directory` | Open storage folder for notes |
73-
| `Code Notes: Delete Note` | Remove note |
74-
| `Code Notes: Refresh Tree` | Reload notes list |
75-
| `Code Notes: Open Note from Tree` | Open by clicking tree item |
76-
| `Code Notes: View Note at` | View note related to current cursor (if exists) |
65+
| Command | Description |
66+
| ----------------------------------------- | ----------------------------------------------- |
67+
| `Codebase Notebook: Create Note` | Create a new note |
68+
| `Codebase Notebook: Select Note` | Switch the active note |
69+
| `Codebase Notebook: Add Reference` | Attach a code reference to a note |
70+
| `Codebase Notebook: Go to Reference` | Jump to referenced file + line |
71+
| `Codebase Notebook: View Note` | Open preview of current note |
72+
| `Codebase Notebook: Open Notes Directory` | Open storage folder for notes |
73+
| `Codebase Notebook: Delete Note` | Remove note |
74+
| `Codebase Notebook: Refresh Tree` | Reload notes list |
75+
| `Codebase Notebook: Open Note from Tree` | Open by clicking tree item |
76+
| `Codebase Notebook: View Note at` | View note related to current cursor (if exists) |
7777

7878
You’ll find most actions in:
7979

8080
- Command Palette (Cmd/Ctrl + Shift + P)
81-
- Code Notes sidebar
81+
- Codebase Notebook sidebar
8282
- Tree item right-click menus
8383

8484
## 🗂️ Where are notes stored?
@@ -87,18 +87,6 @@ Notes are stored locally in a Markdown directory (managed by the extension).
8787

8888
They’re human readable and version-control friendly.
8989

90-
## 🔧 Roadmap
91-
92-
Planned improvements include:
93-
94-
- Search & filtering
95-
96-
- Workspace-shared notes option
97-
98-
- Inline commenting UX
99-
100-
- Multiple notes per line
101-
10290
If you have ideas or feature requests, open an issue!
10391

10492
## ❤️ Sponsor

icon.png

32.1 KB
Loading

package.json

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
},
77
"description": "An extension to help taking note across the codebase",
88
"version": "0.1.0",
9+
"icon": "icon.png",
910
"publisher": "SolenodonteLabs",
1011
"engines": {
1112
"vscode": "^1.107.0"
@@ -30,11 +31,22 @@
3031
"activationEvents": [],
3132
"main": "./out/extension.js",
3233
"contributes": {
34+
"configuration": {
35+
"title": "Codebase Notebook",
36+
"properties": {
37+
"crosscodenotes.notesDirectory": {
38+
"type": "string",
39+
"default": "",
40+
"markdownDescription": "Custom directory for storing notes. Leave empty to use default. Supports `~` for home directory.",
41+
"scope": "application"
42+
}
43+
}
44+
},
3345
"viewsContainers": {
3446
"activitybar": [
3547
{
3648
"id": "crosscodenotes",
37-
"title": "Code Notes",
49+
"title": "Codebase Notebook",
3850
"icon": "$(notebook)"
3951
}
4052
]
@@ -50,54 +62,59 @@
5062
"commands": [
5163
{
5264
"command": "crosscodenotes.createNote",
53-
"title": "Code Notes: Create Note",
65+
"title": "Codebase Notebook: Create Note",
5466
"icon": "$(new-file)"
5567
},
5668
{
5769
"command": "crosscodenotes.selectNote",
58-
"title": "Code Notes: Select Note"
70+
"title": "Codebase Notebook: Select Note"
5971
},
6072
{
6173
"command": "crosscodenotes.addReference",
62-
"title": "Code Notes: Add Reference"
74+
"title": "Codebase Notebook: Add Reference"
6375
},
6476
{
6577
"command": "crosscodenotes.goToReference",
66-
"title": "Code Notes: Go to Reference"
78+
"title": "Codebase Notebook: Go to Reference"
6779
},
6880
{
6981
"command": "crosscodenotes.viewNote",
70-
"title": "Code Notes: View Note",
82+
"title": "Codebase Notebook: View Note",
7183
"icon": "$(open-preview)"
7284
},
7385
{
7486
"command": "crosscodenotes.openNotesDir",
75-
"title": "Code Notes: Open Notes Directory",
76-
"icon": "$(folder)"
87+
"title": "Codebase Notebook: Open Notes Directory",
88+
"icon": "$(folder-opened)"
7789
},
7890
{
7991
"command": "crosscodenotes.deleteNote",
80-
"title": "Code Notes: Delete Note",
92+
"title": "Codebase Notebook: Delete Note",
8193
"icon": "$(trash)"
8294
},
8395
{
8496
"command": "crosscodenotes.refreshTree",
85-
"title": "Code Notes: Refresh Tree",
97+
"title": "Codebase Notebook: Refresh Notes",
8698
"icon": "$(refresh)"
8799
},
88100
{
89101
"command": "crosscodenotes.openNoteFromTree",
90-
"title": "Code Notes: Open Note from Tree",
102+
"title": "Codebase Notebook: Open Note from Tree",
91103
"icon": "$(open-preview)"
92104
},
93105
{
94106
"command": "crosscodenotes.viewNoteAt",
95-
"title": "Code Notes: View Note at"
107+
"title": "Codebase Notebook: View Note at"
96108
},
97109
{
98110
"command": "crosscodenotes.searchNotes",
99-
"title": "Code Notes: Search Notes",
111+
"title": "Codebase Notebook: Search Notes",
100112
"icon": "$(search)"
113+
},
114+
{
115+
"command": "crosscodenotes.changeNotesDirectory",
116+
"title": "Codebase Notebook: Change Notes Directory",
117+
"icon": "$(settings)"
101118
}
102119
],
103120
"menus": {

preview.gif

1.71 MB
Loading

src/commands.ts

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import * as path from "path";
33
import * as fs from "fs";
44

55
import { NoteItem, NotesTreeProvider } from "./treeView";
6-
import { createCommandName, getNotesDir } from "./utils";
6+
import { createCommandName, getDefaultNotesDir, getNotesDir } from "./utils";
77
import { NotesCodeLensProvider } from "./codelens";
8+
import { EXTENSION_NAME } from "./constants";
89

910
export function gerRefreshTreeCommand(
1011
notesTreeProvider: NotesTreeProvider,
@@ -527,3 +528,85 @@ export function getSearchNotesCommand(context: vscode.ExtensionContext) {
527528
}
528529
);
529530
}
531+
532+
export function getChangeNotesDirectoryCommand(
533+
context: vscode.ExtensionContext
534+
) {
535+
return vscode.commands.registerCommand(
536+
createCommandName("changeNotesDirectory"),
537+
async () => {
538+
const options = await vscode.window.showQuickPick(
539+
[
540+
{
541+
label: "$(folder) Browse for Directory",
542+
description: "Choose a custom location",
543+
value: "browse",
544+
},
545+
{
546+
label: "$(home) Use Default Directory",
547+
description: getDefaultNotesDir(context),
548+
value: "default",
549+
},
550+
{
551+
label: "$(edit) Enter Path Manually",
552+
description: "Type a custom path",
553+
value: "manual",
554+
},
555+
],
556+
{
557+
placeHolder: "How would you like to set the notes directory?",
558+
}
559+
);
560+
561+
if (!options) {
562+
return;
563+
}
564+
565+
let newPath: string | undefined;
566+
567+
if (options.value === "browse") {
568+
const selected = await vscode.window.showOpenDialog({
569+
canSelectFiles: false,
570+
canSelectFolders: true,
571+
canSelectMany: false,
572+
openLabel: "Select Notes Directory",
573+
title: "Choose Notes Directory",
574+
});
575+
576+
if (selected && selected[0]) {
577+
newPath = selected[0].fsPath;
578+
}
579+
} else if (options.value === "default") {
580+
newPath = ""; // Empty string will use default
581+
} else if (options.value === "manual") {
582+
const NOTES_DIR = getNotesDir(context);
583+
const input = await vscode.window.showInputBox({
584+
prompt: "Enter notes directory path",
585+
placeHolder: "~/Documents/code-notes or /absolute/path",
586+
value: NOTES_DIR,
587+
validateInput: (value) => {
588+
if (!value || value.trim() === "") {
589+
return "Path cannot be empty";
590+
}
591+
return null;
592+
},
593+
});
594+
595+
if (input) {
596+
newPath = input;
597+
}
598+
}
599+
600+
if (newPath !== undefined) {
601+
const config = vscode.workspace.getConfiguration(EXTENSION_NAME);
602+
await config.update(
603+
"notesDirectory",
604+
newPath,
605+
vscode.ConfigurationTarget.Global
606+
);
607+
608+
await vscode.commands.executeCommand(createCommandName("refreshTree"));
609+
}
610+
}
611+
);
612+
}

src/extension.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
getViewNoteAtCommand,
1717
getViewNoteCommand,
1818
getSearchNotesCommand,
19+
getChangeNotesDirectoryCommand,
1920
} from "./commands";
2021
import { NoteReference } from "./types";
2122
import { initCodeLensProvider, NotesCodeLensProvider } from "./codelens";
@@ -76,6 +77,7 @@ export function activate(context: vscode.ExtensionContext) {
7677
const openNoteFromTree = getOpenNoteFromTreeCommand(context, updateStatusBar);
7778
const viewNoteAt = getViewNoteAtCommand();
7879
const searchNotes = getSearchNotesCommand(context);
80+
const changeNotesDirectory = getChangeNotesDirectoryCommand(context);
7981

8082
updateStatusBar();
8183

@@ -89,6 +91,7 @@ export function activate(context: vscode.ExtensionContext) {
8991
refreshTree,
9092
deleteNote,
9193
viewNoteAt,
94+
changeNotesDirectory,
9295
searchNotes,
9396
openNoteFromTree,
9497
treeView,

src/utils.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import * as vscode from "vscode";
2+
import * as path from "path";
3+
import * as os from "os";
4+
25
import { EXTENSION_NAME } from "./constants";
36

47
export const createCommandName = (name: string) => `${EXTENSION_NAME}.${name}`;
@@ -7,6 +10,20 @@ export function getLineFromOffset(content: string, offset: number): number {
710
return content.slice(0, offset).split(/\r?\n/).length;
811
}
912

10-
export function getNotesDir(context: vscode.ExtensionContext) {
13+
export function getNotesDir(context: vscode.ExtensionContext): string {
14+
const config = vscode.workspace.getConfiguration(EXTENSION_NAME);
15+
const customPath = config.get<string>("notesDirectory");
16+
17+
if (customPath && customPath.trim() !== "") {
18+
const expandedPath = customPath.startsWith("~")
19+
? path.join(os.homedir(), customPath.slice(1))
20+
: customPath;
21+
return path.resolve(expandedPath);
22+
}
23+
24+
return getDefaultNotesDir(context);
25+
}
26+
27+
export function getDefaultNotesDir(context: vscode.ExtensionContext) {
1128
return context.globalStorageUri.fsPath;
1229
}

0 commit comments

Comments
 (0)