Skip to content

Commit

Permalink
User interface redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
vinzbarbuto committed Oct 3, 2024
1 parent e6bdce4 commit 9295b1e
Show file tree
Hide file tree
Showing 5 changed files with 513 additions and 307 deletions.
120 changes: 55 additions & 65 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@
}
}
],
"colors": [
{
"id": "editorIcon.currentProject",
"description": "Color for a TreeIteem label",
"defaults": {
"dark": "#57cc99",
"light": "#57cc99"
}
},
{
"id": "editorIcon.notCurrentProject",
"description": "Color for a TreeIteem label",
"defaults": {
"dark": "#fcbf49",
"light": "#fcbf49"
}
}
],
"semanticTokenScopes": [
{
"scopes": {
Expand Down Expand Up @@ -100,54 +118,44 @@
"title": "Refresh Tree View",
"icon": "$(refresh)"
},
{
"command": "linguafranca.refreshLibraryEntries",
"title": "Refresh Tree View",
"icon": "$(refresh)"
},
{
"command": "linguafranca.goToFile",
"title": "Go To Selected File",
"icon": "$(go-to-file)"
},
{
"command": "linguafranca.goToLibraryFile",
"title": "Go To Selected File",
"icon": "$(go-to-file)"
},
{
"command": "linguafranca.importReactor",
"title": "Import Selected Reactor",
"icon": "$(insert)"
},
{
"command": "linguafranca.importLibraryReactor",
"title": "Import Selected Reactor",
"icon": "$(insert)"
},
{
"command": "linguafranca.openInSplitView",
"title": "Open in Split View",
"icon": "$(split-horizontal)"
},
{
"command": "linguafranca.openLibraryInSplitView",
"title": "Open in Split View",
"icon": "$(split-horizontal)"
},
{
"command": "linguafranca.collapseAll",
"title": "Collapse All",
"icon": "$(collapse-all)"
},
{
"command": "linguafranca.collapseAllLibrary",
"title": "Collapse All",
"icon": "$(collapse-all)"
},
{
"command": "linguafranca.getVersion",
"title": "Lingua Franca: Get Version"
},
{
"command": "linguafranca.includeProject",
"title": "Include in current project",
"icon": "$(desktop-download)"
},
{
"command": "linguafranca.goToLingoToml",
"title": "Go to Lingo.toml",
"icon": "$(edit)"
},
{
"command": "linguafranca.openInTerminal",
"title": "Open in Terminal",
"icon": "$(terminal)"
}

],
Expand Down Expand Up @@ -208,84 +216,66 @@
{
"command": "linguafranca.refreshEntries",
"group": "navigation@1",
"when": "view == lf-lang-local"
},
{
"command": "linguafranca.refreshLibraryEntries",
"group": "navigation@1",
"when": "view == lf-lang-library"
"when": "view == lf-lang-projects"
},
{
"command": "linguafranca.collapseAll",
"group": "navigation@2",
"when": "view == lf-lang-local"
},
{
"command": "linguafranca.collapseAllLibrary",
"group": "navigation@2",
"when": "view == lf-lang-library"
"when": "view == lf-lang-projects"
}

],
"view/item/context" : [
{
"command": "linguafranca.goToFile",
"group": "inline",
"when": "view == lf-lang-local && viewItem != root"
"command": "linguafranca.openInTerminal",
"group": "inline@1",
"when": "viewItem == project"
},
{
"command": "linguafranca.goToLibraryFile",
"group": "inline",
"when": "view == lf-lang-library && viewItem != root"
},
{
"command": "linguafranca.openInSplitView",
"group": "inline",
"when": "view == lf-lang-local && viewItem == file"
"command": "linguafranca.includeProject",
"group": "inline@1",
"when": "viewItem == root || viewItem == file-local"
},
{
"command": "linguafranca.openLibraryInSplitView",
"group": "inline",
"when": "view == lf-lang-library && viewItem == file"
"command": "linguafranca.goToFile",
"group": "inline@2",
"when": "viewItem == file-local || viewItem == file-lingo || viewItem == file-local-included || viewItem == reactor || viewItem == reactor-included"
},
{
"command": "linguafranca.openInSplitView",
"when": "view == lf-lang-local && viewItem == reactor"
"group": "inline@3",
"when": "viewItem == file-local || viewItem == file-lingo || viewItem == file-local-included"
},
{
"command": "linguafranca.openLibraryInSplitView",
"when": "view == lf-lang-library && viewItem == reactor"
"command": "linguafranca.openInSplitView",
"when": "viewItem == reactor || viewItem == reactor-included"
},
{
"command": "linguafranca.importReactor",
"group": "inline",
"when": "view == lf-lang-local && viewItem == reactor"
"group": "inline@3",
"when": "viewItem == reactor-included"
},
{
"command": "linguafranca.importLibraryReactor",
"command": "linguafranca.goToLingoToml",
"group": "inline",
"when": "view == lf-lang-library && viewItem == reactor"
"when": "viewItem == lingo"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "lf-lang",
"title": "Lingua Franca Package Explorer",
"title": "Lingua Franca Projects",
"icon": "images/logo/lf-logo-dark.svg"
}
]
},
"views": {
"lf-lang": [
{
"id": "lf-lang-local",
"name": "Local Libraries"
},
{
"id": "lf-lang-library",
"name": "Lingo Libraries"
"id": "lf-lang-projects",
"name": ""
}
]
}
Expand Down
62 changes: 26 additions & 36 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ import { registerBuildCommands, registerNewFileCommand } from './build_commands'
import * as checkDependencies from './check_dependencies';
import { LFDataProvider, LFDataProviderNode, LFDataProviderNodeType} from './lfview/lf-data-provider';
import { registerCollapseAllCommand,
registerCollapseAllLibraryCommand,
registerGoToFileCommand,
registerGoToLibraryFileCommand,
registerGoToLingoTomlCommand,
registerImportReactorCommand,
registerImportLibraryReactorCommand,
registerIncludeProjectCommand,
registerOpenInSplitViewCommand,
registerOpenLibraryInSplitViewCommand,
registerRefreshCommand,
registerRefreshLibraryCommand } from './lfview/lf-data-provider-commands';
registerOpenInTerminalCommand,
registerRefreshCommand} from './lfview/lf-data-provider-commands';
import * as extensionVersion from './extension_version';

let client: LanguageClient;
Expand Down Expand Up @@ -81,47 +79,39 @@ export async function activate(context: vscode.ExtensionContext) {
registerNewFileCommand(context);

// Registers a tree data provider and creates a tree view for the 'lf-lang-local' view
const lfDataProviderLocal = new LFDataProvider(LFDataProviderNodeType.LOCAL, client, context);
context.subscriptions.push(vscode.window.registerTreeDataProvider('lf-lang-local', lfDataProviderLocal));
const localTreeView = vscode.window.createTreeView('lf-lang-local', { treeDataProvider: lfDataProviderLocal });
context.subscriptions.push(localTreeView);
localTreeView.onDidExpandElement(element => {
lfDataProviderLocal.onExpandEvent(element.element);
const lfDataProvider = new LFDataProvider(client, context);
context.subscriptions.push(vscode.window.registerTreeDataProvider('lf-lang-projects', lfDataProvider));
const projectsTreeView = vscode.window.createTreeView('lf-lang-projects', { treeDataProvider: lfDataProvider });
context.subscriptions.push(projectsTreeView);
projectsTreeView.onDidExpandElement(element => {
lfDataProvider.onExpandEvent(element.element);
});
localTreeView.onDidCollapseElement(element => {
lfDataProviderLocal.onCollapseEvent(element.element);
projectsTreeView.onDidCollapseElement(element => {
lfDataProvider.onCollapseEvent(element.element);
});

// Registers a tree data provider and creates a tree view for the 'lf-lang-library' view
const lfDataProviderLibrary = new LFDataProvider(LFDataProviderNodeType.LIBRARY, client, context);
context.subscriptions.push(vscode.window.registerTreeDataProvider('lf-lang-library', lfDataProviderLibrary));
const libraryTreeView = vscode.window.createTreeView('lf-lang-library', { treeDataProvider: lfDataProviderLibrary });
context.subscriptions.push(libraryTreeView);
libraryTreeView.onDidExpandElement(element => {
lfDataProviderLibrary.onExpandEvent(element.element);
});
libraryTreeView.onDidCollapseElement(element => {
lfDataProviderLibrary.onCollapseEvent(element.element);
});

// Register all the commands
registerRefreshCommand(context, lfDataProviderLocal);
registerRefreshLibraryCommand(context, lfDataProviderLibrary);
registerGoToFileCommand(context, lfDataProviderLocal);
registerGoToLibraryFileCommand(context, lfDataProviderLibrary);
registerOpenInSplitViewCommand(context, lfDataProviderLocal);
registerOpenLibraryInSplitViewCommand(context, lfDataProviderLibrary);
registerImportReactorCommand(context, lfDataProviderLocal);
registerImportLibraryReactorCommand(context, lfDataProviderLibrary);
// // Register all the commands
registerRefreshCommand(context, lfDataProvider);
registerGoToFileCommand(context, lfDataProvider);
registerOpenInSplitViewCommand(context, lfDataProvider);
registerImportReactorCommand(context, lfDataProvider);
registerCollapseAllCommand(context);
registerCollapseAllLibraryCommand(context);
registerGoToLingoTomlCommand(context, lfDataProvider);
registerIncludeProjectCommand(context, lfDataProvider);
registerOpenInTerminalCommand(context);

context.subscriptions.push(vscode.commands.registerCommand(
"linguafranca.checkDocker", checkDependencies.checkDocker
));
context.subscriptions.push(vscode.commands.registerCommand(
"linguafranca.getVersion", () => extensionVersion.version
));

vscode.window.onDidChangeActiveTextEditor( editor => {
if (editor){
lfDataProvider.onChangeActiveEditor();
}
})
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/extension_version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';
// This is a generated file. Do not edit.
export const version = "2e65200594b16d40b836b81aed3a244a488df151";
export const version = "0aa241b1a6750887e50c4ae04a1a4b74826a7f31";
Loading

0 comments on commit 9295b1e

Please sign in to comment.