Skip to content

Commit ea6168c

Browse files
authored
Onboarding improvements (#88)
* Fix findWorkspaceFolder Previously this could yield surprising results depending on where the original vscode windows was opened from. * Disable cache by default (factory setting) This will require users opt-in to the feature. * Bump to 1.8.0 * Bump bzl to 1.3.3 * Update CHANGELOG * Improve view activation Also better onboarding notes
1 parent e3af2e8 commit ea6168c

File tree

5 files changed

+38
-22
lines changed

5 files changed

+38
-22
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 1.8.0 (Dev 01 2021)
4+
5+
- Improve authentication from bzl.io.
6+
- Enable advanced LSP features (via bump bzl 1.3.3).
7+
- Disable remote cache by default (requires opt-in enable flag).
8+
- Fix findWorkspaceFolder.
9+
310
## 1.7.0 (Nov 27 2021)
411

512
- Bump bzl to 1.2.14 (windows path fixes)

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bazel-stack-vscode",
33
"displayName": "bazel-stack-vscode",
44
"description": "Bazel Support for Visual Studio Code",
5-
"version": "1.7.0",
5+
"version": "1.8.0",
66
"publisher": "StackBuild",
77
"license": "Apache-2.0",
88
"icon": "stackb-full.png",
@@ -234,7 +234,7 @@
234234
},
235235
"bsv.bzl.server.release": {
236236
"type": "string",
237-
"default": "v1.2.14",
237+
"default": "v1.3.3",
238238
"description": "Bzl release version"
239239
},
240240
"bsv.bzl.server.command": {
@@ -337,7 +337,7 @@
337337
"bsv.bzl.remoteCache.enabled": {
338338
"type": "boolean",
339339
"description": "If false, disable the Remote Cache component",
340-
"default": true
340+
"default": false
341341
},
342342
"bsv.bzl.remoteCache.autoLaunch": {
343343
"type": "boolean",
@@ -659,10 +659,9 @@
659659
"bazel-explorer": [
660660
{
661661
"id": "bsv.workspace",
662-
"name": "Stack VSCode v1.7.0",
662+
"name": "Stack VSCode v1.8.0",
663663
"icon": "media/bazel-wireframe.svg",
664-
"contextualTitle": "Current Bazel Workspace",
665-
"when": "resourceLangId == bazel"
664+
"contextualTitle": "Current Bazel Workspace"
666665
}
667666
]
668667
},
@@ -821,4 +820,4 @@
821820
"tabWidth": 2,
822821
"arrowParens": "avoid"
823822
}
824-
}
823+
}

src/bezel/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export class BzlSettings extends Settings<BzlConfiguration> {
253253
enabled: config.get<boolean>('enabled', true),
254254
autoLaunch: config.get<boolean>('autoLaunch', true),
255255
downloadBaseURL: config.get<string>('downloadBaseUrl', 'https://get.bzl.io'),
256-
release: config.get<string>('release', 'v1.2.14'),
256+
release: config.get<string>('release', 'v1.3.3'),
257257
executable: normalize(config.get<string>('executable', '')),
258258
address: address,
259259
command: config.get<string[]>('command', ['serve', '--address=${address}']),

src/bezel/feature.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ import { Buildozer } from '../buildozer/buildozer';
3737

3838
export const BzlFeatureName = 'bsv.bzl';
3939

40-
function findWorkspaceFolder(): vscode.Uri | undefined {
40+
function findWorkspaceFolder(cwd: string): vscode.Uri | undefined {
4141
const workspace = findUp.sync(['WORKSPACE', 'WORKSPACE.bazel'], {
42+
cwd: cwd,
4243
});
4344
if (workspace) {
4445
return vscode.Uri.file(path.dirname(workspace));
@@ -65,7 +66,11 @@ export class BzlFeature implements vscode.Disposable {
6566
private readonly invocations: Invocations | undefined;
6667

6768
constructor(private api: API, ctx: vscode.ExtensionContext, private configCtx: ConfigurationContext) {
68-
const workspaceFolder = findWorkspaceFolder();
69+
let cwd = "."
70+
if (vscode.workspace.workspaceFolders?.length) {
71+
cwd = vscode.workspace.workspaceFolders[0].uri.fsPath;
72+
}
73+
const workspaceFolder = findWorkspaceFolder(cwd);
6974

7075
// ======= Commands =========
7176

@@ -205,7 +210,7 @@ export class BzlFeature implements vscode.Disposable {
205210
async handleCommandSignIn(): Promise<void> {
206211
vscode.commands.executeCommand(
207212
BuiltInCommands.Open,
208-
vscode.Uri.parse('https://bzl.io/bezel/install')
213+
vscode.Uri.parse('https://bzl.io/@')
209214
);
210215
}
211216

src/bezel/workspaceView.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,6 @@ export abstract class RunnableComponentItem<T extends ComponentConfiguration>
248248
return items;
249249
}
250250

251-
if (this.component.status === Status.DISABLED) {
252-
items.push(new DisabledItem(this.component.statusErrorMessage || 'Unknown'));
253-
return items;
254-
}
255-
256251
return items.concat(await this.getChildrenInternal());
257252
}
258253

@@ -391,10 +386,20 @@ class SubscriptionItem
391386
const items: vscode.TreeItem[] = [];
392387

393388
if (this.component.status === Status.DISABLED) {
394-
items.push(new DisabledItem('The subscription token is not set. Login to get started.'));
389+
items.push(new DisabledItem('Subscription token not available.'));
390+
items.push(
391+
new MarkdownItem(
392+
"Sign up to enable additional hover documentation, autocompletion, and other features."
393+
)
394+
);
395+
items.push(
396+
new MarkdownItem(
397+
"Using this at work? Encourage your employer to support developer productivity."
398+
)
399+
);
395400
items.push(
396401
new MarkdownItem(
397-
"Your support assists in improving the Bazel Ecosystem. If you're using this at work, please encourage your employer to contribute. If unsatisfied for any reason send an email to hello@stack.build and we'll take care of it :)"
402+
"Contact hello@stack.build for organizational onboarding."
398403
)
399404
);
400405
items.push(
@@ -404,7 +409,7 @@ class SubscriptionItem
404409
[
405410
'### Subscription Token',
406411
'',
407-
'The subscription token is a JWT that has your subscription details encoded inside. When the extension loads it tries to find it on one of the following locations:',
412+
'The subscription token is a JWT that encodes your subscription details. The extension will search the following locations for the token:',
408413
'',
409414
'1. The setting `bsv.bzl.subscription.token`',
410415
'2. The file `~/.bzl/license.key`.',
@@ -435,7 +440,7 @@ class SubscriptionItem
435440
`${license.subscriptionName}`,
436441
'Name of the subscription you are registered under'
437442
),
438-
new LicenseItem('Expiration', `${exp.toISODate()}`, 'Expiration date of this license')
443+
new LicenseItem('Renews', `${exp.toISODate()}`, 'Expiration date of this license')
439444
);
440445
}
441446
}
@@ -939,10 +944,10 @@ export class LicenseItem extends vscode.TreeItem {
939944

940945
export class MarkdownItem extends vscode.TreeItem {
941946
constructor(description: string, markdown?: vscode.MarkdownString) {
942-
super('Note');
947+
super('');
943948
this.description = description;
944949
this.tooltip = markdown || description;
945-
this.iconPath = new vscode.ThemeIcon('squirrel');
950+
this.iconPath = new vscode.ThemeIcon('debug-hint');
946951
}
947952
}
948953

0 commit comments

Comments
 (0)