A simpler way to view django projects
renamed to django tree
8 files changed, +30 -30
+1-1CHANGELOG.md
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # Change Log |
| 2 | 2 | |
| 3 | -All notable changes to the "django-overview" extension will be documented in this file. | |
| 3 | +All notable changes to the "django-tree" extension will be documented in this file. | |
| 4 | 4 | |
| 5 | 5 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. |
| 6 | 6 |
+4-4README.md
| @@ -1,9 +1,9 @@ | ||
| 1 | -# django-overview README | |
| 1 | +# django-tree README | |
| 2 | 2 | |
| 3 | 3 | A way to see all the core components of installed apps on a django project. Map out the models, settings, serializers, and urls. |
| 4 | 4 | Click to go to them. |
| 5 | 5 | |
| 6 | -*Note: It relies on convential django convention. Ex: if your models are not in models.py, it won't see it.* | |
| 6 | +*Note: It relies on typical django convention. Ex: if your models are not in models.py, it won't see it.* | |
| 7 | 7 | |
| 8 | 8 | ## Features |
| 9 | 9 | |
| @@ -19,12 +19,12 @@ Click to go to them. | ||
| 19 | 19 | |
| 20 | 20 | ## Extension Settings |
| 21 | 21 | |
| 22 | -* `django-overview.projectDir`: Set the root for a django project instead of searching for it. | |
| 22 | +* `django-tree.projectDir`: Set the root for a django project instead of searching for it. | |
| 23 | 23 | |
| 24 | 24 | ## Known Issues |
| 25 | 25 | |
| 26 | 26 | ## Release Notes |
| 27 | 27 | |
| 28 | -### 1.0.0 | |
| 28 | +### 0.0.1 | |
| 29 | 29 | |
| 30 | 30 | Initial release of DjangoTree |
+2-2package-lock.json
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | { |
| 2 | - "name": "django-overview", | |
| 2 | + "name": "django-tree", | |
| 3 | 3 | "version": "0.0.1", |
| 4 | 4 | "lockfileVersion": 3, |
| 5 | 5 | "requires": true, |
| 6 | 6 | "packages": { |
| 7 | 7 | "": { |
| 8 | - "name": "django-overview", | |
| 8 | + "name": "django-tree", | |
| 9 | 9 | "version": "0.0.1", |
| 10 | 10 | "devDependencies": { |
| 11 | 11 | "@types/mocha": "^10.0.6", |
+13-13package.json
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | { |
| 2 | - "name": "django-overview", | |
| 3 | - "displayName": "django-overview", | |
| 2 | + "name": "django-tree", | |
| 3 | + "displayName": "django-tree", | |
| 4 | 4 | "description": "Shows the settings and models for the current django project", |
| 5 | 5 | "version": "0.0.1", |
| 6 | 6 | "engines": { |
| @@ -14,19 +14,19 @@ | ||
| 14 | 14 | "contributes": { |
| 15 | 15 | "commands": [ |
| 16 | 16 | { |
| 17 | - "django-overview.openFile": { | |
| 17 | + "django-tree.openFile": { | |
| 18 | 18 | "title": "Open File" |
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | ], |
| 22 | 22 | "configuration": { |
| 23 | - "title": "Django Overview", | |
| 23 | + "title": "DjangoTree", | |
| 24 | 24 | "properties": { |
| 25 | - "django-overview.projectDir": { | |
| 25 | + "django-tree.projectDir": { | |
| 26 | 26 | "type": "string", |
| 27 | 27 | "description": "The root path to a directory containing the manage.py file." |
| 28 | 28 | }, |
| 29 | - "django-overview.skipDirs": { | |
| 29 | + "django-tree.skipDirs": { | |
| 30 | 30 | "type": "array", |
| 31 | 31 | "description": "Directories to skip when searching for settings and models", |
| 32 | 32 | "default": [ |
| @@ -39,23 +39,23 @@ | ||
| 39 | 39 | "viewsContainers": { |
| 40 | 40 | "activitybar": [ |
| 41 | 41 | { |
| 42 | - "id": "django-overview", | |
| 43 | - "title": "Django Overview", | |
| 42 | + "id": "django-tree", | |
| 43 | + "title": "DjangoTree", | |
| 44 | 44 | "icon": "resources/django.svg" |
| 45 | 45 | } |
| 46 | 46 | ] |
| 47 | 47 | }, |
| 48 | 48 | "views": { |
| 49 | - "django-overview": [ | |
| 49 | + "django-tree": [ | |
| 50 | 50 | { |
| 51 | - "id": "django-overview.get-started", | |
| 51 | + "id": "django-tree.get-started", | |
| 52 | 52 | "name": "Get Started", |
| 53 | - "when": "!django-overview.projectDir" | |
| 53 | + "when": "!django-tree.projectDir" | |
| 54 | 54 | }, |
| 55 | 55 | { |
| 56 | - "id": "django-overview.project", | |
| 56 | + "id": "django-tree.project", | |
| 57 | 57 | "name": "Project", |
| 58 | - "when": "django-overview.projectDir" | |
| 58 | + "when": "django-tree.projectDir" | |
| 59 | 59 | } |
| 60 | 60 | ] |
| 61 | 61 | } |
+1-1src/commands.ts
| @@ -2,7 +2,7 @@ import * as vscode from "vscode"; | ||
| 2 | 2 | |
| 3 | 3 | export default [ |
| 4 | 4 | vscode.commands.registerCommand( |
| 5 | - "django-overview.openFile", | |
| 5 | + "django-tree.openFile", | |
| 6 | 6 | (location: string, index: number) => { |
| 7 | 7 | vscode.window |
| 8 | 8 | .showTextDocument(vscode.Uri.file(location)) |
+6-6src/context.ts
| @@ -7,7 +7,7 @@ import { djangoProjectUpdate } from "./events"; | ||
| 7 | 7 | export const setDjangoContext = async () => { |
| 8 | 8 | const workspaceFolders = vscode.workspace.workspaceFolders; |
| 9 | 9 | let dir = vscode.workspace |
| 10 | - .getConfiguration("django-overview") | |
| 10 | + .getConfiguration("django-tree") | |
| 11 | 11 | .get("projectDir") as string; |
| 12 | 12 | if (workspaceFolders && !dir) { |
| 13 | 13 | for (const folder of workspaceFolders) { |
| @@ -17,7 +17,7 @@ export const setDjangoContext = async () => { | ||
| 17 | 17 | if (isDjango || inDjango) { |
| 18 | 18 | vscode.commands.executeCommand( |
| 19 | 19 | "setContext", |
| 20 | - "django-overview.projectDir", | |
| 20 | + "django-tree.projectDir", | |
| 21 | 21 | dir |
| 22 | 22 | ); |
| 23 | 23 | } |
| @@ -25,7 +25,7 @@ export const setDjangoContext = async () => { | ||
| 25 | 25 | } else { |
| 26 | 26 | vscode.commands.executeCommand( |
| 27 | 27 | "setContext", |
| 28 | - "django-overview.projectDir", | |
| 28 | + "django-tree.projectDir", | |
| 29 | 29 | null |
| 30 | 30 | ); |
| 31 | 31 | } |
| @@ -34,7 +34,7 @@ export const setDjangoContext = async () => { | ||
| 34 | 34 | await project.read(); |
| 35 | 35 | vscode.commands.executeCommand( |
| 36 | 36 | "setContext", |
| 37 | - "django-overview.project", | |
| 37 | + "django-tree.project", | |
| 38 | 38 | project |
| 39 | 39 | ); |
| 40 | 40 | djangoProjectUpdate.fire(project); |
| @@ -62,9 +62,9 @@ const isInDjangoProject = async (dir: string): Promise<boolean> => { | ||
| 62 | 62 | }; |
| 63 | 63 | |
| 64 | 64 | export const getDjangoProjectDir = (): string | undefined => { |
| 65 | - return vscode.workspace.getConfiguration("django-overview").get("projectDir"); | |
| 65 | + return vscode.workspace.getConfiguration("django-tree").get("projectDir"); | |
| 66 | 66 | }; |
| 67 | 67 | |
| 68 | 68 | export const getSkipDirs = () => { |
| 69 | - return vscode.workspace.getConfiguration("django-overview").get("skipDirs"); | |
| 69 | + return vscode.workspace.getConfiguration("django-tree").get("skipDirs"); | |
| 70 | 70 | }; |
+1-1src/providers/index.ts
| @@ -5,7 +5,7 @@ export const projectDataProvider = new ProjectDataProvider(); | ||
| 5 | 5 | |
| 6 | 6 | export default [ |
| 7 | 7 | vscode.window.registerTreeDataProvider( |
| 8 | - "django-overview.project", | |
| 8 | + "django-tree.project", | |
| 9 | 9 | projectDataProvider |
| 10 | 10 | ), |
| 11 | 11 | ]; |
+2-2src/providers/project.ts
| @@ -75,7 +75,7 @@ export default class ProjectDataProvider | ||
| 75 | 75 | treeItem.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed; |
| 76 | 76 | treeItem.iconPath = new vscode.ThemeIcon("symbol-class"); |
| 77 | 77 | treeItem.command = { |
| 78 | - command: "django-overview.openFile", | |
| 78 | + command: "django-tree.openFile", | |
| 79 | 79 | title: "Open File", |
| 80 | 80 | arguments: [model.filename, model.index], |
| 81 | 81 | tooltip: `Go to ${model.name}`, |
| @@ -89,7 +89,7 @@ export default class ProjectDataProvider | ||
| 89 | 89 | treeItem.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed; |
| 90 | 90 | treeItem.iconPath = new vscode.ThemeIcon("database"); |
| 91 | 91 | treeItem.command = { |
| 92 | - command: "django-overview.openFile", | |
| 92 | + command: "django-tree.openFile", | |
| 93 | 93 | title: "Open File", |
| 94 | 94 | arguments: [`${app.path}/models.py`, 0], |
| 95 | 95 | tooltip: "Open models.py", |