Skip to content

Commit

Permalink
plop malloy views in the main explorer, only show them if a .malloy f… (
Browse files Browse the repository at this point in the history
#705)

move malloy views in the main explorer, only show them if a .malloy file or a results tab is focused
  • Loading branch information
bporterfield authored Aug 8, 2022
1 parent 9c51d78 commit f876501
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ _Breaking changes indicated with *_

We will use this space to highlight major and/or breaking changes to Malloy.

## v0.2.x

### VS Code helper view windows relocated

To improve discoverability and reduce extra clicking around in VS Code, we've relocated the Help, Connections, and Schema View Windows into the Explorer View. They will only appear when a `.malloy` file is opened.

<img width="1365" alt="Screen Shot 2022-08-08 at 11 32 26 AM" src="https://user-images.githubusercontent.com/7178946/183488595-0c88591d-a162-4272-a937-e15261bf50c5.png">


## v0.0.10

### The apply operator is now ? and not :
Expand Down
24 changes: 9 additions & 15 deletions packages/malloy-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "malloydata",
"displayName": "Malloy",
"description": "Malloy is an experimental language for describing data relationships and transformations",
"version": "0.0.10",
"version": "0.2.0",
"engines": {
"vscode": "^1.63.0"
},
Expand Down Expand Up @@ -51,15 +51,6 @@
"url": "https://github.com/looker-open-source/malloy"
},
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "malloy",
"title": "Malloy",
"icon": "img/logo.png"
}
]
},
"commands": [
{
"command": "malloy.showLicenses",
Expand Down Expand Up @@ -175,19 +166,22 @@
}
],
"views": {
"malloy": [
"explorer": [
{
"id": "malloyHelp",
"name": "Help",
"type": "webview"
"name": "Malloy Help",
"type": "webview",
"when": "malloy.webviewPanelFocused == true || resourceFilename =~ /\\.malloy$/"
},
{
"id": "malloySchema",
"name": "Schema"
"name": "Malloy Schema",
"when": "malloy.webviewPanelFocused == true || resourceFilename =~ /\\.malloy$/"
},
{
"id": "malloyConnections",
"name": "Connections"
"name": "Malloy Connections",
"when": "malloy.webviewPanelFocused == true || resourceFilename =~ /\\.malloy$/"
}
]
},
Expand Down
11 changes: 11 additions & 0 deletions packages/malloy-vscode/src/extension/commands/run_query_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ export function runMalloyQuery(
{ viewColumn: vscode.ViewColumn.Beside, preserveFocus: true },
{ enableScripts: true, retainContextWhenHidden: true }
);

panel.onDidChangeViewState(
(e: vscode.WebviewPanelOnDidChangeViewStateEvent) => {
vscode.commands.executeCommand(
"setContext",
"malloy.webviewPanelFocused",
e.webviewPanel.active
);
}
);

current = {
panel,
messages: new WebviewMessageManager(panel),
Expand Down

0 comments on commit f876501

Please sign in to comment.