Skip to content

Commit 22a053f

Browse files
authored
Merge pull request #30 from gparlakov/feat/support-multi-folder-workspace
feat(multi-folder-workspace): support them
2 parents dba62b2 + 2fec127 commit 22a053f

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to the "scuri-code" extension will be documented in this file.
44

55
## Versions
6+
## [1.4.0] - 2021-07-29
7+
8+
### Fixed
9+
- support multi-folder workspace
10+
11+
612
## [1.3.1] - 2021-06-14
713

814
### Fixed

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Scuri code is a VS Code [extension](https://marketplace.visualstudio.com/items?i
1313
- start a discussion in the [issues](https://github.com/gparlakov/scuri-code/issues)
1414
- fork the project [fork](https://github.com/gparlakov/scuri-code)
1515
- work in a branch `feature/my-awesome-feature-request`
16-
- open a PR and please add some tests for what you've experienced
16+
- open a PR and please add some tests for what you've experienced/corrected/added
1717

1818
## Testing
1919
Tests are using [mocha](https://mochajs.org/) and live inside `src/test` folder e.g. [src/test/path-with-spaces.test.ts](src/test/suite/path-with-spaces.test.ts)

src/extension.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,15 @@ function scuriCommand(
7878
const a = window.activeTextEditor;
7979
// tslint:disable-next-line:triple-equals
8080
if (a != null && workspace.getWorkspaceFolder(a.document.uri) != null) {
81-
const root = workspace.getWorkspaceFolder(a.document.uri);
81+
const root = workspace.getWorkspaceFolder(a.document.uri)!;
82+
8283
options = options || '';
8384
// need to add --debug false as the schematics engine assumes debug true when specifying the schematic by folder vs package name
8485
options += ' --debug false';
86+
8587
return command(
86-
workspace.asRelativePath(a.document.fileName),
87-
root!.uri.fsPath,
88+
workspace.asRelativePath(a.document.uri, false),
89+
root.uri.fsPath,
8890
channel,
8991
options,
9092
schematic
@@ -233,9 +235,7 @@ function installDeps(channel: OutputChannel, context?: ExtensionContext) {
233235
context.globalState.update(key_installing, true);
234236
}
235237

236-
channel.appendLine(
237-
'Start installing deps. Could take a couple of minutes'
238-
);
238+
channel.appendLine('Start installing deps. Could take a couple of minutes');
239239
channel.appendLine(`npm install scuri@latest @angular-devkit/schematics-cli@latest`);
240240

241241
const proc = c.exec(

src/test/suite/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function run(): Promise<void> {
66
// Create the mocha test
77
const mocha = new Mocha({
88
ui: 'tdd',
9-
timeout: 10000
9+
timeout: 60000 // downloading the new versions interminttently takes a lot of time
1010
});
1111
mocha.useColors(true);
1212

src/test/suite/show-errors-and-result.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as assert from 'assert';
22
import { suiteSetup, test } from 'mocha';
33
// You can import and use all API from the 'vscode' module
44
// as well as import your extension to test it
5-
import { Uri, workspace, commands, window } from 'vscode';
5+
import { workspace, commands, window } from 'vscode';
66
import { cleanUpFiles } from './util/clean-up-files';
77
const { executeCommand } = commands;
88

0 commit comments

Comments
 (0)