Skip to content

Commit

Permalink
Experimental extensions to UI in VScode plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Apr 18, 2024
1 parent 38515b4 commit c0b6335
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"sourceMaps": true,
"request": "launch",
"type": "extensionHost"
},
Expand Down
26 changes: 25 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
},
{
"command": "linguafranca.buildAndRun",
"title": "Lingua Franca: Build and Run"
"title": "Lingua Franca: Build and Run",
"icon": "$(play)"
},
{
"command": "linguafranca.createNewFile",
Expand Down Expand Up @@ -104,6 +105,11 @@
"when": "resourceLangId == lflang",
"command": "klighd-vscode.diagram.open",
"group": "navigation"
},
{
"when": "resourceLangId == lflang",
"command": "linguafranca.buildAndRun",
"group": "navigation"
}
],
"editor/context": [
Expand All @@ -125,6 +131,24 @@
"command": "linguafranca.createNewFile"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "lf-lang",
"title": "Lingua Franca",
"icon": "$(flame)"
}
]
},
"views": {
"lf-lang": [
{
"type": "tree",
"id": "lf-lang-explorer",
"name": "Lingua Franca Explorer"
}
]
}
},
"devDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { legend, semanticTokensProvider } from './highlight';
import * as config from './config';
import { registerBuildCommands, registerNewFileCommand } from './build_commands';
import * as checkDependencies from './check_dependencies';
import { LFDataProvider } from './lfview/lf-data-provider';

let client: LanguageClient;
let socket: Socket
Expand Down Expand Up @@ -56,6 +57,10 @@ export async function activate(context: vscode.ExtensionContext) {

registerBuildCommands(context, client);
registerNewFileCommand(context);

const lfDataProvider = new LFDataProvider(client, context);
vscode.window.registerTreeDataProvider('lf-lang-explorer', lfDataProvider);
vscode.window.createTreeView('lf-lang-explorer', {treeDataProvider: lfDataProvider});
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./out",
"sourceMap": false,
"sourceMap": true,
"target": "esnext",
"rootDir": "./src",
},
Expand Down

0 comments on commit c0b6335

Please sign in to comment.