Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addon_folders.ts: assign scheme to URIs created for mockups #147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,15 @@
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install"
"watch": "tsc -watch -p ./"
},
"devDependencies": {
"@types/mocha": "^2.2.42",
"@types/node": "^8.10.25",
"@types/request": "^2.48.1",
"@types/vscode": "^1.28.0",
"tslint": "^5.8.0",
"typescript": "^3.5.1",
"vscode": "^1.1.21"
"typescript": "^5.2.2"
},
"dependencies": {
"request": "^2.87.0"
Expand All @@ -249,4 +248,4 @@
"ms-python.python",
"ms-vscode.cpptools"
]
}
}
9 changes: 4 additions & 5 deletions src/addon_folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ export class AddonWorkspaceFolder {
// search workspace folders instead.
let addonFolders = await foldersToWorkspaceFoldersMockup(
<string[]>getConfig().get('addonFolders'));
if (addonFolders.length === 0) {
addonFolders = getWorkspaceFolders();
}

let searchableFolders = addonFolders.length !== 0 ? addonFolders : getWorkspaceFolders();

let folders = [];
for (let folder of addonFolders) {
for (let folder of searchableFolders) {
let addon = new AddonWorkspaceFolder(folder);
if (await addon.hasAddonEntryPoint()) {
folders.push(addon);
Expand Down Expand Up @@ -157,7 +156,7 @@ async function foldersToWorkspaceFoldersMockup(folders: string[]) {

mockups.push({
"name" : path.basename(absolutePath),
"uri": vscode.Uri.parse(absolutePath),
"uri": vscode.Uri.from({ scheme: "file", path: absolutePath }),
"index": i
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function handleErrors(func: () => Promise<void>) {
try {
await func();
}
catch (err) {
catch (err: any) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a drive-by typing change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the new typescript version didn't compile without it.

if (err.message !== CANCEL) {
vscode.window.showErrorMessage(err.message);
}
Expand Down