Merge from vscode 61d5f2b82f17bf9f99f56405204caab88a7e8747

This commit is contained in:
ADS Merger
2020-03-19 06:57:07 +00:00
parent 03ce5d1ba7
commit 84f67f61c4
137 changed files with 13234 additions and 796 deletions

View File

@@ -135,6 +135,11 @@ export interface IEditorOptions {
* Defaults to false.
*/
readOnly?: boolean;
/**
* Rename matching regions on type.
* Defaults to false.
*/
renameOnType?: boolean;
/**
* Should the editor render validation decorations.
* Defaults to editable.
@@ -3382,6 +3387,7 @@ export const enum EditorOption {
quickSuggestions,
quickSuggestionsDelay,
readOnly,
renameOnType,
renderControlCharacters,
renderIndentGuides,
renderFinalNewline,
@@ -3798,6 +3804,10 @@ export const EditorOptions = {
readOnly: register(new EditorBooleanOption(
EditorOption.readOnly, 'readOnly', false,
)),
renameOnType: register(new EditorBooleanOption(
EditorOption.renameOnType, 'renameOnType', false,
{ description: nls.localize('renameOnType', "Controls whether the editor auto renames on type.") }
)),
renderControlCharacters: register(new EditorBooleanOption(
EditorOption.renderControlCharacters, 'renderControlCharacters', false,
{ description: nls.localize('renderControlCharacters', "Controls whether the editor should render control characters.") }

View File

@@ -5,6 +5,7 @@
import { IMarkdownString } from 'vs/base/common/htmlContent';
import { IDisposable } from 'vs/base/common/lifecycle';
import { Event } from 'vs/base/common/event';
import { URI, UriComponents } from 'vs/base/common/uri';
import { ConfigurationChangedEvent, IComputedEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions';
import { IPosition, Position } from 'vs/editor/common/core/position';
@@ -529,6 +530,24 @@ export interface IDiffEditor extends IEditor {
getModifiedEditor(): IEditor;
}
/**
* @internal
*/
export interface ICompositeCodeEditor {
/**
* An event that signals that the active editor has changed
*/
readonly onDidChangeActiveEditor: Event<ICompositeCodeEditor>;
/**
* The active code editor iff any
*/
readonly activeCodeEditor: IEditor | undefined;
// readonly editors: readonly ICodeEditor[] maybe supported with uris
}
/**
* An editor contribution that gets created every time a new editor gets created and gets disposed when the editor gets disposed.
*/

View File

@@ -627,6 +627,12 @@ export interface ITextModel {
*/
equalsTextBuffer(other: ITextBuffer): boolean;
/**
* Get the underling text buffer.
* @internal
*/
getTextBuffer(): ITextBuffer;
/**
* Get the text in a certain range.
* @param range The range describing what text to get.

View File

@@ -384,6 +384,11 @@ export class TextModel extends Disposable implements model.ITextModel {
return this._buffer.equals(other);
}
public getTextBuffer(): model.ITextBuffer {
this._assertNotDisposed();
return this._buffer;
}
private _emitContentChangedEvent(rawChange: ModelRawContentChangedEvent, change: IModelContentChangedEvent): void {
if (this._isDisposing) {
// Do not confuse listeners by emitting any event after disposing

View File

@@ -789,6 +789,20 @@ export interface DocumentHighlightProvider {
provideDocumentHighlights(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;
}
/**
* The rename provider interface defines the contract between extensions and
* the live-rename feature.
*/
export interface OnTypeRenameProvider {
stopPattern?: RegExp;
/**
* Provide a list of ranges that can be live-renamed together.
*/
provideOnTypeRenameRanges(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<IRange[]>;
}
/**
* Value-object that contains additional information when
* requesting references.
@@ -1642,6 +1656,11 @@ export const DocumentSymbolProviderRegistry = new LanguageFeatureRegistry<Docume
*/
export const DocumentHighlightProviderRegistry = new LanguageFeatureRegistry<DocumentHighlightProvider>();
/**
* @internal
*/
export const OnTypeRenameProviderRegistry = new LanguageFeatureRegistry<OnTypeRenameProvider>();
/**
* @internal
*/

View File

@@ -238,47 +238,48 @@ export enum EditorOption {
quickSuggestions = 70,
quickSuggestionsDelay = 71,
readOnly = 72,
renderControlCharacters = 73,
renderIndentGuides = 74,
renderFinalNewline = 75,
renderLineHighlight = 76,
renderValidationDecorations = 77,
renderWhitespace = 78,
revealHorizontalRightPadding = 79,
roundedSelection = 80,
rulers = 81,
scrollbar = 82,
scrollBeyondLastColumn = 83,
scrollBeyondLastLine = 84,
scrollPredominantAxis = 85,
selectionClipboard = 86,
selectionHighlight = 87,
selectOnLineNumbers = 88,
showFoldingControls = 89,
showUnused = 90,
snippetSuggestions = 91,
smoothScrolling = 92,
stopRenderingLineAfter = 93,
suggest = 94,
suggestFontSize = 95,
suggestLineHeight = 96,
suggestOnTriggerCharacters = 97,
suggestSelection = 98,
tabCompletion = 99,
useTabStops = 100,
wordSeparators = 101,
wordWrap = 102,
wordWrapBreakAfterCharacters = 103,
wordWrapBreakBeforeCharacters = 104,
wordWrapColumn = 105,
wordWrapMinified = 106,
wrappingIndent = 107,
wrappingStrategy = 108,
editorClassName = 109,
pixelRatio = 110,
tabFocusMode = 111,
layoutInfo = 112,
wrappingInfo = 113
renameOnType = 73,
renderControlCharacters = 74,
renderIndentGuides = 75,
renderFinalNewline = 76,
renderLineHighlight = 77,
renderValidationDecorations = 78,
renderWhitespace = 79,
revealHorizontalRightPadding = 80,
roundedSelection = 81,
rulers = 82,
scrollbar = 83,
scrollBeyondLastColumn = 84,
scrollBeyondLastLine = 85,
scrollPredominantAxis = 86,
selectionClipboard = 87,
selectionHighlight = 88,
selectOnLineNumbers = 89,
showFoldingControls = 90,
showUnused = 91,
snippetSuggestions = 92,
smoothScrolling = 93,
stopRenderingLineAfter = 94,
suggest = 95,
suggestFontSize = 96,
suggestLineHeight = 97,
suggestOnTriggerCharacters = 98,
suggestSelection = 99,
tabCompletion = 100,
useTabStops = 101,
wordSeparators = 102,
wordWrap = 103,
wordWrapBreakAfterCharacters = 104,
wordWrapBreakBeforeCharacters = 105,
wordWrapColumn = 106,
wordWrapMinified = 107,
wrappingIndent = 108,
wrappingStrategy = 109,
editorClassName = 110,
pixelRatio = 111,
tabFocusMode = 112,
layoutInfo = 113,
wrappingInfo = 114
}
/**