-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add java-debug extension based on vscode-java-debug #3613
Changes from all commits
9abccc5
783b1bb
a07596b
f4e17bf
720525f
8cbb11e
c62910d
721c2f1
586042d
b7b0e1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"rules": { | ||
"deprecation": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hello, I don't see how this change it is related to this feature ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've deprecated some APIs and want other developers to notice it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my point is why deprecated notice is not discussed first There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, let's discuss deprecation on Tuesday btw it is just warning, it won't break builds and so on. There is also no APIs broken in core and developers can stop using moved APIs over time. |
||
"await-promise": { | ||
"severity": "warning", | ||
"options": [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/******************************************************************************** | ||
* Copyright (C) 2018 TypeFox and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
import { injectable, inject } from 'inversify'; | ||
import { QuickOpenItem, QuickOpenMode, QuickOpenGroupItem, QuickOpenItemOptions } from './quick-open-model'; | ||
import { QuickOpenService } from './quick-open-service'; | ||
import { QuickPickService, QuickPickOptions, QuickPickItem, QuickPickSeparator, QuickPickValue } from '../../common/quick-pick-service'; | ||
|
||
@injectable() | ||
export class QuickPickServiceImpl implements QuickPickService { | ||
|
||
@inject(QuickOpenService) | ||
protected readonly quickOpenService: QuickOpenService; | ||
|
||
show(elements: string[], options?: QuickPickOptions): Promise<string | undefined>; | ||
show<T>(elements: QuickPickItem<T>[], options?: QuickPickOptions): Promise<T | undefined>; | ||
async show(elements: (string | QuickPickItem<Object>)[], options?: QuickPickOptions): Promise<Object | undefined> { | ||
return new Promise<Object | undefined>(resolve => { | ||
const items = this.toItems(elements, resolve); | ||
if (items.length === 0) { | ||
resolve(undefined); | ||
return; | ||
} | ||
if (items.length === 1) { | ||
items[0].run(QuickOpenMode.OPEN); | ||
return; | ||
} | ||
this.quickOpenService.open({ onType: (_, acceptor) => acceptor(items) }, Object.assign({ | ||
onClose: () => resolve(undefined), | ||
fuzzyMatchLabel: true, | ||
fuzzyMatchDescription: true | ||
}, options)); | ||
}); | ||
} | ||
protected toItems(elements: (string | QuickPickItem<Object>)[], resolve: (element: Object) => void): QuickOpenItem[] { | ||
const items: QuickOpenItem[] = []; | ||
let groupLabel: string | undefined; | ||
for (const element of elements) { | ||
if (QuickPickSeparator.is(element)) { | ||
groupLabel = element.label; | ||
} else { | ||
const options = this.toItemOptions(element, resolve); | ||
if (groupLabel) { | ||
items.push(new QuickOpenGroupItem(Object.assign(options, { groupLabel, showBorder: true }))); | ||
groupLabel = undefined; | ||
} else { | ||
items.push(new QuickOpenItem(options)); | ||
} | ||
} | ||
} | ||
return items; | ||
} | ||
protected toItemOptions(element: string | QuickPickValue<Object>, resolve: (element: Object) => void): QuickOpenItemOptions { | ||
const label = typeof element === 'string' ? element : element.label; | ||
const value = typeof element === 'string' ? element : element.value; | ||
const description = typeof element === 'string' ? undefined : element.description; | ||
const iconClass = typeof element === 'string' ? undefined : element.iconClass; | ||
return { | ||
label, | ||
description, | ||
iconClass, | ||
run: mode => { | ||
if (mode !== QuickOpenMode.OPEN) { | ||
return false; | ||
} | ||
resolve(value); | ||
return true; | ||
} | ||
}; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,102 +14,28 @@ | |
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
import { injectable, inject } from 'inversify'; | ||
import { QuickOpenItem, QuickOpenMode, QuickOpenGroupItem, QuickOpenItemOptions } from './quick-open-model'; | ||
import { QuickOpenService } from './quick-open-service'; | ||
|
||
export type QuickPickItem<T> = QuickPickValue<T> | QuickPickSeparator; | ||
|
||
export interface QuickPickSeparator { | ||
type: 'separator' | ||
label: string | ||
} | ||
export namespace QuickPickSeparator { | ||
export function is(item: string | QuickPickItem<Object>): item is QuickPickSeparator { | ||
return typeof item === 'object' && 'type' in item && item['type'] === 'separator'; | ||
} | ||
} | ||
|
||
export interface QuickPickValue<T> { | ||
label: string | ||
value: T | ||
description?: string | ||
iconClass?: string | ||
} | ||
|
||
export interface QuickPickOptions { | ||
placeholder?: string | ||
/** | ||
* default: true | ||
*/ | ||
fuzzyMatchLabel?: boolean | ||
/** | ||
* default: true | ||
*/ | ||
fuzzyMatchDescription?: boolean | ||
} | ||
|
||
@injectable() | ||
export class QuickPickService { | ||
|
||
@inject(QuickOpenService) | ||
protected readonly quickOpenService: QuickOpenService; | ||
|
||
show(elements: string[], options?: QuickPickOptions): Promise<string | undefined>; | ||
show<T>(elements: QuickPickItem<T>[], options?: QuickPickOptions): Promise<T | undefined>; | ||
async show(elements: (string | QuickPickItem<Object>)[], options?: QuickPickOptions): Promise<Object | undefined> { | ||
return new Promise<Object | undefined>(resolve => { | ||
const items = this.toItems(elements, resolve); | ||
if (items.length === 0) { | ||
resolve(undefined); | ||
return; | ||
} | ||
if (items.length === 1) { | ||
items[0].run(QuickOpenMode.OPEN); | ||
return; | ||
} | ||
this.quickOpenService.open({ onType: (_, acceptor) => acceptor(items) }, Object.assign({ | ||
onClose: () => resolve(undefined), | ||
fuzzyMatchLabel: true, | ||
fuzzyMatchDescription: true | ||
}, options)); | ||
}); | ||
} | ||
protected toItems(elements: (string | QuickPickItem<Object>)[], resolve: (element: Object) => void): QuickOpenItem[] { | ||
const items: QuickOpenItem[] = []; | ||
let groupLabel: string | undefined; | ||
for (const element of elements) { | ||
if (QuickPickSeparator.is(element)) { | ||
groupLabel = element.label; | ||
} else { | ||
const options = this.toItemOptions(element, resolve); | ||
if (groupLabel) { | ||
items.push(new QuickOpenGroupItem(Object.assign(options, { groupLabel, showBorder: true }))); | ||
groupLabel = undefined; | ||
} else { | ||
items.push(new QuickOpenItem(options)); | ||
} | ||
} | ||
} | ||
return items; | ||
} | ||
protected toItemOptions(element: string | QuickPickValue<Object>, resolve: (element: Object) => void): QuickOpenItemOptions { | ||
const label = typeof element === 'string' ? element : element.label; | ||
const value = typeof element === 'string' ? element : element.value; | ||
const description = typeof element === 'string' ? undefined : element.description; | ||
const iconClass = typeof element === 'string' ? undefined : element.iconClass; | ||
return { | ||
label, | ||
description, | ||
iconClass, | ||
run: mode => { | ||
if (mode !== QuickOpenMode.OPEN) { | ||
return false; | ||
} | ||
resolve(value); | ||
return true; | ||
} | ||
}; | ||
} | ||
|
||
} | ||
import * as common from '../../common/quick-pick-service'; | ||
/** | ||
* @deprecated import from `@theia/core/lib/common/quick-pick-service` instead | ||
*/ | ||
export const QuickPickService = common.QuickPickService; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this service is becoming deprecated, what is the reason behind ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you're telling the "how", not "why" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be used in the java debug adapter contribution, please use find references on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @akosyakov I see the choice you've used, not the reason why service should be callable from browser and node. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @akosyakov The main point is that there was no discussion previously. it was just a comment on a PR. Also planned tasks on Theia from TypeFox are unclear. Also why the word There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @benoitf We all have many decisions to make on each PR. If there are some that you care about and want to discuss, please do so (like you did here). |
||
/** | ||
* @deprecated import from `@theia/core/lib/common/quick-pick-service` instead | ||
*/ | ||
export type QuickPickService = common.QuickPickService; | ||
/** | ||
* @deprecated import from `@theia/core/lib/common/quick-pick-service` instead | ||
*/ | ||
export type QuickPickOptions = common.QuickPickOptions; | ||
/** | ||
* @deprecated import from `@theia/core/lib/common/quick-pick-service` instead | ||
*/ | ||
export type QuickPickItem<T> = common.QuickPickItem<T>; | ||
/** | ||
* @deprecated import from `@theia/core/lib/common/quick-pick-service` instead | ||
*/ | ||
export type QuickPickSeparator = common.QuickPickSeparator; | ||
/** | ||
* @deprecated import from `@theia/core/lib/common/quick-pick-service` instead | ||
*/ | ||
export type QuickPickValue<T> = common.QuickPickValue<T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello, I don't see how this change it is related to this feature ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is related because I needed it to debug extensions