mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-01 01:20:31 -04:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export function getSpaceCnt(str, tabSize) {
|
||||
export function getSpaceCnt(str: string, tabSize: number) {
|
||||
let spacesCnt = 0;
|
||||
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
@@ -17,7 +17,7 @@ export function getSpaceCnt(str, tabSize) {
|
||||
return spacesCnt;
|
||||
}
|
||||
|
||||
export function generateIndent(spacesCnt: number, tabSize, insertSpaces) {
|
||||
export function generateIndent(spacesCnt: number, tabSize: number, insertSpaces: boolean) {
|
||||
spacesCnt = spacesCnt < 0 ? 0 : spacesCnt;
|
||||
|
||||
let result = '';
|
||||
|
||||
@@ -323,7 +323,9 @@ export class ReindentLinesAction extends EditorAction {
|
||||
}
|
||||
let edits = getReindentEditOperations(model, 1, model.getLineCount());
|
||||
if (edits) {
|
||||
editor.pushUndoStop();
|
||||
editor.executeEdits(this.id, edits);
|
||||
editor.pushUndoStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -431,7 +433,7 @@ export class AutoIndentOnPaste implements IEditorContribution {
|
||||
let textEdits: TextEdit[] = [];
|
||||
|
||||
let indentConverter = {
|
||||
shiftIndent: (indentation) => {
|
||||
shiftIndent: (indentation: string) => {
|
||||
let desiredIndentCount = ShiftCommand.shiftIndentCount(indentation, indentation.length + 1, tabSize);
|
||||
let newIndentation = '';
|
||||
for (let i = 0; i < desiredIndentCount; i++) {
|
||||
@@ -440,7 +442,7 @@ export class AutoIndentOnPaste implements IEditorContribution {
|
||||
|
||||
return newIndentation;
|
||||
},
|
||||
unshiftIndent: (indentation) => {
|
||||
unshiftIndent: (indentation: string) => {
|
||||
let desiredIndentCount = ShiftCommand.unshiftIndentCount(indentation, indentation.length + 1, tabSize);
|
||||
let newIndentation = '';
|
||||
for (let i = 0; i < desiredIndentCount; i++) {
|
||||
@@ -496,7 +498,7 @@ export class AutoIndentOnPaste implements IEditorContribution {
|
||||
getLanguageIdAtPosition: (lineNumber: number, column: number) => {
|
||||
return model.getLanguageIdAtPosition(lineNumber, column);
|
||||
},
|
||||
getLineContent: (lineNumber) => {
|
||||
getLineContent: (lineNumber: number) => {
|
||||
if (lineNumber === startLineNumber) {
|
||||
return firstLineText;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user