mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
Add a smoketest for packaging with parcel (#3371)
* Add a smoketest for packaging with parcel * Prevent parcel from bundling shims for `process` or `buffer`
This commit is contained in:
parent
2b3d8516c6
commit
8fc2ca540c
14 changed files with 4398 additions and 101 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
|
@ -56,6 +56,9 @@ jobs:
|
||||||
- name: Package using vite
|
- name: Package using vite
|
||||||
run: npm run package-for-smoketest-vite
|
run: npm run package-for-smoketest-vite
|
||||||
|
|
||||||
|
- name: Package using parcel
|
||||||
|
run: npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
||||||
|
|
||||||
- name: Run smoke test
|
- name: Run smoke test
|
||||||
run: npm run smoketest
|
run: npm run smoketest
|
||||||
|
|
||||||
|
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@
|
||||||
**/release/
|
**/release/
|
||||||
/test/manual/generated/**
|
/test/manual/generated/**
|
||||||
/test/smoke/vite/dist/**
|
/test/smoke/vite/dist/**
|
||||||
|
/test/smoke/parcel/dist/**
|
||||||
|
/test/smoke/parcel/.cache/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
# Monaco Editor Changelog
|
# Monaco Editor Changelog
|
||||||
|
|
||||||
|
## [0.35.1]
|
||||||
|
|
||||||
|
- Adds sticky scrolling
|
||||||
|
- Renamed the option `enableDropIntoEditor` to `dropIntoEditor`
|
||||||
|
|
||||||
## [0.34.1]
|
## [0.34.1]
|
||||||
|
|
||||||
- Adds API to register global actions, commands, or keybinding rules
|
- Adds API to register global actions, commands, or keybinding rules
|
||||||
|
|
|
||||||
3963
package-lock.json
generated
3963
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -49,7 +49,8 @@
|
||||||
"jsdom": "^19.0.0",
|
"jsdom": "^19.0.0",
|
||||||
"jsonc-parser": "^3.0.0",
|
"jsonc-parser": "^3.0.0",
|
||||||
"mocha": "^9.2.0",
|
"mocha": "^9.2.0",
|
||||||
"monaco-editor-core": "0.34.0-dev.20220720",
|
"monaco-editor-core": "0.35.0-dev.20221018.2",
|
||||||
|
"parcel": "^2.7.0",
|
||||||
"playwright": "^1.18.1",
|
"playwright": "^1.18.1",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"pretty-quick": "^3.1.3",
|
"pretty-quick": "^3.1.3",
|
||||||
|
|
@ -68,5 +69,9 @@
|
||||||
"vscode-uri": "3.0.3",
|
"vscode-uri": "3.0.3",
|
||||||
"webpack": "^5.74.0",
|
"webpack": "^5.74.0",
|
||||||
"yaserver": "^0.4.0"
|
"yaserver": "^0.4.0"
|
||||||
|
},
|
||||||
|
"alias": {
|
||||||
|
"process": false,
|
||||||
|
"buffer": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,7 @@ export function create(ctx: worker.IWorkerContext, createData: ICreateData): Typ
|
||||||
'Monaco is not using webworkers for background tasks, and that is needed to support the customWorkerPath flag'
|
'Monaco is not using webworkers for background tasks, and that is needed to support the customWorkerPath flag'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
importScripts(createData.customWorkerPath);
|
self.importScripts(createData.customWorkerPath);
|
||||||
|
|
||||||
const workerFactoryFunc: CustomTSWebWorkerFactory | undefined = self.customTSWorkerFactory;
|
const workerFactoryFunc: CustomTSWebWorkerFactory | undefined = self.customTSWorkerFactory;
|
||||||
if (!workerFactoryFunc) {
|
if (!workerFactoryFunc) {
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,5 @@
|
||||||
exports.__nothing = undefined;
|
exports.__nothing = undefined;
|
||||||
|
|
||||||
/** @typedef {'chromium'|'firefox'|'webkit'} BrowserKind */
|
/** @typedef {'chromium'|'firefox'|'webkit'} BrowserKind */
|
||||||
/** @typedef {'amd'|'webpack'|'esbuild'|'vite'} PackagerKind */
|
/** @typedef {'amd'|'webpack'|'esbuild'|'vite'|'parcel'} PackagerKind */
|
||||||
/** @typedef {{browser:BrowserKind; packager:PackagerKind; debugTests:boolean; port:number;}} TestInfo */
|
/** @typedef {{browser:BrowserKind; packager:PackagerKind; debugTests:boolean; port:number;}} TestInfo */
|
||||||
|
|
|
||||||
11
test/smoke/parcel/index.html
Normal file
11
test/smoke/parcel/index.html
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="editor-container" style="width: 800px; height: 600px; border: 1px solid #ccc"></div>
|
||||||
|
|
||||||
|
<script type="module" src="index.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
35
test/smoke/parcel/index.js
Normal file
35
test/smoke/parcel/index.js
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
import * as monaco from '../../../release/esm/vs/editor/editor.main.js';
|
||||||
|
|
||||||
|
self.MonacoEnvironment = {
|
||||||
|
getWorker: function (moduleId, label) {
|
||||||
|
if (label === 'json') {
|
||||||
|
return new Worker(
|
||||||
|
new URL('../../../release/esm/vs/language/json/json.worker.js', import.meta.url),
|
||||||
|
{ type: 'module' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||||
|
return new Worker(
|
||||||
|
new URL('../../../release/esm/vs/language/css/css.worker.js', import.meta.url),
|
||||||
|
{ type: 'module' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||||
|
return new Worker(
|
||||||
|
new URL('../../../release/esm/vs/language/html/html.worker.js', import.meta.url),
|
||||||
|
{ type: 'module' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (label === 'typescript' || label === 'javascript') {
|
||||||
|
return new Worker(
|
||||||
|
new URL('../../../release/esm/vs/language/typescript/ts.worker.js', import.meta.url),
|
||||||
|
{ type: 'module' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return new Worker(new URL('../../../release/esm/vs/editor/editor.worker.js', import.meta.url), {
|
||||||
|
type: 'module'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.monacoAPI = monaco;
|
||||||
6
test/smoke/parcel/package.json
Normal file
6
test/smoke/parcel/package.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"name": "parcel-smoketest",
|
||||||
|
"scripts": {
|
||||||
|
"package-for-smoketest-parcel": "parcel build ./index.html --cache-dir ./.cache --public-url /test/smoke/parcel/dist/ --no-optimize"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -42,7 +42,7 @@ async function runTests() {
|
||||||
// uncomment to shortcircuit and run a specific combo
|
// uncomment to shortcircuit and run a specific combo
|
||||||
// await runTest('webpack', 'chromium'); return;
|
// await runTest('webpack', 'chromium'); return;
|
||||||
/** @type {PackagerKind[]} */
|
/** @type {PackagerKind[]} */
|
||||||
const testTypes = ['amd', 'webpack', 'esbuild', 'vite'];
|
const testTypes = ['amd', 'webpack', 'esbuild', 'vite', 'parcel'];
|
||||||
|
|
||||||
for (const type of testTypes) {
|
for (const type of testTypes) {
|
||||||
await runTest(type, 'chromium');
|
await runTest(type, 'chromium');
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@ const URLS = {
|
||||||
amd: `http://127.0.0.1:${testInfo.port}/test/smoke/amd/index.html`,
|
amd: `http://127.0.0.1:${testInfo.port}/test/smoke/amd/index.html`,
|
||||||
webpack: `http://127.0.0.1:${testInfo.port}/test/smoke/webpack/index.html`,
|
webpack: `http://127.0.0.1:${testInfo.port}/test/smoke/webpack/index.html`,
|
||||||
esbuild: `http://127.0.0.1:${testInfo.port}/test/smoke/esbuild/index.html`,
|
esbuild: `http://127.0.0.1:${testInfo.port}/test/smoke/esbuild/index.html`,
|
||||||
vite: `http://127.0.0.1:${testInfo.port}/test/smoke/vite/dist/index.html`
|
vite: `http://127.0.0.1:${testInfo.port}/test/smoke/vite/dist/index.html`,
|
||||||
|
parcel: `http://127.0.0.1:${testInfo.port}/test/smoke/parcel/dist/index.html`
|
||||||
};
|
};
|
||||||
const URL = URLS[testInfo.packager];
|
const URL = URLS[testInfo.packager];
|
||||||
|
|
||||||
|
|
@ -107,11 +108,11 @@ suite(`Smoke Test '${testInfo.packager}' on '${testInfo.browser}'`, () => {
|
||||||
await page.evaluate(`window.ed.focus();`);
|
await page.evaluate(`window.ed.focus();`);
|
||||||
}
|
}
|
||||||
|
|
||||||
test('`monacoAPI` is exposed as global', async () => {
|
test('`monacoAPI` is exposed as global', async function () {
|
||||||
assert.strictEqual(await page.evaluate(`typeof monacoAPI`), 'object');
|
assert.strictEqual(await page.evaluate(`typeof monacoAPI`), 'object');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should be able to create plaintext editor', async () => {
|
test('should be able to create plaintext editor', async function () {
|
||||||
await createEditor('hello world', 'plaintext');
|
await createEditor('hello world', 'plaintext');
|
||||||
|
|
||||||
// type a link in it
|
// type a link in it
|
||||||
|
|
@ -122,14 +123,14 @@ suite(`Smoke Test '${testInfo.packager}' on '${testInfo.browser}'`, () => {
|
||||||
await page.waitForSelector('.detected-link');
|
await page.waitForSelector('.detected-link');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('css smoke test', async () => {
|
test('css smoke test', async function () {
|
||||||
await createEditor('.sel1 { background: red; }\\n.sel2 {}', 'css');
|
await createEditor('.sel1 { background: red; }\\n.sel2 {}', 'css');
|
||||||
|
|
||||||
// check that a squiggle appears, which indicates that the language service is up and running
|
// check that a squiggle appears, which indicates that the language service is up and running
|
||||||
await page.waitForSelector('.squiggly-warning');
|
await page.waitForSelector('.squiggly-warning');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('html smoke test', async () => {
|
test('html smoke test', async function () {
|
||||||
await createEditor('<title>hi</title>', 'html');
|
await createEditor('<title>hi</title>', 'html');
|
||||||
|
|
||||||
// we need to try this a couple of times because the web worker might not be ready yet
|
// we need to try this a couple of times because the web worker might not be ready yet
|
||||||
|
|
@ -151,7 +152,7 @@ suite(`Smoke Test '${testInfo.packager}' on '${testInfo.browser}'`, () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('json smoke test', async () => {
|
test('json smoke test', async function () {
|
||||||
await createEditor('{}', 'json');
|
await createEditor('{}', 'json');
|
||||||
|
|
||||||
// we need to try this a couple of times because the web worker might not be ready yet
|
// we need to try this a couple of times because the web worker might not be ready yet
|
||||||
|
|
@ -168,7 +169,7 @@ suite(`Smoke Test '${testInfo.packager}' on '${testInfo.browser}'`, () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('typescript smoke test', async () => {
|
test('typescript smoke test', async function () {
|
||||||
await createEditor('window.add', 'typescript');
|
await createEditor('window.add', 'typescript');
|
||||||
|
|
||||||
// check that a squiggle appears, which indicates that the language service is up and running
|
// check that a squiggle appears, which indicates that the language service is up and running
|
||||||
|
|
|
||||||
|
|
@ -705,6 +705,10 @@ declare namespace monaco {
|
||||||
* Create a new empty range using this range's start position.
|
* Create a new empty range using this range's start position.
|
||||||
*/
|
*/
|
||||||
collapseToStart(): Range;
|
collapseToStart(): Range;
|
||||||
|
/**
|
||||||
|
* Moves the range by the given amount of lines.
|
||||||
|
*/
|
||||||
|
delta(lineCount: number): Range;
|
||||||
/**
|
/**
|
||||||
* Create a new empty range using this range's start position.
|
* Create a new empty range using this range's start position.
|
||||||
*/
|
*/
|
||||||
|
|
@ -926,6 +930,50 @@ declare namespace monaco.editor {
|
||||||
|
|
||||||
export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator;
|
export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description of a command contribution
|
||||||
|
*/
|
||||||
|
export interface ICommandDescriptor {
|
||||||
|
/**
|
||||||
|
* An unique identifier of the contributed command.
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* Callback that will be executed when the command is triggered.
|
||||||
|
*/
|
||||||
|
run: ICommandHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a command.
|
||||||
|
*/
|
||||||
|
export function addCommand(descriptor: ICommandDescriptor): IDisposable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an action to all editors.
|
||||||
|
*/
|
||||||
|
export function addEditorAction(descriptor: IActionDescriptor): IDisposable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A keybinding rule.
|
||||||
|
*/
|
||||||
|
export interface IKeybindingRule {
|
||||||
|
keybinding: number;
|
||||||
|
command?: string | null;
|
||||||
|
commandArgs?: any;
|
||||||
|
when?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a keybinding rule.
|
||||||
|
*/
|
||||||
|
export function addKeybindingRule(rule: IKeybindingRule): IDisposable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add keybinding rules.
|
||||||
|
*/
|
||||||
|
export function addKeybindingRules(rules: IKeybindingRule[]): IDisposable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new editor model.
|
* Create a new editor model.
|
||||||
* You can specify the language that should be set for this model or let the language be inferred from the `uri`.
|
* You can specify the language that should be set for this model or let the language be inferred from the `uri`.
|
||||||
|
|
@ -1489,6 +1537,11 @@ declare namespace monaco.editor {
|
||||||
*/
|
*/
|
||||||
className?: string | null;
|
className?: string | null;
|
||||||
blockClassName?: string | null;
|
blockClassName?: string | null;
|
||||||
|
/**
|
||||||
|
* Indicates if this block should be rendered after the last line.
|
||||||
|
* In this case, the range must be empty and set to the last line.
|
||||||
|
*/
|
||||||
|
blockIsAfterEnd?: boolean | null;
|
||||||
/**
|
/**
|
||||||
* Message to be rendered when hovering over the glyph margin decoration.
|
* Message to be rendered when hovering over the glyph margin decoration.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1501,6 +1554,10 @@ declare namespace monaco.editor {
|
||||||
* Should the decoration expand to encompass a whole line.
|
* Should the decoration expand to encompass a whole line.
|
||||||
*/
|
*/
|
||||||
isWholeLine?: boolean;
|
isWholeLine?: boolean;
|
||||||
|
/**
|
||||||
|
* Always render the decoration (even when the range it encompasses is collapsed).
|
||||||
|
*/
|
||||||
|
showIfCollapsed?: boolean;
|
||||||
/**
|
/**
|
||||||
* Specifies the stack order of a decoration.
|
* Specifies the stack order of a decoration.
|
||||||
* A decoration with greater stack order is always in front of a decoration with
|
* A decoration with greater stack order is always in front of a decoration with
|
||||||
|
|
@ -1743,6 +1800,15 @@ declare namespace monaco.editor {
|
||||||
GrowsOnlyWhenTypingAfter = 3
|
GrowsOnlyWhenTypingAfter = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Text snapshot that works like an iterator.
|
||||||
|
* Will try to return chunks of roughly ~64KB size.
|
||||||
|
* Will return null when finished.
|
||||||
|
*/
|
||||||
|
export interface ITextSnapshot {
|
||||||
|
read(): string | null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A model.
|
* A model.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1774,7 +1840,7 @@ declare namespace monaco.editor {
|
||||||
/**
|
/**
|
||||||
* Replace the entire text buffer value contained in this model.
|
* Replace the entire text buffer value contained in this model.
|
||||||
*/
|
*/
|
||||||
setValue(newValue: string): void;
|
setValue(newValue: string | ITextSnapshot): void;
|
||||||
/**
|
/**
|
||||||
* Get the text stored in this model.
|
* Get the text stored in this model.
|
||||||
* @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`.
|
* @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`.
|
||||||
|
|
@ -1782,6 +1848,12 @@ declare namespace monaco.editor {
|
||||||
* @return The text.
|
* @return The text.
|
||||||
*/
|
*/
|
||||||
getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string;
|
getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string;
|
||||||
|
/**
|
||||||
|
* Get the text stored in this model.
|
||||||
|
* @param preserverBOM Preserve a BOM character if it was detected when the model was constructed.
|
||||||
|
* @return The text snapshot (it is safe to consume it asynchronously).
|
||||||
|
*/
|
||||||
|
createSnapshot(preserveBOM?: boolean): ITextSnapshot;
|
||||||
/**
|
/**
|
||||||
* Get the length of the text stored in this model.
|
* Get the length of the text stored in this model.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2000,7 +2072,7 @@ declare namespace monaco.editor {
|
||||||
* @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
|
* @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
|
||||||
* @return An array with the decorations
|
* @return An array with the decorations
|
||||||
*/
|
*/
|
||||||
getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];
|
getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean, onlyMinimapDecorations?: boolean): IModelDecoration[];
|
||||||
/**
|
/**
|
||||||
* Gets all the decorations as an array.
|
* Gets all the decorations as an array.
|
||||||
* @param ownerId If set, it will ignore decorations belonging to other owners.
|
* @param ownerId If set, it will ignore decorations belonging to other owners.
|
||||||
|
|
@ -2616,6 +2688,10 @@ declare namespace monaco.editor {
|
||||||
* New language
|
* New language
|
||||||
*/
|
*/
|
||||||
readonly newLanguage: string;
|
readonly newLanguage: string;
|
||||||
|
/**
|
||||||
|
* Source of the call that caused the event.
|
||||||
|
*/
|
||||||
|
readonly source: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2936,6 +3012,10 @@ declare namespace monaco.editor {
|
||||||
* Control the behavior and rendering of the scrollbars.
|
* Control the behavior and rendering of the scrollbars.
|
||||||
*/
|
*/
|
||||||
scrollbar?: IEditorScrollbarOptions;
|
scrollbar?: IEditorScrollbarOptions;
|
||||||
|
/**
|
||||||
|
* Control the behavior of sticky scroll options
|
||||||
|
*/
|
||||||
|
stickyScroll?: IEditorStickyScrollOptions;
|
||||||
/**
|
/**
|
||||||
* Control the behavior and rendering of the minimap.
|
* Control the behavior and rendering of the minimap.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3025,8 +3105,7 @@ declare namespace monaco.editor {
|
||||||
*/
|
*/
|
||||||
smoothScrolling?: boolean;
|
smoothScrolling?: boolean;
|
||||||
/**
|
/**
|
||||||
* Enable that the editor will install an interval to check if its container dom node size has changed.
|
* Enable that the editor will install a ResizeObserver to check if its container dom node size has changed.
|
||||||
* Enabling this might have a severe performance impact.
|
|
||||||
* Defaults to false.
|
* Defaults to false.
|
||||||
*/
|
*/
|
||||||
automaticLayout?: boolean;
|
automaticLayout?: boolean;
|
||||||
|
|
@ -3403,6 +3482,10 @@ declare namespace monaco.editor {
|
||||||
* Controls strikethrough deprecated variables.
|
* Controls strikethrough deprecated variables.
|
||||||
*/
|
*/
|
||||||
showDeprecated?: boolean;
|
showDeprecated?: boolean;
|
||||||
|
/**
|
||||||
|
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
|
||||||
|
*/
|
||||||
|
matchOnWordStartOnly?: boolean;
|
||||||
/**
|
/**
|
||||||
* Control the behavior and rendering of the inline hints.
|
* Control the behavior and rendering of the inline hints.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3425,11 +3508,11 @@ declare namespace monaco.editor {
|
||||||
*/
|
*/
|
||||||
bracketPairColorization?: IBracketPairColorizationOptions;
|
bracketPairColorization?: IBracketPairColorizationOptions;
|
||||||
/**
|
/**
|
||||||
* Enables dropping into the editor from an external source.
|
* Controls dropping into the editor from an external source.
|
||||||
*
|
*
|
||||||
* This shows a preview of the drop location and triggers an `onDropIntoEditor` event.
|
* When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event.
|
||||||
*/
|
*/
|
||||||
enableDropIntoEditor?: boolean;
|
dropIntoEditor?: IDropIntoEditorOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDiffEditorBaseOptions {
|
export interface IDiffEditorBaseOptions {
|
||||||
|
|
@ -3487,6 +3570,10 @@ declare namespace monaco.editor {
|
||||||
* Control the wrapping of the diff editor.
|
* Control the wrapping of the diff editor.
|
||||||
*/
|
*/
|
||||||
diffWordWrap?: 'off' | 'on' | 'inherit';
|
diffWordWrap?: 'off' | 'on' | 'inherit';
|
||||||
|
/**
|
||||||
|
* Diff Algorithm
|
||||||
|
*/
|
||||||
|
diffAlgorithm?: 'smart' | 'experimental';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3794,6 +3881,17 @@ declare namespace monaco.editor {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IEditorStickyScrollOptions {
|
||||||
|
/**
|
||||||
|
* Enable the sticky scroll
|
||||||
|
*/
|
||||||
|
enabled?: boolean;
|
||||||
|
/**
|
||||||
|
* Maximum number of sticky lines to show
|
||||||
|
*/
|
||||||
|
maxLineCount?: number;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration options for editor inlayHints
|
* Configuration options for editor inlayHints
|
||||||
*/
|
*/
|
||||||
|
|
@ -4175,6 +4273,10 @@ declare namespace monaco.editor {
|
||||||
* Show deprecated-suggestions.
|
* Show deprecated-suggestions.
|
||||||
*/
|
*/
|
||||||
showDeprecated?: boolean;
|
showDeprecated?: boolean;
|
||||||
|
/**
|
||||||
|
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
|
||||||
|
*/
|
||||||
|
matchOnWordStartOnly?: boolean;
|
||||||
/**
|
/**
|
||||||
* Show field-suggestions.
|
* Show field-suggestions.
|
||||||
*/
|
*/
|
||||||
|
|
@ -4306,6 +4408,17 @@ declare namespace monaco.editor {
|
||||||
readonly wrappingColumn: number;
|
readonly wrappingColumn: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration options for editor drop into behavior
|
||||||
|
*/
|
||||||
|
export interface IDropIntoEditorOptions {
|
||||||
|
/**
|
||||||
|
* Enable the dropping into editor.
|
||||||
|
* Defaults to true.
|
||||||
|
*/
|
||||||
|
enabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export enum EditorOption {
|
export enum EditorOption {
|
||||||
acceptSuggestionOnCommitCharacter = 0,
|
acceptSuggestionOnCommitCharacter = 0,
|
||||||
acceptSuggestionOnEnter = 1,
|
acceptSuggestionOnEnter = 1,
|
||||||
|
|
@ -4339,7 +4452,7 @@ declare namespace monaco.editor {
|
||||||
disableMonospaceOptimizations = 29,
|
disableMonospaceOptimizations = 29,
|
||||||
domReadOnly = 30,
|
domReadOnly = 30,
|
||||||
dragAndDrop = 31,
|
dragAndDrop = 31,
|
||||||
enableDropIntoEditor = 32,
|
dropIntoEditor = 32,
|
||||||
emptySelectionClipboard = 33,
|
emptySelectionClipboard = 33,
|
||||||
extraEditorClassName = 34,
|
extraEditorClassName = 34,
|
||||||
fastScrollSensitivity = 35,
|
fastScrollSensitivity = 35,
|
||||||
|
|
@ -4412,35 +4525,36 @@ declare namespace monaco.editor {
|
||||||
snippetSuggestions = 102,
|
snippetSuggestions = 102,
|
||||||
smartSelect = 103,
|
smartSelect = 103,
|
||||||
smoothScrolling = 104,
|
smoothScrolling = 104,
|
||||||
stickyTabStops = 105,
|
stickyScroll = 105,
|
||||||
stopRenderingLineAfter = 106,
|
stickyTabStops = 106,
|
||||||
suggest = 107,
|
stopRenderingLineAfter = 107,
|
||||||
suggestFontSize = 108,
|
suggest = 108,
|
||||||
suggestLineHeight = 109,
|
suggestFontSize = 109,
|
||||||
suggestOnTriggerCharacters = 110,
|
suggestLineHeight = 110,
|
||||||
suggestSelection = 111,
|
suggestOnTriggerCharacters = 111,
|
||||||
tabCompletion = 112,
|
suggestSelection = 112,
|
||||||
tabIndex = 113,
|
tabCompletion = 113,
|
||||||
unicodeHighlighting = 114,
|
tabIndex = 114,
|
||||||
unusualLineTerminators = 115,
|
unicodeHighlighting = 115,
|
||||||
useShadowDOM = 116,
|
unusualLineTerminators = 116,
|
||||||
useTabStops = 117,
|
useShadowDOM = 117,
|
||||||
wordSeparators = 118,
|
useTabStops = 118,
|
||||||
wordWrap = 119,
|
wordSeparators = 119,
|
||||||
wordWrapBreakAfterCharacters = 120,
|
wordWrap = 120,
|
||||||
wordWrapBreakBeforeCharacters = 121,
|
wordWrapBreakAfterCharacters = 121,
|
||||||
wordWrapColumn = 122,
|
wordWrapBreakBeforeCharacters = 122,
|
||||||
wordWrapOverride1 = 123,
|
wordWrapColumn = 123,
|
||||||
wordWrapOverride2 = 124,
|
wordWrapOverride1 = 124,
|
||||||
wrappingIndent = 125,
|
wordWrapOverride2 = 125,
|
||||||
wrappingStrategy = 126,
|
wrappingIndent = 126,
|
||||||
showDeprecated = 127,
|
wrappingStrategy = 127,
|
||||||
inlayHints = 128,
|
showDeprecated = 128,
|
||||||
editorClassName = 129,
|
inlayHints = 129,
|
||||||
pixelRatio = 130,
|
editorClassName = 130,
|
||||||
tabFocusMode = 131,
|
pixelRatio = 131,
|
||||||
layoutInfo = 132,
|
tabFocusMode = 132,
|
||||||
wrappingInfo = 133
|
layoutInfo = 133,
|
||||||
|
wrappingInfo = 134
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EditorOptions: {
|
export const EditorOptions: {
|
||||||
|
|
@ -4478,7 +4592,8 @@ declare namespace monaco.editor {
|
||||||
domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>;
|
domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>;
|
||||||
dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
|
dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
|
||||||
emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
|
emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
|
||||||
enableDropIntoEditor: IEditorOption<EditorOption.enableDropIntoEditor, boolean>;
|
dropIntoEditor: IEditorOption<EditorOption.dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>>>;
|
||||||
|
stickyScroll: IEditorOption<EditorOption.stickyScroll, Readonly<Required<IEditorStickyScrollOptions>>>;
|
||||||
extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
|
extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
|
||||||
fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>;
|
fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>;
|
||||||
find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>;
|
find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>;
|
||||||
|
|
@ -4984,6 +5099,8 @@ declare namespace monaco.editor {
|
||||||
|
|
||||||
export interface IMouseTargetOutsideEditor extends IBaseMouseTarget {
|
export interface IMouseTargetOutsideEditor extends IBaseMouseTarget {
|
||||||
readonly type: MouseTargetType.OUTSIDE_EDITOR;
|
readonly type: MouseTargetType.OUTSIDE_EDITOR;
|
||||||
|
readonly outsidePosition: 'above' | 'below' | 'left' | 'right';
|
||||||
|
readonly outsideDistance: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5278,7 +5395,7 @@ declare namespace monaco.editor {
|
||||||
* @id Unique identifier of the contribution.
|
* @id Unique identifier of the contribution.
|
||||||
* @return The action or null if action not found.
|
* @return The action or null if action not found.
|
||||||
*/
|
*/
|
||||||
getAction(id: string): IEditorAction;
|
getAction(id: string): IEditorAction | null;
|
||||||
/**
|
/**
|
||||||
* Execute a command on the editor.
|
* Execute a command on the editor.
|
||||||
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
|
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
|
||||||
|
|
@ -5335,9 +5452,13 @@ declare namespace monaco.editor {
|
||||||
*/
|
*/
|
||||||
getVisibleRanges(): Range[];
|
getVisibleRanges(): Range[];
|
||||||
/**
|
/**
|
||||||
* Get the vertical position (top offset) for the line w.r.t. to the first line.
|
* Get the vertical position (top offset) for the line's top w.r.t. to the first line.
|
||||||
*/
|
*/
|
||||||
getTopForLineNumber(lineNumber: number): number;
|
getTopForLineNumber(lineNumber: number): number;
|
||||||
|
/**
|
||||||
|
* Get the vertical position (top offset) for the line's bottom w.r.t. to the first line.
|
||||||
|
*/
|
||||||
|
getBottomForLineNumber(lineNumber: number): number;
|
||||||
/**
|
/**
|
||||||
* Get the vertical position (top offset) for the position w.r.t. to the first line.
|
* Get the vertical position (top offset) for the position w.r.t. to the first line.
|
||||||
*/
|
*/
|
||||||
|
|
@ -5436,6 +5557,11 @@ declare namespace monaco.editor {
|
||||||
* @event
|
* @event
|
||||||
*/
|
*/
|
||||||
readonly onDidUpdateDiff: IEvent<void>;
|
readonly onDidUpdateDiff: IEvent<void>;
|
||||||
|
/**
|
||||||
|
* An event emitted when the diff model is changed (i.e. the diff editor shows new content).
|
||||||
|
* @event
|
||||||
|
*/
|
||||||
|
readonly onDidChangeModel: IEvent<void>;
|
||||||
/**
|
/**
|
||||||
* Saves current view state of the editor in a serializable object.
|
* Saves current view state of the editor in a serializable object.
|
||||||
*/
|
*/
|
||||||
|
|
@ -5838,6 +5964,10 @@ declare namespace monaco.languages {
|
||||||
* Requested kind of actions to return.
|
* Requested kind of actions to return.
|
||||||
*/
|
*/
|
||||||
readonly only?: string;
|
readonly only?: string;
|
||||||
|
/**
|
||||||
|
* The reason why code actions were requested.
|
||||||
|
*/
|
||||||
|
readonly trigger: CodeActionTriggerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5868,6 +5998,10 @@ declare namespace monaco.languages {
|
||||||
* such as `["quickfix.removeLine", "source.fixAll" ...]`.
|
* such as `["quickfix.removeLine", "source.fixAll" ...]`.
|
||||||
*/
|
*/
|
||||||
readonly providedCodeActionKinds?: readonly string[];
|
readonly providedCodeActionKinds?: readonly string[];
|
||||||
|
readonly documentation?: ReadonlyArray<{
|
||||||
|
readonly kind: string;
|
||||||
|
readonly command: Command;
|
||||||
|
}>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -6440,6 +6574,11 @@ declare namespace monaco.languages {
|
||||||
disabled?: string;
|
disabled?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum CodeActionTriggerType {
|
||||||
|
Invoke = 1,
|
||||||
|
Auto = 2
|
||||||
|
}
|
||||||
|
|
||||||
export interface CodeActionList extends IDisposable {
|
export interface CodeActionList extends IDisposable {
|
||||||
readonly actions: ReadonlyArray<CodeAction>;
|
readonly actions: ReadonlyArray<CodeAction>;
|
||||||
}
|
}
|
||||||
|
|
@ -6776,11 +6915,11 @@ declare namespace monaco.languages {
|
||||||
provideDocumentSymbols(model: editor.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
|
provideDocumentSymbols(model: editor.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TextEdit = {
|
export interface TextEdit {
|
||||||
range: IRange;
|
range: IRange;
|
||||||
text: string;
|
text: string;
|
||||||
eol?: editor.EndOfLineSequence;
|
eol?: editor.EndOfLineSequence;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface used to format a model
|
* Interface used to format a model
|
||||||
|
|
@ -7018,6 +7157,7 @@ declare namespace monaco.languages {
|
||||||
folder?: boolean;
|
folder?: boolean;
|
||||||
skipTrashBin?: boolean;
|
skipTrashBin?: boolean;
|
||||||
maxSize?: number;
|
maxSize?: number;
|
||||||
|
contentsBase64?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IWorkspaceFileEdit {
|
export interface IWorkspaceFileEdit {
|
||||||
|
|
|
||||||
222
website/typedoc/monaco.d.ts
vendored
222
website/typedoc/monaco.d.ts
vendored
|
|
@ -705,6 +705,10 @@ declare namespace monaco {
|
||||||
* Create a new empty range using this range's start position.
|
* Create a new empty range using this range's start position.
|
||||||
*/
|
*/
|
||||||
collapseToStart(): Range;
|
collapseToStart(): Range;
|
||||||
|
/**
|
||||||
|
* Moves the range by the given amount of lines.
|
||||||
|
*/
|
||||||
|
delta(lineCount: number): Range;
|
||||||
/**
|
/**
|
||||||
* Create a new empty range using this range's start position.
|
* Create a new empty range using this range's start position.
|
||||||
*/
|
*/
|
||||||
|
|
@ -926,6 +930,50 @@ declare namespace monaco.editor {
|
||||||
|
|
||||||
export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator;
|
export function createDiffNavigator(diffEditor: IStandaloneDiffEditor, opts?: IDiffNavigatorOptions): IDiffNavigator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description of a command contribution
|
||||||
|
*/
|
||||||
|
export interface ICommandDescriptor {
|
||||||
|
/**
|
||||||
|
* An unique identifier of the contributed command.
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* Callback that will be executed when the command is triggered.
|
||||||
|
*/
|
||||||
|
run: ICommandHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a command.
|
||||||
|
*/
|
||||||
|
export function addCommand(descriptor: ICommandDescriptor): IDisposable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an action to all editors.
|
||||||
|
*/
|
||||||
|
export function addEditorAction(descriptor: IActionDescriptor): IDisposable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A keybinding rule.
|
||||||
|
*/
|
||||||
|
export interface IKeybindingRule {
|
||||||
|
keybinding: number;
|
||||||
|
command?: string | null;
|
||||||
|
commandArgs?: any;
|
||||||
|
when?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a keybinding rule.
|
||||||
|
*/
|
||||||
|
export function addKeybindingRule(rule: IKeybindingRule): IDisposable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add keybinding rules.
|
||||||
|
*/
|
||||||
|
export function addKeybindingRules(rules: IKeybindingRule[]): IDisposable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new editor model.
|
* Create a new editor model.
|
||||||
* You can specify the language that should be set for this model or let the language be inferred from the `uri`.
|
* You can specify the language that should be set for this model or let the language be inferred from the `uri`.
|
||||||
|
|
@ -1489,6 +1537,11 @@ declare namespace monaco.editor {
|
||||||
*/
|
*/
|
||||||
className?: string | null;
|
className?: string | null;
|
||||||
blockClassName?: string | null;
|
blockClassName?: string | null;
|
||||||
|
/**
|
||||||
|
* Indicates if this block should be rendered after the last line.
|
||||||
|
* In this case, the range must be empty and set to the last line.
|
||||||
|
*/
|
||||||
|
blockIsAfterEnd?: boolean | null;
|
||||||
/**
|
/**
|
||||||
* Message to be rendered when hovering over the glyph margin decoration.
|
* Message to be rendered when hovering over the glyph margin decoration.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1501,6 +1554,10 @@ declare namespace monaco.editor {
|
||||||
* Should the decoration expand to encompass a whole line.
|
* Should the decoration expand to encompass a whole line.
|
||||||
*/
|
*/
|
||||||
isWholeLine?: boolean;
|
isWholeLine?: boolean;
|
||||||
|
/**
|
||||||
|
* Always render the decoration (even when the range it encompasses is collapsed).
|
||||||
|
*/
|
||||||
|
showIfCollapsed?: boolean;
|
||||||
/**
|
/**
|
||||||
* Specifies the stack order of a decoration.
|
* Specifies the stack order of a decoration.
|
||||||
* A decoration with greater stack order is always in front of a decoration with
|
* A decoration with greater stack order is always in front of a decoration with
|
||||||
|
|
@ -1743,6 +1800,15 @@ declare namespace monaco.editor {
|
||||||
GrowsOnlyWhenTypingAfter = 3
|
GrowsOnlyWhenTypingAfter = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Text snapshot that works like an iterator.
|
||||||
|
* Will try to return chunks of roughly ~64KB size.
|
||||||
|
* Will return null when finished.
|
||||||
|
*/
|
||||||
|
export interface ITextSnapshot {
|
||||||
|
read(): string | null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A model.
|
* A model.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1774,7 +1840,7 @@ declare namespace monaco.editor {
|
||||||
/**
|
/**
|
||||||
* Replace the entire text buffer value contained in this model.
|
* Replace the entire text buffer value contained in this model.
|
||||||
*/
|
*/
|
||||||
setValue(newValue: string): void;
|
setValue(newValue: string | ITextSnapshot): void;
|
||||||
/**
|
/**
|
||||||
* Get the text stored in this model.
|
* Get the text stored in this model.
|
||||||
* @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`.
|
* @param eol The end of line character preference. Defaults to `EndOfLinePreference.TextDefined`.
|
||||||
|
|
@ -1782,6 +1848,12 @@ declare namespace monaco.editor {
|
||||||
* @return The text.
|
* @return The text.
|
||||||
*/
|
*/
|
||||||
getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string;
|
getValue(eol?: EndOfLinePreference, preserveBOM?: boolean): string;
|
||||||
|
/**
|
||||||
|
* Get the text stored in this model.
|
||||||
|
* @param preserverBOM Preserve a BOM character if it was detected when the model was constructed.
|
||||||
|
* @return The text snapshot (it is safe to consume it asynchronously).
|
||||||
|
*/
|
||||||
|
createSnapshot(preserveBOM?: boolean): ITextSnapshot;
|
||||||
/**
|
/**
|
||||||
* Get the length of the text stored in this model.
|
* Get the length of the text stored in this model.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2000,7 +2072,7 @@ declare namespace monaco.editor {
|
||||||
* @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
|
* @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
|
||||||
* @return An array with the decorations
|
* @return An array with the decorations
|
||||||
*/
|
*/
|
||||||
getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];
|
getDecorationsInRange(range: IRange, ownerId?: number, filterOutValidation?: boolean, onlyMinimapDecorations?: boolean): IModelDecoration[];
|
||||||
/**
|
/**
|
||||||
* Gets all the decorations as an array.
|
* Gets all the decorations as an array.
|
||||||
* @param ownerId If set, it will ignore decorations belonging to other owners.
|
* @param ownerId If set, it will ignore decorations belonging to other owners.
|
||||||
|
|
@ -2616,6 +2688,10 @@ declare namespace monaco.editor {
|
||||||
* New language
|
* New language
|
||||||
*/
|
*/
|
||||||
readonly newLanguage: string;
|
readonly newLanguage: string;
|
||||||
|
/**
|
||||||
|
* Source of the call that caused the event.
|
||||||
|
*/
|
||||||
|
readonly source: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2936,6 +3012,10 @@ declare namespace monaco.editor {
|
||||||
* Control the behavior and rendering of the scrollbars.
|
* Control the behavior and rendering of the scrollbars.
|
||||||
*/
|
*/
|
||||||
scrollbar?: IEditorScrollbarOptions;
|
scrollbar?: IEditorScrollbarOptions;
|
||||||
|
/**
|
||||||
|
* Control the behavior of sticky scroll options
|
||||||
|
*/
|
||||||
|
stickyScroll?: IEditorStickyScrollOptions;
|
||||||
/**
|
/**
|
||||||
* Control the behavior and rendering of the minimap.
|
* Control the behavior and rendering of the minimap.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3026,7 +3106,6 @@ declare namespace monaco.editor {
|
||||||
smoothScrolling?: boolean;
|
smoothScrolling?: boolean;
|
||||||
/**
|
/**
|
||||||
* Enable that the editor will install a ResizeObserver to check if its container dom node size has changed.
|
* Enable that the editor will install a ResizeObserver to check if its container dom node size has changed.
|
||||||
* Enabling this might have a severe performance impact.
|
|
||||||
* Defaults to false.
|
* Defaults to false.
|
||||||
*/
|
*/
|
||||||
automaticLayout?: boolean;
|
automaticLayout?: boolean;
|
||||||
|
|
@ -3403,6 +3482,10 @@ declare namespace monaco.editor {
|
||||||
* Controls strikethrough deprecated variables.
|
* Controls strikethrough deprecated variables.
|
||||||
*/
|
*/
|
||||||
showDeprecated?: boolean;
|
showDeprecated?: boolean;
|
||||||
|
/**
|
||||||
|
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
|
||||||
|
*/
|
||||||
|
matchOnWordStartOnly?: boolean;
|
||||||
/**
|
/**
|
||||||
* Control the behavior and rendering of the inline hints.
|
* Control the behavior and rendering of the inline hints.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3425,11 +3508,11 @@ declare namespace monaco.editor {
|
||||||
*/
|
*/
|
||||||
bracketPairColorization?: IBracketPairColorizationOptions;
|
bracketPairColorization?: IBracketPairColorizationOptions;
|
||||||
/**
|
/**
|
||||||
* Enables dropping into the editor from an external source.
|
* Controls dropping into the editor from an external source.
|
||||||
*
|
*
|
||||||
* This shows a preview of the drop location and triggers an `onDropIntoEditor` event.
|
* When enabled, this shows a preview of the drop location and triggers an `onDropIntoEditor` event.
|
||||||
*/
|
*/
|
||||||
enableDropIntoEditor?: boolean;
|
dropIntoEditor?: IDropIntoEditorOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDiffEditorBaseOptions {
|
export interface IDiffEditorBaseOptions {
|
||||||
|
|
@ -3487,6 +3570,10 @@ declare namespace monaco.editor {
|
||||||
* Control the wrapping of the diff editor.
|
* Control the wrapping of the diff editor.
|
||||||
*/
|
*/
|
||||||
diffWordWrap?: 'off' | 'on' | 'inherit';
|
diffWordWrap?: 'off' | 'on' | 'inherit';
|
||||||
|
/**
|
||||||
|
* Diff Algorithm
|
||||||
|
*/
|
||||||
|
diffAlgorithm?: 'smart' | 'experimental';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3794,6 +3881,17 @@ declare namespace monaco.editor {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IEditorStickyScrollOptions {
|
||||||
|
/**
|
||||||
|
* Enable the sticky scroll
|
||||||
|
*/
|
||||||
|
enabled?: boolean;
|
||||||
|
/**
|
||||||
|
* Maximum number of sticky lines to show
|
||||||
|
*/
|
||||||
|
maxLineCount?: number;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration options for editor inlayHints
|
* Configuration options for editor inlayHints
|
||||||
*/
|
*/
|
||||||
|
|
@ -4175,6 +4273,10 @@ declare namespace monaco.editor {
|
||||||
* Show deprecated-suggestions.
|
* Show deprecated-suggestions.
|
||||||
*/
|
*/
|
||||||
showDeprecated?: boolean;
|
showDeprecated?: boolean;
|
||||||
|
/**
|
||||||
|
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
|
||||||
|
*/
|
||||||
|
matchOnWordStartOnly?: boolean;
|
||||||
/**
|
/**
|
||||||
* Show field-suggestions.
|
* Show field-suggestions.
|
||||||
*/
|
*/
|
||||||
|
|
@ -4306,6 +4408,17 @@ declare namespace monaco.editor {
|
||||||
readonly wrappingColumn: number;
|
readonly wrappingColumn: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration options for editor drop into behavior
|
||||||
|
*/
|
||||||
|
export interface IDropIntoEditorOptions {
|
||||||
|
/**
|
||||||
|
* Enable the dropping into editor.
|
||||||
|
* Defaults to true.
|
||||||
|
*/
|
||||||
|
enabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export enum EditorOption {
|
export enum EditorOption {
|
||||||
acceptSuggestionOnCommitCharacter = 0,
|
acceptSuggestionOnCommitCharacter = 0,
|
||||||
acceptSuggestionOnEnter = 1,
|
acceptSuggestionOnEnter = 1,
|
||||||
|
|
@ -4339,7 +4452,7 @@ declare namespace monaco.editor {
|
||||||
disableMonospaceOptimizations = 29,
|
disableMonospaceOptimizations = 29,
|
||||||
domReadOnly = 30,
|
domReadOnly = 30,
|
||||||
dragAndDrop = 31,
|
dragAndDrop = 31,
|
||||||
enableDropIntoEditor = 32,
|
dropIntoEditor = 32,
|
||||||
emptySelectionClipboard = 33,
|
emptySelectionClipboard = 33,
|
||||||
extraEditorClassName = 34,
|
extraEditorClassName = 34,
|
||||||
fastScrollSensitivity = 35,
|
fastScrollSensitivity = 35,
|
||||||
|
|
@ -4412,35 +4525,36 @@ declare namespace monaco.editor {
|
||||||
snippetSuggestions = 102,
|
snippetSuggestions = 102,
|
||||||
smartSelect = 103,
|
smartSelect = 103,
|
||||||
smoothScrolling = 104,
|
smoothScrolling = 104,
|
||||||
stickyTabStops = 105,
|
stickyScroll = 105,
|
||||||
stopRenderingLineAfter = 106,
|
stickyTabStops = 106,
|
||||||
suggest = 107,
|
stopRenderingLineAfter = 107,
|
||||||
suggestFontSize = 108,
|
suggest = 108,
|
||||||
suggestLineHeight = 109,
|
suggestFontSize = 109,
|
||||||
suggestOnTriggerCharacters = 110,
|
suggestLineHeight = 110,
|
||||||
suggestSelection = 111,
|
suggestOnTriggerCharacters = 111,
|
||||||
tabCompletion = 112,
|
suggestSelection = 112,
|
||||||
tabIndex = 113,
|
tabCompletion = 113,
|
||||||
unicodeHighlighting = 114,
|
tabIndex = 114,
|
||||||
unusualLineTerminators = 115,
|
unicodeHighlighting = 115,
|
||||||
useShadowDOM = 116,
|
unusualLineTerminators = 116,
|
||||||
useTabStops = 117,
|
useShadowDOM = 117,
|
||||||
wordSeparators = 118,
|
useTabStops = 118,
|
||||||
wordWrap = 119,
|
wordSeparators = 119,
|
||||||
wordWrapBreakAfterCharacters = 120,
|
wordWrap = 120,
|
||||||
wordWrapBreakBeforeCharacters = 121,
|
wordWrapBreakAfterCharacters = 121,
|
||||||
wordWrapColumn = 122,
|
wordWrapBreakBeforeCharacters = 122,
|
||||||
wordWrapOverride1 = 123,
|
wordWrapColumn = 123,
|
||||||
wordWrapOverride2 = 124,
|
wordWrapOverride1 = 124,
|
||||||
wrappingIndent = 125,
|
wordWrapOverride2 = 125,
|
||||||
wrappingStrategy = 126,
|
wrappingIndent = 126,
|
||||||
showDeprecated = 127,
|
wrappingStrategy = 127,
|
||||||
inlayHints = 128,
|
showDeprecated = 128,
|
||||||
editorClassName = 129,
|
inlayHints = 129,
|
||||||
pixelRatio = 130,
|
editorClassName = 130,
|
||||||
tabFocusMode = 131,
|
pixelRatio = 131,
|
||||||
layoutInfo = 132,
|
tabFocusMode = 132,
|
||||||
wrappingInfo = 133
|
layoutInfo = 133,
|
||||||
|
wrappingInfo = 134
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EditorOptions: {
|
export const EditorOptions: {
|
||||||
|
|
@ -4478,7 +4592,8 @@ declare namespace monaco.editor {
|
||||||
domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>;
|
domReadOnly: IEditorOption<EditorOption.domReadOnly, boolean>;
|
||||||
dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
|
dragAndDrop: IEditorOption<EditorOption.dragAndDrop, boolean>;
|
||||||
emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
|
emptySelectionClipboard: IEditorOption<EditorOption.emptySelectionClipboard, boolean>;
|
||||||
enableDropIntoEditor: IEditorOption<EditorOption.enableDropIntoEditor, boolean>;
|
dropIntoEditor: IEditorOption<EditorOption.dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>>>;
|
||||||
|
stickyScroll: IEditorOption<EditorOption.stickyScroll, Readonly<Required<IEditorStickyScrollOptions>>>;
|
||||||
extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
|
extraEditorClassName: IEditorOption<EditorOption.extraEditorClassName, string>;
|
||||||
fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>;
|
fastScrollSensitivity: IEditorOption<EditorOption.fastScrollSensitivity, number>;
|
||||||
find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>;
|
find: IEditorOption<EditorOption.find, Readonly<Required<IEditorFindOptions>>>;
|
||||||
|
|
@ -4984,6 +5099,8 @@ declare namespace monaco.editor {
|
||||||
|
|
||||||
export interface IMouseTargetOutsideEditor extends IBaseMouseTarget {
|
export interface IMouseTargetOutsideEditor extends IBaseMouseTarget {
|
||||||
readonly type: MouseTargetType.OUTSIDE_EDITOR;
|
readonly type: MouseTargetType.OUTSIDE_EDITOR;
|
||||||
|
readonly outsidePosition: 'above' | 'below' | 'left' | 'right';
|
||||||
|
readonly outsideDistance: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5278,7 +5395,7 @@ declare namespace monaco.editor {
|
||||||
* @id Unique identifier of the contribution.
|
* @id Unique identifier of the contribution.
|
||||||
* @return The action or null if action not found.
|
* @return The action or null if action not found.
|
||||||
*/
|
*/
|
||||||
getAction(id: string): IEditorAction;
|
getAction(id: string): IEditorAction | null;
|
||||||
/**
|
/**
|
||||||
* Execute a command on the editor.
|
* Execute a command on the editor.
|
||||||
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
|
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
|
||||||
|
|
@ -5335,9 +5452,13 @@ declare namespace monaco.editor {
|
||||||
*/
|
*/
|
||||||
getVisibleRanges(): Range[];
|
getVisibleRanges(): Range[];
|
||||||
/**
|
/**
|
||||||
* Get the vertical position (top offset) for the line w.r.t. to the first line.
|
* Get the vertical position (top offset) for the line's top w.r.t. to the first line.
|
||||||
*/
|
*/
|
||||||
getTopForLineNumber(lineNumber: number): number;
|
getTopForLineNumber(lineNumber: number): number;
|
||||||
|
/**
|
||||||
|
* Get the vertical position (top offset) for the line's bottom w.r.t. to the first line.
|
||||||
|
*/
|
||||||
|
getBottomForLineNumber(lineNumber: number): number;
|
||||||
/**
|
/**
|
||||||
* Get the vertical position (top offset) for the position w.r.t. to the first line.
|
* Get the vertical position (top offset) for the position w.r.t. to the first line.
|
||||||
*/
|
*/
|
||||||
|
|
@ -5436,6 +5557,11 @@ declare namespace monaco.editor {
|
||||||
* @event
|
* @event
|
||||||
*/
|
*/
|
||||||
readonly onDidUpdateDiff: IEvent<void>;
|
readonly onDidUpdateDiff: IEvent<void>;
|
||||||
|
/**
|
||||||
|
* An event emitted when the diff model is changed (i.e. the diff editor shows new content).
|
||||||
|
* @event
|
||||||
|
*/
|
||||||
|
readonly onDidChangeModel: IEvent<void>;
|
||||||
/**
|
/**
|
||||||
* Saves current view state of the editor in a serializable object.
|
* Saves current view state of the editor in a serializable object.
|
||||||
*/
|
*/
|
||||||
|
|
@ -5838,6 +5964,10 @@ declare namespace monaco.languages {
|
||||||
* Requested kind of actions to return.
|
* Requested kind of actions to return.
|
||||||
*/
|
*/
|
||||||
readonly only?: string;
|
readonly only?: string;
|
||||||
|
/**
|
||||||
|
* The reason why code actions were requested.
|
||||||
|
*/
|
||||||
|
readonly trigger: CodeActionTriggerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5868,6 +5998,10 @@ declare namespace monaco.languages {
|
||||||
* such as `["quickfix.removeLine", "source.fixAll" ...]`.
|
* such as `["quickfix.removeLine", "source.fixAll" ...]`.
|
||||||
*/
|
*/
|
||||||
readonly providedCodeActionKinds?: readonly string[];
|
readonly providedCodeActionKinds?: readonly string[];
|
||||||
|
readonly documentation?: ReadonlyArray<{
|
||||||
|
readonly kind: string;
|
||||||
|
readonly command: Command;
|
||||||
|
}>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -6440,6 +6574,11 @@ declare namespace monaco.languages {
|
||||||
disabled?: string;
|
disabled?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum CodeActionTriggerType {
|
||||||
|
Invoke = 1,
|
||||||
|
Auto = 2
|
||||||
|
}
|
||||||
|
|
||||||
export interface CodeActionList extends IDisposable {
|
export interface CodeActionList extends IDisposable {
|
||||||
readonly actions: ReadonlyArray<CodeAction>;
|
readonly actions: ReadonlyArray<CodeAction>;
|
||||||
}
|
}
|
||||||
|
|
@ -6776,11 +6915,11 @@ declare namespace monaco.languages {
|
||||||
provideDocumentSymbols(model: editor.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
|
provideDocumentSymbols(model: editor.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TextEdit = {
|
export interface TextEdit {
|
||||||
range: IRange;
|
range: IRange;
|
||||||
text: string;
|
text: string;
|
||||||
eol?: editor.EndOfLineSequence;
|
eol?: editor.EndOfLineSequence;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface used to format a model
|
* Interface used to format a model
|
||||||
|
|
@ -7018,6 +7157,7 @@ declare namespace monaco.languages {
|
||||||
folder?: boolean;
|
folder?: boolean;
|
||||||
skipTrashBin?: boolean;
|
skipTrashBin?: boolean;
|
||||||
maxSize?: number;
|
maxSize?: number;
|
||||||
|
contentsBase64?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IWorkspaceFileEdit {
|
export interface IWorkspaceFileEdit {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue