mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Merge remote-tracking branch 'origin/main' into tyriar/116467_2
This commit is contained in:
commit
4bb960ade6
|
@ -32,17 +32,17 @@ Next: **[Try it out!](#try-it)**
|
|||
|
||||
## Quick start - GitHub Codespaces
|
||||
|
||||
> **IMPORTANT:** The current free user beta for GitHub Codespaces uses a "Basic" sized codespace which does not have enough RAM to run a full build of VS Code and will be considerably slower during codespace start and running VS Code. You'll soon be able to use a "Standard" sized codespace (4-core, 8GB) that will be better suited for this purpose (along with even larger sizes should you need it).
|
||||
> **IMPORTANT:** You need to use a "Standard" sized codespace or larger (4-core, 8GB) since VS Code needs 6GB of RAM to compile. This is now the default for GitHub Codespaces, but do not downgrade to "Basic" unless you do not intend to compile.
|
||||
|
||||
1. From the [microsoft/vscode GitHub repository](https://github.com/microsoft/vscode), click on the **Code** dropdown, select **Open with Codespaces**, and the **New codespace**
|
||||
|
||||
> Note that you will not see these options if you are not in the beta yet.
|
||||
|
||||
2. After the codespace is up and running in your browser, press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and select **View: Show Remote Explorer**.
|
||||
2. After the codespace is up and running in your browser, press <kbd>F1</kbd> and select **Ports: Focus on Ports View**.
|
||||
|
||||
3. You should see port `6080` under **Forwarded Ports**. Select the line and click on the globe icon to open it in a browser tab.
|
||||
|
||||
> If you do not see port `6080`, press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>, select **Forward a Port** and enter port `6080`.
|
||||
> If you do not see port `6080`, press <kbd>F1</kbd>, select **Forward a Port** and enter port `6080`.
|
||||
|
||||
4. In the new tab, you should see noVNC. Click **Connect** and enter `vscode` as the password.
|
||||
|
||||
|
@ -58,7 +58,7 @@ You will likely see better performance when accessing the codespace you created
|
|||
|
||||
2. Set up [VS Code for use with GitHub Codespaces](https://docs.github.com/github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code)
|
||||
|
||||
3. After the VS Code is up and running, press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>, choose **Codespaces: Connect to Codespace**, and select the codespace you created.
|
||||
3. After the VS Code is up and running, press <kbd>F1</kbd>, choose **Codespaces: Connect to Codespace**, and select the codespace you created.
|
||||
|
||||
4. After you've connected to the codespace, use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import { Schemas } from 'vs/base/common/network';
|
|||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { FloatingClickWidget } from 'vs/workbench/browser/codeeditor';
|
||||
import { ITASExperimentService } from 'vs/workbench/services/experiment/common/experimentService';
|
||||
const $ = dom.$;
|
||||
|
||||
const untitledHintSetting = 'workbench.editor.untitled.hint';
|
||||
|
@ -34,7 +35,8 @@ export class UntitledHintContribution implements IEditorContribution {
|
|||
@ICommandService private readonly commandService: ICommandService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||
@IThemeService private readonly themeService: IThemeService
|
||||
@IThemeService private readonly themeService: IThemeService,
|
||||
@ITASExperimentService private readonly experimentService: ITASExperimentService
|
||||
) {
|
||||
this.toDispose = [];
|
||||
this.toDispose.push(this.editor.onDidChangeModel(() => this.update()));
|
||||
|
@ -47,10 +49,12 @@ export class UntitledHintContribution implements IEditorContribution {
|
|||
this.update();
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
private async update(): Promise<void> {
|
||||
this.untitledHintContentWidget?.dispose();
|
||||
this.button?.dispose();
|
||||
const untitledHintMode = this.configurationService.getValue(untitledHintSetting);
|
||||
const experimentService = await this.experimentService.getTreatment<'text' | 'button'>('untitledhint');
|
||||
const configValue = this.configurationService.getValue<'text' | 'button' | 'hidden'>(untitledHintSetting);
|
||||
const untitledHintMode = configValue === 'hidden' ? configValue : (experimentService || configValue);
|
||||
const model = this.editor.getModel();
|
||||
|
||||
if (model && model.uri.scheme === Schemas.untitled && model.getModeId() === PLAINTEXT_MODE_ID) {
|
||||
|
|
|
@ -150,6 +150,10 @@ export class TunnelViewModel implements ITunnelViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
function emptyCell(item: ITunnelItem): ActionBarCell {
|
||||
return { label: '', tunnel: item, editId: TunnelEditId.None, tooltip: '' };
|
||||
}
|
||||
|
||||
class IconColumn implements ITableColumn<ITunnelItem, ActionBarCell> {
|
||||
readonly label: string = '';
|
||||
readonly tooltip: string = '';
|
||||
|
@ -158,10 +162,13 @@ class IconColumn implements ITableColumn<ITunnelItem, ActionBarCell> {
|
|||
readonly maximumWidth = 40;
|
||||
readonly templateId: string = 'actionbar';
|
||||
project(row: ITunnelItem): ActionBarCell {
|
||||
const isAdd = row.tunnelType === TunnelType.Add;
|
||||
const icon = isAdd ? undefined : (row.processDescription ? forwardedPortWithProcessIcon : forwardedPortWithoutProcessIcon);
|
||||
if (row.tunnelType === TunnelType.Add) {
|
||||
return emptyCell(row);
|
||||
}
|
||||
|
||||
const icon = row.processDescription ? forwardedPortWithProcessIcon : forwardedPortWithoutProcessIcon;
|
||||
let tooltip: string = '';
|
||||
if (row instanceof TunnelItem && !isAdd) {
|
||||
if (row instanceof TunnelItem) {
|
||||
tooltip = `${row.iconTooltip} ${row.tooltipPostfix}`;
|
||||
}
|
||||
return {
|
||||
|
@ -197,12 +204,14 @@ class LocalAddressColumn implements ITableColumn<ITunnelItem, ActionBarCell> {
|
|||
readonly weight: number = 1;
|
||||
readonly templateId: string = 'actionbar';
|
||||
project(row: ITunnelItem): ActionBarCell {
|
||||
if (row.tunnelType === TunnelType.Add) {
|
||||
return emptyCell(row);
|
||||
}
|
||||
|
||||
const label = row.localAddress ?? '';
|
||||
let tooltip: string;
|
||||
let tooltip: string = label;
|
||||
if (row instanceof TunnelItem) {
|
||||
tooltip = row.tooltipPostfix;
|
||||
} else {
|
||||
tooltip = label;
|
||||
}
|
||||
return { label, menuId: MenuId.TunnelLocalAddressInline, tunnel: row, editId: TunnelEditId.LocalPort, tooltip };
|
||||
}
|
||||
|
@ -214,6 +223,10 @@ class RunningProcessColumn implements ITableColumn<ITunnelItem, ActionBarCell> {
|
|||
readonly weight: number = 2;
|
||||
readonly templateId: string = 'actionbar';
|
||||
project(row: ITunnelItem): ActionBarCell {
|
||||
if (row.tunnelType === TunnelType.Add) {
|
||||
return emptyCell(row);
|
||||
}
|
||||
|
||||
const label = row.processDescription ?? '';
|
||||
return { label, tunnel: row, editId: TunnelEditId.None, tooltip: row instanceof TunnelItem ? row.processTooltip : '' };
|
||||
}
|
||||
|
@ -225,6 +238,10 @@ class OriginColumn implements ITableColumn<ITunnelItem, ActionBarCell> {
|
|||
readonly weight: number = 1;
|
||||
readonly templateId: string = 'actionbar';
|
||||
project(row: ITunnelItem): ActionBarCell {
|
||||
if (row.tunnelType === TunnelType.Add) {
|
||||
return emptyCell(row);
|
||||
}
|
||||
|
||||
const label = row.source;
|
||||
const tooltip = `${row instanceof TunnelItem ? row.originTooltip : ''}. ${row instanceof TunnelItem ? row.tooltipPostfix : ''}`;
|
||||
return { label, menuId: MenuId.TunnelOriginInline, tunnel: row, editId: TunnelEditId.None, tooltip };
|
||||
|
@ -237,38 +254,19 @@ class PrivacyColumn implements ITableColumn<ITunnelItem, ActionBarCell> {
|
|||
readonly weight: number = 1;
|
||||
readonly templateId: string = 'actionbar';
|
||||
project(row: ITunnelItem): ActionBarCell {
|
||||
let label: string = '';
|
||||
if (row.privacy === TunnelPrivacy.Public) {
|
||||
label = nls.localize('tunnel.privacyPublic', "Public");
|
||||
} else if (row.tunnelType !== TunnelType.Add) {
|
||||
label = nls.localize('tunnel.privacyPrivate', "Private");
|
||||
if (row.tunnelType === TunnelType.Add) {
|
||||
return emptyCell(row);
|
||||
}
|
||||
|
||||
const label = row.privacy === TunnelPrivacy.Public ? nls.localize('tunnel.privacyPublic', "Public") : nls.localize('tunnel.privacyPrivate', "Private");
|
||||
let tooltip: string = '';
|
||||
if (row instanceof TunnelItem && row.tunnelType !== TunnelType.Add) {
|
||||
if (row instanceof TunnelItem) {
|
||||
tooltip = `${row.privacyTooltip} ${row.tooltipPostfix}`;
|
||||
}
|
||||
return { label, tunnel: row, icon: row.icon, editId: TunnelEditId.None, tooltip };
|
||||
}
|
||||
}
|
||||
|
||||
class StringRenderer implements ITableRenderer<string, HTMLElement> {
|
||||
|
||||
readonly templateId = 'string';
|
||||
|
||||
renderTemplate(container: HTMLElement): HTMLElement {
|
||||
return container;
|
||||
}
|
||||
|
||||
renderElement(element: string, index: number, container: HTMLElement): void {
|
||||
container.textContent = element;
|
||||
}
|
||||
|
||||
disposeTemplate(templateData: HTMLElement): void {
|
||||
// noop
|
||||
}
|
||||
}
|
||||
|
||||
interface IActionBarTemplateData {
|
||||
elementDisposable: IDisposable;
|
||||
container: HTMLElement;
|
||||
|
@ -681,7 +679,7 @@ export class TunnelPanel extends ViewPane {
|
|||
widgetContainer,
|
||||
new TunnelTreeVirtualDelegate(this.remoteExplorerService),
|
||||
columns,
|
||||
[new StringRenderer(), actionBarRenderer],
|
||||
[actionBarRenderer],
|
||||
{
|
||||
keyboardNavigationLabelProvider: {
|
||||
getKeyboardNavigationLabel: (item: ITunnelItem) => {
|
||||
|
|
Loading…
Reference in a new issue