mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Strict null work in exthost
This commit is contained in:
@@ -97,6 +97,9 @@ export class ExtHostEditors implements ExtHostEditorsShape {
|
||||
|
||||
$acceptEditorPropertiesChanged(id: string, data: IEditorPropertiesChangeData): void {
|
||||
const textEditor = this._extHostDocumentsAndEditors.getEditor(id);
|
||||
if (!textEditor) {
|
||||
throw new Error('unknown text editor');
|
||||
}
|
||||
|
||||
// (1) set all properties
|
||||
if (data.options) {
|
||||
@@ -137,9 +140,12 @@ export class ExtHostEditors implements ExtHostEditorsShape {
|
||||
}
|
||||
|
||||
$acceptEditorPositionData(data: ITextEditorPositionData): void {
|
||||
for (let id in data) {
|
||||
let textEditor = this._extHostDocumentsAndEditors.getEditor(id);
|
||||
let viewColumn = TypeConverters.ViewColumn.to(data[id]);
|
||||
for (const id in data) {
|
||||
const textEditor = this._extHostDocumentsAndEditors.getEditor(id);
|
||||
if (!textEditor) {
|
||||
throw new Error('Unknown text editor');
|
||||
}
|
||||
const viewColumn = TypeConverters.ViewColumn.to(data[id]);
|
||||
if (textEditor.viewColumn !== viewColumn) {
|
||||
textEditor._acceptViewColumn(viewColumn);
|
||||
this._onDidChangeTextEditorViewColumn.fire({ textEditor, viewColumn });
|
||||
|
||||
Reference in New Issue
Block a user