Merge branch 'main' into patch-1

This commit is contained in:
Joe Previte 2021-04-02 11:16:52 -07:00 committed by GitHub
commit 0d584cd5e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 147 additions and 148 deletions

View File

@ -25,12 +25,6 @@ main() {
rsync README.md "$RELEASE_PATH" rsync README.md "$RELEASE_PATH"
rsync LICENSE.txt "$RELEASE_PATH" rsync LICENSE.txt "$RELEASE_PATH"
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH" rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
# code-server exports types which can be imported and used by plugins. Those
# types import ipc.d.ts but it isn't included in the final vscode build so
# we'll copy it ourselves here.
mkdir -p "$RELEASE_PATH/lib/vscode/src/vs/server"
rsync ./lib/vscode/src/vs/server/ipc.d.ts "$RELEASE_PATH/lib/vscode/src/vs/server"
} }
bundle_code_server() { bundle_code_server() {

View File

@ -16,5 +16,6 @@
**/extensions/markdown-language-features/notebook-out/** **/extensions/markdown-language-features/notebook-out/**
**/extensions/typescript-basics/test/colorize-fixtures/** **/extensions/typescript-basics/test/colorize-fixtures/**
**/extensions/**/dist/** **/extensions/**/dist/**
# This is a code-server code symlink. # These are code-server code symlinks.
src/vs/base/node/proxy_agent.ts src/vs/base/node/proxy_agent.ts
src/vs/ipc.d.ts

1
lib/vscode/src/vs/ipc.d.ts vendored Symbolic link
View File

@ -0,0 +1 @@
../../../../typings/ipc.d.ts

View File

@ -1,5 +1,6 @@
import * as path from 'vs/base/common/path'; import * as path from 'vs/base/common/path';
import { URI } from 'vs/base/common/uri'; import { URI } from 'vs/base/common/uri';
import { Options } from 'vs/ipc';
import { localize } from 'vs/nls'; import { localize } from 'vs/nls';
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
@ -11,7 +12,6 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { TelemetryChannelClient } from 'vs/server/common/telemetry'; import { TelemetryChannelClient } from 'vs/server/common/telemetry';
import { Options } from 'vs/server/ipc.d';
import 'vs/workbench/contrib/localizations/browser/localizations.contribution'; import 'vs/workbench/contrib/localizations/browser/localizations.contribution';
import { LocalizationsService } from 'vs/workbench/services/localizations/electron-sandbox/localizationsService'; import { LocalizationsService } from 'vs/workbench/services/localizations/electron-sandbox/localizationsService';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';

View File

@ -1,10 +1,10 @@
import { field } from '@coder/logger'; import { field } from '@coder/logger';
import { setUnexpectedErrorHandler } from 'vs/base/common/errors'; import { setUnexpectedErrorHandler } from 'vs/base/common/errors';
import { CodeServerMessage, VscodeMessage } from 'vs/server/ipc'; import * as proxyAgent from 'vs/base/node/proxy_agent';
import { CodeServerMessage, VscodeMessage } from 'vs/ipc';
import { logger } from 'vs/server/node/logger'; import { logger } from 'vs/server/node/logger';
import { enableCustomMarketplace } from 'vs/server/node/marketplace'; import { enableCustomMarketplace } from 'vs/server/node/marketplace';
import { Vscode } from 'vs/server/node/server'; import { Vscode } from 'vs/server/node/server';
import * as proxyAgent from 'vs/base/node/proxy_agent';
setUnexpectedErrorHandler((error) => logger.warn(error instanceof Error ? error.message : error)); setUnexpectedErrorHandler((error) => logger.warn(error instanceof Error ? error.message : error));
enableCustomMarketplace(); enableCustomMarketplace();

View File

@ -1,132 +0,0 @@
/**
* External interfaces for integration into code-server over IPC. No vs imports
* should be made in this file.
*/
export interface Options {
base: string
disableTelemetry: boolean
disableUpdateCheck: boolean
}
export interface InitMessage {
type: "init"
id: string
options: VscodeOptions
}
export type Query = { [key: string]: string | string[] | undefined | Query | Query[] }
export interface SocketMessage {
type: "socket"
query: Query
permessageDeflate: boolean
}
export interface CliMessage {
type: "cli"
args: Args
}
export interface OpenCommandPipeArgs {
type: "open"
fileURIs?: string[]
folderURIs: string[]
forceNewWindow?: boolean
diffMode?: boolean
addMode?: boolean
gotoLineMode?: boolean
forceReuseWindow?: boolean
waitMarkerFilePath?: string
}
export type CodeServerMessage = InitMessage | SocketMessage | CliMessage
export interface ReadyMessage {
type: "ready"
}
export interface OptionsMessage {
id: string
type: "options"
options: WorkbenchOptions
}
export type VscodeMessage = ReadyMessage | OptionsMessage
export interface StartPath {
url: string
workspace: boolean
}
export interface Args {
"user-data-dir"?: string
"enable-proposed-api"?: string[]
"extensions-dir"?: string
"builtin-extensions-dir"?: string
"extra-extensions-dir"?: string[]
"extra-builtin-extensions-dir"?: string[]
"ignore-last-opened"?: boolean
locale?: string
log?: string
verbose?: boolean
_: string[]
}
export interface VscodeOptions {
readonly args: Args
readonly remoteAuthority: string
readonly startPath?: StartPath
}
export interface VscodeOptionsMessage extends VscodeOptions {
readonly id: string
}
export interface UriComponents {
readonly scheme: string
readonly authority: string
readonly path: string
readonly query: string
readonly fragment: string
}
export interface NLSConfiguration {
locale: string
availableLanguages: {
[key: string]: string
}
pseudo?: boolean
_languagePackSupport?: boolean
}
export interface WorkbenchOptions {
readonly workbenchWebConfiguration: {
readonly remoteAuthority?: string
readonly folderUri?: UriComponents
readonly workspaceUri?: UriComponents
readonly logLevel?: number
readonly workspaceProvider?: {
payload: [["userDataPath", string], ["enableProposedApi", string]]
}
}
readonly remoteUserDataUri: UriComponents
readonly productConfiguration: {
codeServerVersion?: string
readonly extensionsGallery?: {
readonly serviceUrl: string
readonly itemUrl: string
readonly controlUrl: string
readonly recommendationsUrl: string
}
}
readonly nlsConfiguration: NLSConfiguration
readonly commit: string
}
export interface WorkbenchOptionsMessage {
id: string
}

View File

@ -1,7 +1,7 @@
import { field } from '@coder/logger'; import { field } from '@coder/logger';
import { release } from 'os';
import * as fs from 'fs'; import * as fs from 'fs';
import * as net from 'net'; import * as net from 'net';
import { release } from 'os';
import * as path from 'path'; import * as path from 'path';
import { Emitter } from 'vs/base/common/event'; import { Emitter } from 'vs/base/common/event';
import { Schemas } from 'vs/base/common/network'; import { Schemas } from 'vs/base/common/network';
@ -10,6 +10,7 @@ import { getMachineId } from 'vs/base/node/id';
import { ClientConnectionEvent, IPCServer, IServerChannel, ProxyChannel } from 'vs/base/parts/ipc/common/ipc'; import { ClientConnectionEvent, IPCServer, IServerChannel, ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner'; import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner';
import { main } from 'vs/code/node/cliProcessMain'; import { main } from 'vs/code/node/cliProcessMain';
import { Query, VscodeOptions, WorkbenchOptions } from 'vs/ipc';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ConfigurationService } from 'vs/platform/configuration/common/configurationService'; import { ConfigurationService } from 'vs/platform/configuration/common/configurationService';
import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc'; import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc';
@ -40,14 +41,13 @@ import { IRequestService } from 'vs/platform/request/common/request';
import { RequestChannel } from 'vs/platform/request/common/requestIpc'; import { RequestChannel } from 'vs/platform/request/common/requestIpc';
import { RequestService } from 'vs/platform/request/node/requestService'; import { RequestService } from 'vs/platform/request/node/requestService';
import ErrorTelemetry from 'vs/platform/telemetry/browser/errorTelemetry'; import ErrorTelemetry from 'vs/platform/telemetry/browser/errorTelemetry';
import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender'; import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { combinedAppender, NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { combinedAppender, NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender'; import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
import { resolveCommonProperties } from 'vs/platform/telemetry/common/commonProperties';
import { TelemetryChannel } from 'vs/server/common/telemetry'; import { TelemetryChannel } from 'vs/server/common/telemetry';
import { Query, VscodeOptions, WorkbenchOptions } from 'vs/server/ipc';
import { ExtensionEnvironmentChannel, FileProviderChannel, TerminalProviderChannel } from 'vs/server/node/channel'; import { ExtensionEnvironmentChannel, FileProviderChannel, TerminalProviderChannel } from 'vs/server/node/channel';
import { Connection, ExtensionHostConnection, ManagementConnection } from 'vs/server/node/connection'; import { Connection, ExtensionHostConnection, ManagementConnection } from 'vs/server/node/connection';
import { TelemetryClient } from 'vs/server/node/insights'; import { TelemetryClient } from 'vs/server/node/insights';

View File

@ -3,7 +3,7 @@ import { promises as fs } from "fs"
import yaml from "js-yaml" import yaml from "js-yaml"
import * as os from "os" import * as os from "os"
import * as path from "path" import * as path from "path"
import { Args as VsArgs } from "../../lib/vscode/src/vs/server/ipc" import { Args as VsArgs } from "../../typings/ipc"
import { canConnect, generateCertificate, generatePassword, humanPath, paths } from "./util" import { canConnect, generateCertificate, generatePassword, humanPath, paths } from "./util"
export enum AuthType { export enum AuthType {

View File

@ -2,7 +2,7 @@ import { field, logger } from "@coder/logger"
import * as cp from "child_process" import * as cp from "child_process"
import http from "http" import http from "http"
import * as path from "path" import * as path from "path"
import { CliMessage, OpenCommandPipeArgs } from "../../lib/vscode/src/vs/server/ipc" import { CliMessage, OpenCommandPipeArgs } from "../../typings/ipc"
import { plural } from "../common/util" import { plural } from "../common/util"
import { createApp, ensureAddress } from "./app" import { createApp, ensureAddress } from "./app"
import { import {

View File

@ -2,7 +2,7 @@ import { logger } from "@coder/logger"
import * as cp from "child_process" import * as cp from "child_process"
import * as net from "net" import * as net from "net"
import * as path from "path" import * as path from "path"
import * as ipc from "../../lib/vscode/src/vs/server/ipc" import * as ipc from "../../typings/ipc"
import { arrayify, generateUuid } from "../common/util" import { arrayify, generateUuid } from "../common/util"
import { rootPath } from "./constants" import { rootPath } from "./constants"
import { settings } from "./settings" import { settings } from "./settings"

135
typings/ipc.d.ts vendored Normal file
View File

@ -0,0 +1,135 @@
/**
* External interfaces for integration into code-server over IPC.
* This file exists in two locations:
* - typings/ipc.d.ts
* - lib/vscode/src/typings/ipc.d.ts
* The second is a symlink to the first.
*/
export interface Options {
base: string
disableTelemetry: boolean
disableUpdateCheck: boolean
}
export interface InitMessage {
type: "init"
id: string
options: VscodeOptions
}
export type Query = { [key: string]: string | string[] | undefined | Query | Query[] }
export interface SocketMessage {
type: "socket"
query: Query
permessageDeflate: boolean
}
export interface CliMessage {
type: "cli"
args: Args
}
export interface OpenCommandPipeArgs {
type: "open"
fileURIs?: string[]
folderURIs: string[]
forceNewWindow?: boolean
diffMode?: boolean
addMode?: boolean
gotoLineMode?: boolean
forceReuseWindow?: boolean
waitMarkerFilePath?: string
}
export type CodeServerMessage = InitMessage | SocketMessage | CliMessage
export interface ReadyMessage {
type: "ready"
}
export interface OptionsMessage {
id: string
type: "options"
options: WorkbenchOptions
}
export type VscodeMessage = ReadyMessage | OptionsMessage
export interface StartPath {
url: string
workspace: boolean
}
export interface Args {
"user-data-dir"?: string
"enable-proposed-api"?: string[]
"extensions-dir"?: string
"builtin-extensions-dir"?: string
"extra-extensions-dir"?: string[]
"extra-builtin-extensions-dir"?: string[]
"ignore-last-opened"?: boolean
locale?: string
log?: string
verbose?: boolean
_: string[]
}
export interface VscodeOptions {
readonly args: Args
readonly remoteAuthority: string
readonly startPath?: StartPath
}
export interface VscodeOptionsMessage extends VscodeOptions {
readonly id: string
}
export interface UriComponents {
readonly scheme: string
readonly authority: string
readonly path: string
readonly query: string
readonly fragment: string
}
export interface NLSConfiguration {
locale: string
availableLanguages: {
[key: string]: string
}
pseudo?: boolean
_languagePackSupport?: boolean
}
export interface WorkbenchOptions {
readonly workbenchWebConfiguration: {
readonly remoteAuthority?: string
readonly folderUri?: UriComponents
readonly workspaceUri?: UriComponents
readonly logLevel?: number
readonly workspaceProvider?: {
payload: [["userDataPath", string], ["enableProposedApi", string]]
}
}
readonly remoteUserDataUri: UriComponents
readonly productConfiguration: {
codeServerVersion?: string
readonly extensionsGallery?: {
readonly serviceUrl: string
readonly itemUrl: string
readonly controlUrl: string
readonly recommendationsUrl: string
}
}
readonly nlsConfiguration: NLSConfiguration
readonly commit: string
}
export interface WorkbenchOptionsMessage {
id: string
}