forked from eclipse-theia/theia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes eclipse-theia#686 Signed-off-by: Marc Dumais <[email protected]>
- Loading branch information
1 parent
116222a
commit 0ea4773
Showing
28 changed files
with
1,695 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
// comment | ||
"tasks": [ | ||
{ | ||
"label": "workspace: failing task", | ||
"processType": "terminal", | ||
"processOptions": { | ||
"command": "/bin/false", | ||
"args": [] | ||
}, | ||
"windowsProcessOptions": { | ||
"command": "packages/task/src/node/test-resources/task.bat", | ||
"args": [ | ||
"foo" | ||
] | ||
}, | ||
"cwd": "$workspace", | ||
"errorMatcherName": "", | ||
"errorMatcherOptions": "" | ||
}, | ||
{ | ||
"label": "workspace: test task", | ||
"processType": "terminal", | ||
"processOptions": { | ||
"command": "packages/task/src/node/test-resources/task", | ||
"args": [ | ||
"foo" | ||
] | ||
}, | ||
"windowsProcessOptions": { | ||
"command": "packages/task/src/node/test-resources/task.bat", | ||
"args": [ | ||
"foo" | ||
] | ||
}, | ||
"cwd": "$workspace", | ||
"errorMatcherName": "", | ||
"errorMatcherOptions": "" | ||
}, | ||
{ | ||
"label": "workspace: list workspace", | ||
"processType": "terminal", | ||
"processOptions": { | ||
"command": "ls", | ||
"args": [ | ||
"-al" | ||
] | ||
}, | ||
"windowsProcessOptions": { | ||
"command": "dir", | ||
"args": [] | ||
}, | ||
"cwd": "$workspace", | ||
"errorMatcherName": "", | ||
"errorMatcherOptions": "" | ||
}, | ||
{ | ||
"label": "workspace: list all filez2", | ||
"processType": "terminal", | ||
"processOptions": { | ||
"command": "ls", | ||
"args": [ | ||
"-alR", | ||
"/" | ||
] | ||
}, | ||
"cwd": "$workspace", | ||
"errorMatcherName": "", | ||
"errorMatcherOptions": "" | ||
}, | ||
{ | ||
"label": "workspace: theia tsc watch in terminal", | ||
"processType": "terminal", | ||
"processOptions": { | ||
"command": "yarn", | ||
"args": [ | ||
"run", | ||
"watch" | ||
] | ||
}, | ||
"cwd": "$workspace", | ||
"errorMatcherName": "tsc", | ||
"errorMatcherOptions": "" | ||
}, | ||
{ | ||
"label": "workspace: theia tsc watch no terminal", | ||
"processType": "raw", | ||
"processOptions": { | ||
"command": "yarn", | ||
"args": [ | ||
"run", | ||
"watch" | ||
] | ||
}, | ||
"cwd": "$workspace", | ||
"errorMatcherName": "tsc", | ||
"errorMatcherOptions": "" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"private": true, | ||
"name": "@theia/example-electron", | ||
"version": "0.2.0", | ||
"theia": { | ||
"target": "electron" | ||
}, | ||
"dependencies": { | ||
<<<<<<< HEAD | ||
"@theia/core": "0.2.0", | ||
"@theia/cpp": "0.2.0", | ||
"@theia/editor": "0.2.0", | ||
"@theia/extension-manager": "0.2.0", | ||
"@theia/filesystem": "0.2.0", | ||
"@theia/git": "0.2.0", | ||
"@theia/go": "0.2.0", | ||
"@theia/java": "0.2.0", | ||
"@theia/languages": "0.2.0", | ||
"@theia/markers": "0.2.0", | ||
"@theia/monaco": "0.2.0", | ||
"@theia/navigator": "0.2.0", | ||
"@theia/preferences": "0.2.0", | ||
"@theia/process": "0.2.0", | ||
"@theia/python": "0.2.0", | ||
"@theia/terminal": "0.2.0", | ||
"@theia/typescript": "0.2.0", | ||
"@theia/workspace": "0.2.0" | ||
======= | ||
"@theia/core": "^0.1.1", | ||
"@theia/cpp": "^0.1.1", | ||
"@theia/editor": "^0.1.1", | ||
"@theia/extension-manager": "^0.1.1", | ||
"@theia/filesystem": "^0.1.1", | ||
"@theia/git": "^0.1.1", | ||
"@theia/go": "^0.1.1", | ||
"@theia/java": "^0.1.1", | ||
"@theia/languages": "^0.1.1", | ||
"@theia/markers": "^0.1.1", | ||
"@theia/monaco": "^0.1.1", | ||
"@theia/navigator": "^0.1.1", | ||
"@theia/preferences": "^0.1.1", | ||
"@theia/process": "^0.1.1", | ||
"@theia/python": "^0.1.1", | ||
"@theia/terminal": "^0.1.1", | ||
"@theia/typescript": "^0.1.1", | ||
"@theia/workspace": "^0.1.1", | ||
"@theia/task": "^0.1.1" | ||
>>>>>>> add task extension | ||
}, | ||
"scripts": { | ||
"prepare": "yarn run clean && yarn build", | ||
"clean": "theia clean", | ||
"build": "theia build", | ||
"watch": "yarn build --watch", | ||
"start": "theia start", | ||
"start:debug": "yarn start --loglevel=debug", | ||
"test": "electron-mocha --timeout 60000 --require ts-node/register \"./test/**/*.espec.ts\"", | ||
"test:ui": "wdio wdio.conf.js" | ||
}, | ||
"devDependencies": { | ||
"@theia/cli": "0.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../configs/base.tsconfig", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "lib" | ||
}, | ||
"include": [ | ||
"src" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "@theia/task", | ||
"version": "0.2.0", | ||
"description": "Theia - Task extension", | ||
"dependencies": { | ||
"@theia/core": "^0.2.0", | ||
"@theia/process": "^0.2.0", | ||
"@theia/terminal": "^0.2.0", | ||
"@theia/workspace": "^0.2.0", | ||
"@theia/markers": "^0.2.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"theiaExtensions": [ | ||
{ | ||
"frontend": "lib/browser/task-frontend-module", | ||
"backend": "lib/node/task-backend-module" | ||
} | ||
], | ||
"keywords": [ | ||
"theia-extension" | ||
], | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/theia-ide/theia.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/theia-ide/theia/issues" | ||
}, | ||
"homepage": "https://github.com/theia-ide/theia", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"scripts": { | ||
"prepare": "yarn run clean && yarn run build", | ||
"clean": "theiaext clean", | ||
"build": "theiaext build", | ||
"watch": "theiaext watch", | ||
"test": "theiaext test", | ||
"docs": "theiaext docs" | ||
}, | ||
"devDependencies": { | ||
"@theia/ext-scripts": "^0.2.0" | ||
}, | ||
"nyc": { | ||
"extends": "../../configs/nyc.json" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright (C) 2017 Ericsson and others. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
export * from './task-frontend-module'; | ||
export * from './task-service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (C) 2017 Ericsson and others. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
import { inject, injectable } from "inversify"; | ||
import { TaskService } from './task-service'; | ||
import { QuickOpenService, QuickOpenModel, QuickOpenItem, QuickOpenMode } from '@theia/core/lib/browser/quick-open/'; | ||
|
||
@injectable() | ||
export class QuickOpenTask implements QuickOpenModel { | ||
|
||
private items: QuickOpenItem[]; | ||
|
||
constructor( | ||
@inject(TaskService) protected readonly taskService: TaskService, | ||
@inject(QuickOpenService) protected readonly quickOpenService: QuickOpenService | ||
) { } | ||
|
||
open(): void { | ||
this.items = []; | ||
|
||
this.taskService.getTasks().then(tasks => { | ||
for (const task of tasks) { | ||
this.items.push(new TaskQuickOpenItem(task, this.taskService)); | ||
} | ||
this.quickOpenService.open(this, { | ||
placeholder: 'Type the name of a task you want to execute', | ||
fuzzyMatchLabel: true, | ||
fuzzySort: true | ||
}); | ||
}); | ||
|
||
} | ||
|
||
public getItems(lookFor: string): QuickOpenItem[] { | ||
return this.items; | ||
} | ||
|
||
} | ||
|
||
export class TaskQuickOpenItem extends QuickOpenItem { | ||
|
||
private activeElement: HTMLElement; | ||
|
||
constructor( | ||
protected readonly taskLabel: string, | ||
protected taskService: TaskService | ||
) { | ||
super(); | ||
this.activeElement = window.document.activeElement as HTMLElement; | ||
} | ||
|
||
getLabel(): string { | ||
return this.taskLabel!; | ||
} | ||
|
||
run(mode: QuickOpenMode): boolean { | ||
if (mode !== QuickOpenMode.OPEN) { | ||
return false; | ||
} | ||
// reset focus on the previously active element. | ||
this.activeElement.focus(); | ||
this.taskService.run(this.taskLabel); | ||
|
||
return true; | ||
} | ||
} |
Oops, something went wrong.