-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[webview] compliance to vscode webview api tests 1.40.0
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
- Loading branch information
Showing
7 changed files
with
147 additions
and
30 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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
image: | ||
file: .gitpod.dockerfile | ||
ports: | ||
- port: 3000 | ||
- port: 6080 | ||
onOpen: ignore | ||
- port: 5900 | ||
onOpen: ignore | ||
- port: 3000 # Theia | ||
- port: 3030 # VS Code extension tests | ||
- port: 9339 # Node.js debug port | ||
onOpen: ignore | ||
- port: 6080 | ||
onOpen: ignore | ||
- port: 5900 | ||
onOpen: ignore | ||
tasks: | ||
- init: yarn | ||
command: > | ||
jwm & | ||
yarn --cwd examples/browser start ../.. | ||
- init: yarn | ||
command: > | ||
jwm & | ||
yarn --cwd examples/browser start ../.. | ||
github: | ||
prebuilds: | ||
pullRequestsFromForks: true |
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
56 changes: 56 additions & 0 deletions
56
packages/plugin-ext/src/main/browser/webview/webview-preferences.ts
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,56 @@ | ||
/******************************************************************************** | ||
* Copyright (C) 2019 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 { interfaces } from 'inversify'; | ||
import { | ||
createPreferenceProxy, | ||
PreferenceProxy, | ||
PreferenceService, | ||
PreferenceContribution, | ||
PreferenceSchema | ||
} from '@theia/core/lib/browser/preferences'; | ||
|
||
export const WebviewConfigSchema: PreferenceSchema = { | ||
'type': 'object', | ||
'properties': { | ||
'webview.trace': { | ||
'type': 'string', | ||
'enum': ['off', 'on', 'verbose'], | ||
'description': 'Controls communication tracing with webviews.', | ||
'default': 'off' | ||
} | ||
} | ||
}; | ||
|
||
export interface WebviewConfiguration { | ||
'webview.trace': 'off' | 'on' | 'verbose' | ||
} | ||
|
||
export const WebviewPreferences = Symbol('WebviewPreferences'); | ||
export type WebviewPreferences = PreferenceProxy<WebviewConfiguration>; | ||
|
||
export function createWebviewPreferences(preferences: PreferenceService): WebviewPreferences { | ||
return createPreferenceProxy(preferences, WebviewConfigSchema); | ||
} | ||
|
||
export function bindWebviewPreferences(bind: interfaces.Bind): void { | ||
bind(WebviewPreferences).toDynamicValue(ctx => { | ||
const preferences = ctx.container.get<PreferenceService>(PreferenceService); | ||
return createWebviewPreferences(preferences); | ||
}); | ||
|
||
bind(PreferenceContribution).toConstantValue({ schema: WebviewConfigSchema }); | ||
} |
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